
com.azure.resourcemanager.relay.fluent.models.RelayNamespaceProperties Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.relay.fluent.models;
import com.azure.core.annotation.Immutable;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.relay.models.ProvisioningStateEnum;
import java.io.IOException;
import java.time.OffsetDateTime;
/**
* Properties of the namespace.
*/
@Immutable
public final class RelayNamespaceProperties implements JsonSerializable {
/*
* The provisioningState property.
*/
private ProvisioningStateEnum provisioningState;
/*
* The time the namespace was created.
*/
private OffsetDateTime createdAt;
/*
* The time the namespace was updated.
*/
private OffsetDateTime updatedAt;
/*
* Endpoint you can use to perform Service Bus operations.
*/
private String serviceBusEndpoint;
/*
* Identifier for Azure Insights metrics.
*/
private String metricId;
/**
* Creates an instance of RelayNamespaceProperties class.
*/
public RelayNamespaceProperties() {
}
/**
* Get the provisioningState property: The provisioningState property.
*
* @return the provisioningState value.
*/
public ProvisioningStateEnum provisioningState() {
return this.provisioningState;
}
/**
* Get the createdAt property: The time the namespace was created.
*
* @return the createdAt value.
*/
public OffsetDateTime createdAt() {
return this.createdAt;
}
/**
* Get the updatedAt property: The time the namespace was updated.
*
* @return the updatedAt value.
*/
public OffsetDateTime updatedAt() {
return this.updatedAt;
}
/**
* Get the serviceBusEndpoint property: Endpoint you can use to perform Service Bus operations.
*
* @return the serviceBusEndpoint value.
*/
public String serviceBusEndpoint() {
return this.serviceBusEndpoint;
}
/**
* Get the metricId property: Identifier for Azure Insights metrics.
*
* @return the metricId value.
*/
public String metricId() {
return this.metricId;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of RelayNamespaceProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of RelayNamespaceProperties if the JsonReader was pointing to an instance of it, or null if
* it was pointing to JSON null.
* @throws IOException If an error occurs while reading the RelayNamespaceProperties.
*/
public static RelayNamespaceProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
RelayNamespaceProperties deserializedRelayNamespaceProperties = new RelayNamespaceProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("provisioningState".equals(fieldName)) {
deserializedRelayNamespaceProperties.provisioningState
= ProvisioningStateEnum.fromString(reader.getString());
} else if ("createdAt".equals(fieldName)) {
deserializedRelayNamespaceProperties.createdAt = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("updatedAt".equals(fieldName)) {
deserializedRelayNamespaceProperties.updatedAt = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("serviceBusEndpoint".equals(fieldName)) {
deserializedRelayNamespaceProperties.serviceBusEndpoint = reader.getString();
} else if ("metricId".equals(fieldName)) {
deserializedRelayNamespaceProperties.metricId = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedRelayNamespaceProperties;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy