// 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.ProxyResource;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Definition of the variable. */
@Fluent
public final class VariableInner extends ProxyResource {
    /*
     * Gets or sets the properties of the variable.
     */
    @JsonProperty(value = "properties")
    private VariableProperties innerProperties;

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

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

    /**
     * Set the value property: Gets or sets the value of the variable.
     *
     * @param value the value value to set.
     * @return the VariableInner object itself.
     */
    public VariableInner withValue(String value) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VariableProperties();
        }
        this.innerProperties().withValue(value);
        return this;
    }

    /**
     * Get the isEncrypted property: Gets or sets the encrypted flag of the variable.
     *
     * @return the isEncrypted value.
     */
    public Boolean isEncrypted() {
        return this.innerProperties() == null ? null : this.innerProperties().isEncrypted();
    }

    /**
     * Set the isEncrypted property: Gets or sets the encrypted flag of the variable.
     *
     * @param isEncrypted the isEncrypted value to set.
     * @return the VariableInner object itself.
     */
    public VariableInner withIsEncrypted(Boolean isEncrypted) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VariableProperties();
        }
        this.innerProperties().withIsEncrypted(isEncrypted);
        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 VariableInner object itself.
     */
    public VariableInner withCreationTime(OffsetDateTime creationTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VariableProperties();
        }
        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 VariableInner object itself.
     */
    public VariableInner withLastModifiedTime(OffsetDateTime lastModifiedTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VariableProperties();
        }
        this.innerProperties().withLastModifiedTime(lastModifiedTime);
        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 VariableInner object itself.
     */
    public VariableInner withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VariableProperties();
        }
        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();
        }
    }
}
