All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.mediaservices.fluent.models.EntityNameAvailabilityCheckOutputInner Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for MediaServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. This Swagger was generated by the API Framework. Package tag package-account-2023-01.

The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.mediaservices.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * The response from the check name availability request.
 */
@Fluent
public final class EntityNameAvailabilityCheckOutputInner
    implements JsonSerializable {
    /*
     * Specifies if the name is available.
     */
    private boolean nameAvailable;

    /*
     * Specifies the reason if the name is not available.
     */
    private String reason;

    /*
     * Specifies the detailed reason if the name is not available.
     */
    private String message;

    /**
     * Creates an instance of EntityNameAvailabilityCheckOutputInner class.
     */
    public EntityNameAvailabilityCheckOutputInner() {
    }

    /**
     * Get the nameAvailable property: Specifies if the name is available.
     * 
     * @return the nameAvailable value.
     */
    public boolean nameAvailable() {
        return this.nameAvailable;
    }

    /**
     * Set the nameAvailable property: Specifies if the name is available.
     * 
     * @param nameAvailable the nameAvailable value to set.
     * @return the EntityNameAvailabilityCheckOutputInner object itself.
     */
    public EntityNameAvailabilityCheckOutputInner withNameAvailable(boolean nameAvailable) {
        this.nameAvailable = nameAvailable;
        return this;
    }

    /**
     * Get the reason property: Specifies the reason if the name is not available.
     * 
     * @return the reason value.
     */
    public String reason() {
        return this.reason;
    }

    /**
     * Set the reason property: Specifies the reason if the name is not available.
     * 
     * @param reason the reason value to set.
     * @return the EntityNameAvailabilityCheckOutputInner object itself.
     */
    public EntityNameAvailabilityCheckOutputInner withReason(String reason) {
        this.reason = reason;
        return this;
    }

    /**
     * Get the message property: Specifies the detailed reason if the name is not available.
     * 
     * @return the message value.
     */
    public String message() {
        return this.message;
    }

    /**
     * Set the message property: Specifies the detailed reason if the name is not available.
     * 
     * @param message the message value to set.
     * @return the EntityNameAvailabilityCheckOutputInner object itself.
     */
    public EntityNameAvailabilityCheckOutputInner withMessage(String message) {
        this.message = message;
        return this;
    }

    /**
     * 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();
        jsonWriter.writeBooleanField("nameAvailable", this.nameAvailable);
        jsonWriter.writeStringField("reason", this.reason);
        jsonWriter.writeStringField("message", this.message);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of EntityNameAvailabilityCheckOutputInner from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of EntityNameAvailabilityCheckOutputInner if the JsonReader was pointing to an instance of
     * it, or null if it was pointing to JSON null.
     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
     * @throws IOException If an error occurs while reading the EntityNameAvailabilityCheckOutputInner.
     */
    public static EntityNameAvailabilityCheckOutputInner fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            EntityNameAvailabilityCheckOutputInner deserializedEntityNameAvailabilityCheckOutputInner
                = new EntityNameAvailabilityCheckOutputInner();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("nameAvailable".equals(fieldName)) {
                    deserializedEntityNameAvailabilityCheckOutputInner.nameAvailable = reader.getBoolean();
                } else if ("reason".equals(fieldName)) {
                    deserializedEntityNameAvailabilityCheckOutputInner.reason = reader.getString();
                } else if ("message".equals(fieldName)) {
                    deserializedEntityNameAvailabilityCheckOutputInner.message = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedEntityNameAvailabilityCheckOutputInner;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy