com.azure.resourcemanager.dnsresolver.fluent.models.DnsResolverPolicyProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-dnsresolver Show documentation
Show all versions of azure-resourcemanager-dnsresolver Show documentation
This package contains Microsoft Azure SDK for DnsResolver Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The DNS Resolver Management Client. Package tag package-2022-07.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.dnsresolver.fluent.models;
import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.dnsresolver.models.ProvisioningState;
import java.io.IOException;
/**
* Represents the properties of a DNS resolver policy.
*/
@Immutable
public final class DnsResolverPolicyProperties implements JsonSerializable {
/*
* The current provisioning state of the DNS resolver policy. This is a read-only property and any attempt to set
* this value will be ignored.
*/
private ProvisioningState provisioningState;
/*
* The resourceGuid property of the DNS resolver policy resource.
*/
private String resourceGuid;
/**
* Creates an instance of DnsResolverPolicyProperties class.
*/
public DnsResolverPolicyProperties() {
}
/**
* Get the provisioningState property: The current provisioning state of the DNS resolver policy. This is a
* read-only property and any attempt to set this value will be ignored.
*
* @return the provisioningState value.
*/
public ProvisioningState provisioningState() {
return this.provisioningState;
}
/**
* Get the resourceGuid property: The resourceGuid property of the DNS resolver policy resource.
*
* @return the resourceGuid value.
*/
public String resourceGuid() {
return this.resourceGuid;
}
/**
* 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 DnsResolverPolicyProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of DnsResolverPolicyProperties 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 DnsResolverPolicyProperties.
*/
public static DnsResolverPolicyProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
DnsResolverPolicyProperties deserializedDnsResolverPolicyProperties = new DnsResolverPolicyProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("provisioningState".equals(fieldName)) {
deserializedDnsResolverPolicyProperties.provisioningState
= ProvisioningState.fromString(reader.getString());
} else if ("resourceGuid".equals(fieldName)) {
deserializedDnsResolverPolicyProperties.resourceGuid = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedDnsResolverPolicyProperties;
});
}
}