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

com.azure.resourcemanager.automation.fluent.models.RunbookDraftUndoEditResultInner Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for Automation Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Automation Client. Package tag package-2022-02-22.

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.automation.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.automation.models.HttpStatusCode;
import java.io.IOException;

/**
 * The response model for the undo edit runbook operation.
 */
@Fluent
public final class RunbookDraftUndoEditResultInner implements JsonSerializable {
    /*
     * The statusCode property.
     */
    private HttpStatusCode statusCode;

    /*
     * The requestId property.
     */
    private String requestId;

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

    /**
     * Get the statusCode property: The statusCode property.
     * 
     * @return the statusCode value.
     */
    public HttpStatusCode statusCode() {
        return this.statusCode;
    }

    /**
     * Set the statusCode property: The statusCode property.
     * 
     * @param statusCode the statusCode value to set.
     * @return the RunbookDraftUndoEditResultInner object itself.
     */
    public RunbookDraftUndoEditResultInner withStatusCode(HttpStatusCode statusCode) {
        this.statusCode = statusCode;
        return this;
    }

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

    /**
     * Set the requestId property: The requestId property.
     * 
     * @param requestId the requestId value to set.
     * @return the RunbookDraftUndoEditResultInner object itself.
     */
    public RunbookDraftUndoEditResultInner withRequestId(String requestId) {
        this.requestId = requestId;
        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("statusCode", this.statusCode == null ? null : this.statusCode.toString());
        jsonWriter.writeStringField("requestId", this.requestId);
        return jsonWriter.writeEndObject();
    }

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

                if ("statusCode".equals(fieldName)) {
                    deserializedRunbookDraftUndoEditResultInner.statusCode
                        = HttpStatusCode.fromString(reader.getString());
                } else if ("requestId".equals(fieldName)) {
                    deserializedRunbookDraftUndoEditResultInner.requestId = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedRunbookDraftUndoEditResultInner;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy