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

com.azure.resourcemanager.automation.models.RunbookUpdateParameters Maven / Gradle / Ivy

// 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.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.fluent.models.RunbookUpdateProperties;
import java.io.IOException;
import java.util.Map;

/**
 * The parameters supplied to the update runbook operation.
 */
@Fluent
public final class RunbookUpdateParameters implements JsonSerializable {
    /*
     * Gets or sets the runbook update properties.
     */
    private RunbookUpdateProperties innerProperties;

    /*
     * Gets or sets the name of the resource.
     */
    private String name;

    /*
     * Gets or sets the location of the resource.
     */
    private String location;

    /*
     * Gets or sets the tags attached to the resource.
     */
    private Map tags;

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

    /**
     * Get the innerProperties property: Gets or sets the runbook update properties.
     * 
     * @return the innerProperties value.
     */
    private RunbookUpdateProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the name property: Gets or sets the name of the resource.
     * 
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: Gets or sets the name of the resource.
     * 
     * @param name the name value to set.
     * @return the RunbookUpdateParameters object itself.
     */
    public RunbookUpdateParameters withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the location property: Gets or sets the location of the resource.
     * 
     * @return the location value.
     */
    public String location() {
        return this.location;
    }

    /**
     * Set the location property: Gets or sets the location of the resource.
     * 
     * @param location the location value to set.
     * @return the RunbookUpdateParameters object itself.
     */
    public RunbookUpdateParameters withLocation(String location) {
        this.location = location;
        return this;
    }

    /**
     * Get the tags property: Gets or sets the tags attached to the resource.
     * 
     * @return the tags value.
     */
    public Map tags() {
        return this.tags;
    }

    /**
     * Set the tags property: Gets or sets the tags attached to the resource.
     * 
     * @param tags the tags value to set.
     * @return the RunbookUpdateParameters object itself.
     */
    public RunbookUpdateParameters withTags(Map tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the description property: Gets or sets the description of the runbook.
     * 
     * @return the description value.
     */
    public String description() {
        return this.innerProperties() == null ? null : this.innerProperties().description();
    }

    /**
     * Set the description property: Gets or sets the description of the runbook.
     * 
     * @param description the description value to set.
     * @return the RunbookUpdateParameters object itself.
     */
    public RunbookUpdateParameters withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RunbookUpdateProperties();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

    /**
     * Get the logVerbose property: Gets or sets verbose log option.
     * 
     * @return the logVerbose value.
     */
    public Boolean logVerbose() {
        return this.innerProperties() == null ? null : this.innerProperties().logVerbose();
    }

    /**
     * Set the logVerbose property: Gets or sets verbose log option.
     * 
     * @param logVerbose the logVerbose value to set.
     * @return the RunbookUpdateParameters object itself.
     */
    public RunbookUpdateParameters withLogVerbose(Boolean logVerbose) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RunbookUpdateProperties();
        }
        this.innerProperties().withLogVerbose(logVerbose);
        return this;
    }

    /**
     * Get the logProgress property: Gets or sets progress log option.
     * 
     * @return the logProgress value.
     */
    public Boolean logProgress() {
        return this.innerProperties() == null ? null : this.innerProperties().logProgress();
    }

    /**
     * Set the logProgress property: Gets or sets progress log option.
     * 
     * @param logProgress the logProgress value to set.
     * @return the RunbookUpdateParameters object itself.
     */
    public RunbookUpdateParameters withLogProgress(Boolean logProgress) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RunbookUpdateProperties();
        }
        this.innerProperties().withLogProgress(logProgress);
        return this;
    }

    /**
     * Get the logActivityTrace property: Gets or sets the activity-level tracing options of the runbook.
     * 
     * @return the logActivityTrace value.
     */
    public Integer logActivityTrace() {
        return this.innerProperties() == null ? null : this.innerProperties().logActivityTrace();
    }

    /**
     * Set the logActivityTrace property: Gets or sets the activity-level tracing options of the runbook.
     * 
     * @param logActivityTrace the logActivityTrace value to set.
     * @return the RunbookUpdateParameters object itself.
     */
    public RunbookUpdateParameters withLogActivityTrace(Integer logActivityTrace) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RunbookUpdateProperties();
        }
        this.innerProperties().withLogActivityTrace(logActivityTrace);
        return this;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeJsonField("properties", this.innerProperties);
        jsonWriter.writeStringField("name", this.name);
        jsonWriter.writeStringField("location", this.location);
        jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element));
        return jsonWriter.writeEndObject();
    }

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

                if ("properties".equals(fieldName)) {
                    deserializedRunbookUpdateParameters.innerProperties = RunbookUpdateProperties.fromJson(reader);
                } else if ("name".equals(fieldName)) {
                    deserializedRunbookUpdateParameters.name = reader.getString();
                } else if ("location".equals(fieldName)) {
                    deserializedRunbookUpdateParameters.location = reader.getString();
                } else if ("tags".equals(fieldName)) {
                    Map tags = reader.readMap(reader1 -> reader1.getString());
                    deserializedRunbookUpdateParameters.tags = tags;
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedRunbookUpdateParameters;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy