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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.resourceconnector.models.AppliancePropertiesInfrastructureConfig;
import com.azure.resourcemanager.resourceconnector.models.Distro;
import com.azure.resourcemanager.resourceconnector.models.Status;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Properties for an appliance. */
@Fluent
public final class ApplianceProperties {
    /*
     * Represents a supported Fabric/Infra. (AKSEdge etc...).
     */
    @JsonProperty(value = "distro")
    private Distro distro;

    /*
     * Contains infrastructure information about the Appliance
     */
    @JsonProperty(value = "infrastructureConfig")
    private AppliancePropertiesInfrastructureConfig infrastructureConfig;

    /*
     * The current deployment or provisioning state, which only appears in the response.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private String provisioningState;

    /*
     * Certificates pair used to download MSI certificate from HIS. Can only be set once.
     */
    @JsonProperty(value = "publicKey")
    private String publicKey;

    /*
     * Appliance’s health and state of connection to on-prem
     */
    @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
    private Status status;

    /*
     * Version of the Appliance
     */
    @JsonProperty(value = "version")
    private String version;

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

    /**
     * Get the distro property: Represents a supported Fabric/Infra. (AKSEdge etc...).
     *
     * @return the distro value.
     */
    public Distro distro() {
        return this.distro;
    }

    /**
     * Set the distro property: Represents a supported Fabric/Infra. (AKSEdge etc...).
     *
     * @param distro the distro value to set.
     * @return the ApplianceProperties object itself.
     */
    public ApplianceProperties withDistro(Distro distro) {
        this.distro = distro;
        return this;
    }

    /**
     * Get the infrastructureConfig property: Contains infrastructure information about the Appliance.
     *
     * @return the infrastructureConfig value.
     */
    public AppliancePropertiesInfrastructureConfig infrastructureConfig() {
        return this.infrastructureConfig;
    }

    /**
     * Set the infrastructureConfig property: Contains infrastructure information about the Appliance.
     *
     * @param infrastructureConfig the infrastructureConfig value to set.
     * @return the ApplianceProperties object itself.
     */
    public ApplianceProperties withInfrastructureConfig(AppliancePropertiesInfrastructureConfig infrastructureConfig) {
        this.infrastructureConfig = infrastructureConfig;
        return this;
    }

    /**
     * Get the provisioningState property: The current deployment or provisioning state, which only appears in the
     * response.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the publicKey property: Certificates pair used to download MSI certificate from HIS. Can only be set once.
     *
     * @return the publicKey value.
     */
    public String publicKey() {
        return this.publicKey;
    }

    /**
     * Set the publicKey property: Certificates pair used to download MSI certificate from HIS. Can only be set once.
     *
     * @param publicKey the publicKey value to set.
     * @return the ApplianceProperties object itself.
     */
    public ApplianceProperties withPublicKey(String publicKey) {
        this.publicKey = publicKey;
        return this;
    }

    /**
     * Get the status property: Appliance’s health and state of connection to on-prem.
     *
     * @return the status value.
     */
    public Status status() {
        return this.status;
    }

    /**
     * Get the version property: Version of the Appliance.
     *
     * @return the version value.
     */
    public String version() {
        return this.version;
    }

    /**
     * Set the version property: Version of the Appliance.
     *
     * @param version the version value to set.
     * @return the ApplianceProperties object itself.
     */
    public ApplianceProperties withVersion(String version) {
        this.version = version;
        return this;
    }

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