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

com.azure.resourcemanager.storagecache.fluent.models.ApiOperationInner Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for StorageCache Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Managed Lustre provides a fully managed Lustre® file system, integrated with Blob storage, for use on demand. These operations create and manage Azure Managed Lustre file systems. Package tag package-2024-03.

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.storagecache.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 com.azure.resourcemanager.storagecache.models.ApiOperationDisplay;
import com.azure.resourcemanager.storagecache.models.ApiOperationPropertiesServiceSpecification;
import java.io.IOException;

/**
 * REST API operation description: see
 * https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/openapi-authoring-automated-guidelines.md#r3023-operationsapiimplementation.
 */
@Fluent
public final class ApiOperationInner implements JsonSerializable {
    /*
     * The object that represents the operation.
     */
    private ApiOperationDisplay display;

    /*
     * Origin of the operation.
     */
    private String origin;

    /*
     * The flag that indicates whether the operation applies to data plane.
     */
    private Boolean isDataAction;

    /*
     * Operation name: {provider}/{resource}/{operation}
     */
    private String name;

    /*
     * Additional details about an operation.
     */
    private ApiOperationProperties innerProperties;

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

    /**
     * Get the display property: The object that represents the operation.
     * 
     * @return the display value.
     */
    public ApiOperationDisplay display() {
        return this.display;
    }

    /**
     * Set the display property: The object that represents the operation.
     * 
     * @param display the display value to set.
     * @return the ApiOperationInner object itself.
     */
    public ApiOperationInner withDisplay(ApiOperationDisplay display) {
        this.display = display;
        return this;
    }

    /**
     * Get the origin property: Origin of the operation.
     * 
     * @return the origin value.
     */
    public String origin() {
        return this.origin;
    }

    /**
     * Set the origin property: Origin of the operation.
     * 
     * @param origin the origin value to set.
     * @return the ApiOperationInner object itself.
     */
    public ApiOperationInner withOrigin(String origin) {
        this.origin = origin;
        return this;
    }

    /**
     * Get the isDataAction property: The flag that indicates whether the operation applies to data plane.
     * 
     * @return the isDataAction value.
     */
    public Boolean isDataAction() {
        return this.isDataAction;
    }

    /**
     * Set the isDataAction property: The flag that indicates whether the operation applies to data plane.
     * 
     * @param isDataAction the isDataAction value to set.
     * @return the ApiOperationInner object itself.
     */
    public ApiOperationInner withIsDataAction(Boolean isDataAction) {
        this.isDataAction = isDataAction;
        return this;
    }

    /**
     * Get the name property: Operation name: {provider}/{resource}/{operation}.
     * 
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: Operation name: {provider}/{resource}/{operation}.
     * 
     * @param name the name value to set.
     * @return the ApiOperationInner object itself.
     */
    public ApiOperationInner withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the innerProperties property: Additional details about an operation.
     * 
     * @return the innerProperties value.
     */
    private ApiOperationProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the serviceSpecification property: Specification of the all the metrics provided for a resource type.
     * 
     * @return the serviceSpecification value.
     */
    public ApiOperationPropertiesServiceSpecification serviceSpecification() {
        return this.innerProperties() == null ? null : this.innerProperties().serviceSpecification();
    }

    /**
     * Set the serviceSpecification property: Specification of the all the metrics provided for a resource type.
     * 
     * @param serviceSpecification the serviceSpecification value to set.
     * @return the ApiOperationInner object itself.
     */
    public ApiOperationInner withServiceSpecification(ApiOperationPropertiesServiceSpecification serviceSpecification) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApiOperationProperties();
        }
        this.innerProperties().withServiceSpecification(serviceSpecification);
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (display() != null) {
            display().validate();
        }
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeJsonField("display", this.display);
        jsonWriter.writeStringField("origin", this.origin);
        jsonWriter.writeBooleanField("isDataAction", this.isDataAction);
        jsonWriter.writeStringField("name", this.name);
        jsonWriter.writeJsonField("properties", this.innerProperties);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of ApiOperationInner from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of ApiOperationInner 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 ApiOperationInner.
     */
    public static ApiOperationInner fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            ApiOperationInner deserializedApiOperationInner = new ApiOperationInner();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("display".equals(fieldName)) {
                    deserializedApiOperationInner.display = ApiOperationDisplay.fromJson(reader);
                } else if ("origin".equals(fieldName)) {
                    deserializedApiOperationInner.origin = reader.getString();
                } else if ("isDataAction".equals(fieldName)) {
                    deserializedApiOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean);
                } else if ("name".equals(fieldName)) {
                    deserializedApiOperationInner.name = reader.getString();
                } else if ("properties".equals(fieldName)) {
                    deserializedApiOperationInner.innerProperties = ApiOperationProperties.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedApiOperationInner;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy