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

package com.azure.resourcemanager.workloads.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/** Deployment along with OS Configuration. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "configurationType")
@JsonTypeName("DeploymentWithOSConfig")
@Fluent
public final class DeploymentWithOSConfiguration extends SapConfiguration {
    /*
     * The geo-location where the SAP system is to be created.
     */
    @JsonProperty(value = "appLocation")
    private String appLocation;

    /*
     * The infrastructure configuration.
     */
    @JsonProperty(value = "infrastructureConfiguration")
    private InfrastructureConfiguration infrastructureConfiguration;

    /*
     * The software configuration.
     */
    @JsonProperty(value = "softwareConfiguration")
    private SoftwareConfiguration softwareConfiguration;

    /*
     * The OS and SAP configuration.
     */
    @JsonProperty(value = "osSapConfiguration")
    private OsSapConfiguration osSapConfiguration;

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

    /**
     * Get the appLocation property: The geo-location where the SAP system is to be created.
     *
     * @return the appLocation value.
     */
    public String appLocation() {
        return this.appLocation;
    }

    /**
     * Set the appLocation property: The geo-location where the SAP system is to be created.
     *
     * @param appLocation the appLocation value to set.
     * @return the DeploymentWithOSConfiguration object itself.
     */
    public DeploymentWithOSConfiguration withAppLocation(String appLocation) {
        this.appLocation = appLocation;
        return this;
    }

    /**
     * Get the infrastructureConfiguration property: The infrastructure configuration.
     *
     * @return the infrastructureConfiguration value.
     */
    public InfrastructureConfiguration infrastructureConfiguration() {
        return this.infrastructureConfiguration;
    }

    /**
     * Set the infrastructureConfiguration property: The infrastructure configuration.
     *
     * @param infrastructureConfiguration the infrastructureConfiguration value to set.
     * @return the DeploymentWithOSConfiguration object itself.
     */
    public DeploymentWithOSConfiguration withInfrastructureConfiguration(
        InfrastructureConfiguration infrastructureConfiguration) {
        this.infrastructureConfiguration = infrastructureConfiguration;
        return this;
    }

    /**
     * Get the softwareConfiguration property: The software configuration.
     *
     * @return the softwareConfiguration value.
     */
    public SoftwareConfiguration softwareConfiguration() {
        return this.softwareConfiguration;
    }

    /**
     * Set the softwareConfiguration property: The software configuration.
     *
     * @param softwareConfiguration the softwareConfiguration value to set.
     * @return the DeploymentWithOSConfiguration object itself.
     */
    public DeploymentWithOSConfiguration withSoftwareConfiguration(SoftwareConfiguration softwareConfiguration) {
        this.softwareConfiguration = softwareConfiguration;
        return this;
    }

    /**
     * Get the osSapConfiguration property: The OS and SAP configuration.
     *
     * @return the osSapConfiguration value.
     */
    public OsSapConfiguration osSapConfiguration() {
        return this.osSapConfiguration;
    }

    /**
     * Set the osSapConfiguration property: The OS and SAP configuration.
     *
     * @param osSapConfiguration the osSapConfiguration value to set.
     * @return the DeploymentWithOSConfiguration object itself.
     */
    public DeploymentWithOSConfiguration withOsSapConfiguration(OsSapConfiguration osSapConfiguration) {
        this.osSapConfiguration = osSapConfiguration;
        return this;
    }

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