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

com.azure.resourcemanager.storagecache.fluent.models.AscOperationInner 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.AscOperationErrorResponse;
import java.io.IOException;
import java.util.Map;

/**
 * The status of operation.
 */
@Fluent
public final class AscOperationInner implements JsonSerializable {
    /*
     * The operation Id.
     */
    private String id;

    /*
     * The operation name.
     */
    private String name;

    /*
     * The start time of the operation.
     */
    private String startTime;

    /*
     * The end time of the operation.
     */
    private String endTime;

    /*
     * The status of the operation.
     */
    private String status;

    /*
     * The error detail of the operation if any.
     */
    private AscOperationErrorResponse error;

    /*
     * Additional operation-specific properties
     */
    private AscOperationProperties innerProperties;

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

    /**
     * Get the id property: The operation Id.
     * 
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

    /**
     * Set the id property: The operation Id.
     * 
     * @param id the id value to set.
     * @return the AscOperationInner object itself.
     */
    public AscOperationInner withId(String id) {
        this.id = id;
        return this;
    }

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

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

    /**
     * Get the startTime property: The start time of the operation.
     * 
     * @return the startTime value.
     */
    public String startTime() {
        return this.startTime;
    }

    /**
     * Set the startTime property: The start time of the operation.
     * 
     * @param startTime the startTime value to set.
     * @return the AscOperationInner object itself.
     */
    public AscOperationInner withStartTime(String startTime) {
        this.startTime = startTime;
        return this;
    }

    /**
     * Get the endTime property: The end time of the operation.
     * 
     * @return the endTime value.
     */
    public String endTime() {
        return this.endTime;
    }

    /**
     * Set the endTime property: The end time of the operation.
     * 
     * @param endTime the endTime value to set.
     * @return the AscOperationInner object itself.
     */
    public AscOperationInner withEndTime(String endTime) {
        this.endTime = endTime;
        return this;
    }

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

    /**
     * Set the status property: The status of the operation.
     * 
     * @param status the status value to set.
     * @return the AscOperationInner object itself.
     */
    public AscOperationInner withStatus(String status) {
        this.status = status;
        return this;
    }

    /**
     * Get the error property: The error detail of the operation if any.
     * 
     * @return the error value.
     */
    public AscOperationErrorResponse error() {
        return this.error;
    }

    /**
     * Set the error property: The error detail of the operation if any.
     * 
     * @param error the error value to set.
     * @return the AscOperationInner object itself.
     */
    public AscOperationInner withError(AscOperationErrorResponse error) {
        this.error = error;
        return this;
    }

    /**
     * Get the innerProperties property: Additional operation-specific properties.
     * 
     * @return the innerProperties value.
     */
    private AscOperationProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the output property: Additional operation-specific output.
     * 
     * @return the output value.
     */
    public Map output() {
        return this.innerProperties() == null ? null : this.innerProperties().output();
    }

    /**
     * Set the output property: Additional operation-specific output.
     * 
     * @param output the output value to set.
     * @return the AscOperationInner object itself.
     */
    public AscOperationInner withOutput(Map output) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AscOperationProperties();
        }
        this.innerProperties().withOutput(output);
        return this;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("id", this.id);
        jsonWriter.writeStringField("name", this.name);
        jsonWriter.writeStringField("startTime", this.startTime);
        jsonWriter.writeStringField("endTime", this.endTime);
        jsonWriter.writeStringField("status", this.status);
        jsonWriter.writeJsonField("error", this.error);
        jsonWriter.writeJsonField("properties", this.innerProperties);
        return jsonWriter.writeEndObject();
    }

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

                if ("id".equals(fieldName)) {
                    deserializedAscOperationInner.id = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedAscOperationInner.name = reader.getString();
                } else if ("startTime".equals(fieldName)) {
                    deserializedAscOperationInner.startTime = reader.getString();
                } else if ("endTime".equals(fieldName)) {
                    deserializedAscOperationInner.endTime = reader.getString();
                } else if ("status".equals(fieldName)) {
                    deserializedAscOperationInner.status = reader.getString();
                } else if ("error".equals(fieldName)) {
                    deserializedAscOperationInner.error = AscOperationErrorResponse.fromJson(reader);
                } else if ("properties".equals(fieldName)) {
                    deserializedAscOperationInner.innerProperties = AscOperationProperties.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedAscOperationInner;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy