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

com.azure.resourcemanager.automation.fluent.models.DscConfigurationInner 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.core.management.Resource;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.automation.models.ContentSource;
import com.azure.resourcemanager.automation.models.DscConfigurationParameter;
import com.azure.resourcemanager.automation.models.DscConfigurationProvisioningState;
import com.azure.resourcemanager.automation.models.DscConfigurationState;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.Map;

/**
 * Definition of the configuration type.
 */
@Fluent
public final class DscConfigurationInner extends Resource {
    /*
     * Gets or sets the configuration properties.
     */
    private DscConfigurationProperties innerProperties;

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

    /*
     * The type of the resource.
     */
    private String type;

    /*
     * The name of the resource.
     */
    private String name;

    /*
     * Fully qualified resource Id for the resource.
     */
    private String id;

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

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

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

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

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

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

    /**
     * Get the id property: Fully qualified resource Id for the resource.
     * 
     * @return the id value.
     */
    @Override
    public String id() {
        return this.id;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public DscConfigurationInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public DscConfigurationInner withTags(Map tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Get the provisioningState property: Gets or sets the provisioning state of the configuration.
     * 
     * @return the provisioningState value.
     */
    public DscConfigurationProvisioningState provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Set the provisioningState property: Gets or sets the provisioning state of the configuration.
     * 
     * @param provisioningState the provisioningState value to set.
     * @return the DscConfigurationInner object itself.
     */
    public DscConfigurationInner withProvisioningState(DscConfigurationProvisioningState provisioningState) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationProperties();
        }
        this.innerProperties().withProvisioningState(provisioningState);
        return this;
    }

    /**
     * Get the jobCount property: Gets or sets the job count of the configuration.
     * 
     * @return the jobCount value.
     */
    public Integer jobCount() {
        return this.innerProperties() == null ? null : this.innerProperties().jobCount();
    }

    /**
     * Set the jobCount property: Gets or sets the job count of the configuration.
     * 
     * @param jobCount the jobCount value to set.
     * @return the DscConfigurationInner object itself.
     */
    public DscConfigurationInner withJobCount(Integer jobCount) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationProperties();
        }
        this.innerProperties().withJobCount(jobCount);
        return this;
    }

    /**
     * Get the parameters property: Gets or sets the configuration parameters.
     * 
     * @return the parameters value.
     */
    public Map parameters() {
        return this.innerProperties() == null ? null : this.innerProperties().parameters();
    }

    /**
     * Set the parameters property: Gets or sets the configuration parameters.
     * 
     * @param parameters the parameters value to set.
     * @return the DscConfigurationInner object itself.
     */
    public DscConfigurationInner withParameters(Map parameters) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationProperties();
        }
        this.innerProperties().withParameters(parameters);
        return this;
    }

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

    /**
     * Set the source property: Gets or sets the source.
     * 
     * @param source the source value to set.
     * @return the DscConfigurationInner object itself.
     */
    public DscConfigurationInner withSource(ContentSource source) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationProperties();
        }
        this.innerProperties().withSource(source);
        return this;
    }

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

    /**
     * Set the state property: Gets or sets the state of the configuration.
     * 
     * @param state the state value to set.
     * @return the DscConfigurationInner object itself.
     */
    public DscConfigurationInner withState(DscConfigurationState state) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationProperties();
        }
        this.innerProperties().withState(state);
        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 DscConfigurationInner object itself.
     */
    public DscConfigurationInner withLogVerbose(Boolean logVerbose) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationProperties();
        }
        this.innerProperties().withLogVerbose(logVerbose);
        return this;
    }

    /**
     * Get the creationTime property: Gets or sets the creation time.
     * 
     * @return the creationTime value.
     */
    public OffsetDateTime creationTime() {
        return this.innerProperties() == null ? null : this.innerProperties().creationTime();
    }

    /**
     * Set the creationTime property: Gets or sets the creation time.
     * 
     * @param creationTime the creationTime value to set.
     * @return the DscConfigurationInner object itself.
     */
    public DscConfigurationInner withCreationTime(OffsetDateTime creationTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationProperties();
        }
        this.innerProperties().withCreationTime(creationTime);
        return this;
    }

    /**
     * Get the lastModifiedTime property: Gets or sets the last modified time.
     * 
     * @return the lastModifiedTime value.
     */
    public OffsetDateTime lastModifiedTime() {
        return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime();
    }

    /**
     * Set the lastModifiedTime property: Gets or sets the last modified time.
     * 
     * @param lastModifiedTime the lastModifiedTime value to set.
     * @return the DscConfigurationInner object itself.
     */
    public DscConfigurationInner withLastModifiedTime(OffsetDateTime lastModifiedTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationProperties();
        }
        this.innerProperties().withLastModifiedTime(lastModifiedTime);
        return this;
    }

    /**
     * Get the nodeConfigurationCount property: Gets the number of compiled node configurations.
     * 
     * @return the nodeConfigurationCount value.
     */
    public Integer nodeConfigurationCount() {
        return this.innerProperties() == null ? null : this.innerProperties().nodeConfigurationCount();
    }

    /**
     * Set the nodeConfigurationCount property: Gets the number of compiled node configurations.
     * 
     * @param nodeConfigurationCount the nodeConfigurationCount value to set.
     * @return the DscConfigurationInner object itself.
     */
    public DscConfigurationInner withNodeConfigurationCount(Integer nodeConfigurationCount) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationProperties();
        }
        this.innerProperties().withNodeConfigurationCount(nodeConfigurationCount);
        return this;
    }

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

    /**
     * Set the description property: Gets or sets the description.
     * 
     * @param description the description value to set.
     * @return the DscConfigurationInner object itself.
     */
    public DscConfigurationInner withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationProperties();
        }
        this.innerProperties().withDescription(description);
        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.writeStringField("location", location());
        jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
        jsonWriter.writeJsonField("properties", this.innerProperties);
        jsonWriter.writeStringField("etag", this.etag);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of DscConfigurationInner from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of DscConfigurationInner if the JsonReader was pointing to an instance of it, or null if it
     * was pointing to JSON null.
     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
     * @throws IOException If an error occurs while reading the DscConfigurationInner.
     */
    public static DscConfigurationInner fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            DscConfigurationInner deserializedDscConfigurationInner = new DscConfigurationInner();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("id".equals(fieldName)) {
                    deserializedDscConfigurationInner.id = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedDscConfigurationInner.name = reader.getString();
                } else if ("type".equals(fieldName)) {
                    deserializedDscConfigurationInner.type = reader.getString();
                } else if ("location".equals(fieldName)) {
                    deserializedDscConfigurationInner.withLocation(reader.getString());
                } else if ("tags".equals(fieldName)) {
                    Map tags = reader.readMap(reader1 -> reader1.getString());
                    deserializedDscConfigurationInner.withTags(tags);
                } else if ("properties".equals(fieldName)) {
                    deserializedDscConfigurationInner.innerProperties = DscConfigurationProperties.fromJson(reader);
                } else if ("etag".equals(fieldName)) {
                    deserializedDscConfigurationInner.etag = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedDscConfigurationInner;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy