
com.azure.resourcemanager.frontdoor.fluent.models.CheckNameAvailabilityOutputInner 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.frontdoor.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.frontdoor.models.Availability;
import java.io.IOException;
/**
* Output of check name availability API.
*/
@Immutable
public final class CheckNameAvailabilityOutputInner implements JsonSerializable {
/*
* Indicates whether the name is available.
*/
private Availability nameAvailability;
/*
* The reason why the name is not available.
*/
private String reason;
/*
* The detailed error message describing why the name is not available.
*/
private String message;
/**
* Creates an instance of CheckNameAvailabilityOutputInner class.
*/
public CheckNameAvailabilityOutputInner() {
}
/**
* Get the nameAvailability property: Indicates whether the name is available.
*
* @return the nameAvailability value.
*/
public Availability nameAvailability() {
return this.nameAvailability;
}
/**
* Get the reason property: The reason why the name is not available.
*
* @return the reason value.
*/
public String reason() {
return this.reason;
}
/**
* Get the message property: The detailed error message describing why the name is not available.
*
* @return the message value.
*/
public String message() {
return this.message;
}
/**
* 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 CheckNameAvailabilityOutputInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of CheckNameAvailabilityOutputInner 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 CheckNameAvailabilityOutputInner.
*/
public static CheckNameAvailabilityOutputInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
CheckNameAvailabilityOutputInner deserializedCheckNameAvailabilityOutputInner
= new CheckNameAvailabilityOutputInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("nameAvailability".equals(fieldName)) {
deserializedCheckNameAvailabilityOutputInner.nameAvailability
= Availability.fromString(reader.getString());
} else if ("reason".equals(fieldName)) {
deserializedCheckNameAvailabilityOutputInner.reason = reader.getString();
} else if ("message".equals(fieldName)) {
deserializedCheckNameAvailabilityOutputInner.message = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedCheckNameAvailabilityOutputInner;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy