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

com.azure.resourcemanager.monitor.models.ActionDetail Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure Monitor SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt

There is a newer version: 2.46.0
Show 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.monitor.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 action detail.
 */
@Fluent
public final class ActionDetail implements JsonSerializable {
    /*
     * The mechanism type
     */
    private String mechanismType;

    /*
     * The name of the action
     */
    private String name;

    /*
     * The status of the action
     */
    private String status;

    /*
     * The substatus of the action
     */
    private String subState;

    /*
     * The send time
     */
    private String sendTime;

    /*
     * The detail of the friendly error message
     */
    private String detail;

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

    /**
     * Get the mechanismType property: The mechanism type.
     * 
     * @return the mechanismType value.
     */
    public String mechanismType() {
        return this.mechanismType;
    }

    /**
     * Set the mechanismType property: The mechanism type.
     * 
     * @param mechanismType the mechanismType value to set.
     * @return the ActionDetail object itself.
     */
    public ActionDetail withMechanismType(String mechanismType) {
        this.mechanismType = mechanismType;
        return this;
    }

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

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

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

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

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

    /**
     * Set the subState property: The substatus of the action.
     * 
     * @param subState the subState value to set.
     * @return the ActionDetail object itself.
     */
    public ActionDetail withSubState(String subState) {
        this.subState = subState;
        return this;
    }

    /**
     * Get the sendTime property: The send time.
     * 
     * @return the sendTime value.
     */
    public String sendTime() {
        return this.sendTime;
    }

    /**
     * Set the sendTime property: The send time.
     * 
     * @param sendTime the sendTime value to set.
     * @return the ActionDetail object itself.
     */
    public ActionDetail withSendTime(String sendTime) {
        this.sendTime = sendTime;
        return this;
    }

    /**
     * Get the detail property: The detail of the friendly error message.
     * 
     * @return the detail value.
     */
    public String detail() {
        return this.detail;
    }

    /**
     * Set the detail property: The detail of the friendly error message.
     * 
     * @param detail the detail value to set.
     * @return the ActionDetail object itself.
     */
    public ActionDetail withDetail(String detail) {
        this.detail = detail;
        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.writeStringField("MechanismType", this.mechanismType);
        jsonWriter.writeStringField("Name", this.name);
        jsonWriter.writeStringField("Status", this.status);
        jsonWriter.writeStringField("SubState", this.subState);
        jsonWriter.writeStringField("SendTime", this.sendTime);
        jsonWriter.writeStringField("Detail", this.detail);
        return jsonWriter.writeEndObject();
    }

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

                if ("MechanismType".equals(fieldName)) {
                    deserializedActionDetail.mechanismType = reader.getString();
                } else if ("Name".equals(fieldName)) {
                    deserializedActionDetail.name = reader.getString();
                } else if ("Status".equals(fieldName)) {
                    deserializedActionDetail.status = reader.getString();
                } else if ("SubState".equals(fieldName)) {
                    deserializedActionDetail.subState = reader.getString();
                } else if ("SendTime".equals(fieldName)) {
                    deserializedActionDetail.sendTime = reader.getString();
                } else if ("Detail".equals(fieldName)) {
                    deserializedActionDetail.detail = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedActionDetail;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy