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

com.azure.resourcemanager.botservice.fluent.models.OperationResultsDescriptionInner Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for BotService Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Bot Service is a platform for creating smart conversational agents. Package tag package-2021-03-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.botservice.fluent.models;

import com.azure.core.annotation.Immutable;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.botservice.models.OperationResultStatus;
import java.io.IOException;
import java.time.OffsetDateTime;

/**
 * The properties indicating the operation result of an operation on a service.
 */
@Immutable
public final class OperationResultsDescriptionInner implements JsonSerializable {
    /*
     * The ID of the operation returned.
     */
    private String id;

    /*
     * The name of the operation result.
     */
    private String name;

    /*
     * The status of the operation being performed.
     */
    private OperationResultStatus status;

    /*
     * The time that the operation was started.
     */
    private OffsetDateTime startTime;

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

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

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

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

    /**
     * Get the startTime property: The time that the operation was started.
     * 
     * @return the startTime value.
     */
    public OffsetDateTime startTime() {
        return this.startTime;
    }

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

                if ("id".equals(fieldName)) {
                    deserializedOperationResultsDescriptionInner.id = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedOperationResultsDescriptionInner.name = reader.getString();
                } else if ("status".equals(fieldName)) {
                    deserializedOperationResultsDescriptionInner.status
                        = OperationResultStatus.fromString(reader.getString());
                } else if ("startTime".equals(fieldName)) {
                    deserializedOperationResultsDescriptionInner.startTime = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedOperationResultsDescriptionInner;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy