// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.devtestlabs.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.devtestlabs.models.FormulaPropertiesFromVm;
import com.azure.resourcemanager.devtestlabs.models.LabVirtualMachineCreationParameter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Properties of a formula. */
@Fluent
public final class FormulaProperties {
    /*
     * The description of the formula.
     */
    @JsonProperty(value = "description")
    private String description;

    /*
     * The author of the formula.
     */
    @JsonProperty(value = "author", access = JsonProperty.Access.WRITE_ONLY)
    private String author;

    /*
     * The OS type of the formula.
     */
    @JsonProperty(value = "osType")
    private String osType;

    /*
     * The creation date of the formula.
     */
    @JsonProperty(value = "creationDate", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime creationDate;

    /*
     * The content of the formula.
     */
    @JsonProperty(value = "formulaContent")
    private LabVirtualMachineCreationParameter formulaContent;

    /*
     * Information about a VM from which a formula is to be created.
     */
    @JsonProperty(value = "vm")
    private FormulaPropertiesFromVm vm;

    /*
     * The provisioning status of the resource.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private String provisioningState;

    /*
     * The unique immutable identifier of a resource (Guid).
     */
    @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY)
    private String uniqueIdentifier;

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

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

    /**
     * Set the description property: The description of the formula.
     *
     * @param description the description value to set.
     * @return the FormulaProperties object itself.
     */
    public FormulaProperties withDescription(String description) {
        this.description = description;
        return this;
    }

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

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

    /**
     * Set the osType property: The OS type of the formula.
     *
     * @param osType the osType value to set.
     * @return the FormulaProperties object itself.
     */
    public FormulaProperties withOsType(String osType) {
        this.osType = osType;
        return this;
    }

    /**
     * Get the creationDate property: The creation date of the formula.
     *
     * @return the creationDate value.
     */
    public OffsetDateTime creationDate() {
        return this.creationDate;
    }

    /**
     * Get the formulaContent property: The content of the formula.
     *
     * @return the formulaContent value.
     */
    public LabVirtualMachineCreationParameter formulaContent() {
        return this.formulaContent;
    }

    /**
     * Set the formulaContent property: The content of the formula.
     *
     * @param formulaContent the formulaContent value to set.
     * @return the FormulaProperties object itself.
     */
    public FormulaProperties withFormulaContent(LabVirtualMachineCreationParameter formulaContent) {
        this.formulaContent = formulaContent;
        return this;
    }

    /**
     * Get the vm property: Information about a VM from which a formula is to be created.
     *
     * @return the vm value.
     */
    public FormulaPropertiesFromVm vm() {
        return this.vm;
    }

    /**
     * Set the vm property: Information about a VM from which a formula is to be created.
     *
     * @param vm the vm value to set.
     * @return the FormulaProperties object itself.
     */
    public FormulaProperties withVm(FormulaPropertiesFromVm vm) {
        this.vm = vm;
        return this;
    }

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

    /**
     * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).
     *
     * @return the uniqueIdentifier value.
     */
    public String uniqueIdentifier() {
        return this.uniqueIdentifier;
    }

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