// 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;

/**
 * The resource name object where the specified values will be full resource names of the corresponding resources in a
 * three tier SAP system.
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "namingPatternType")
@JsonTypeName("FullResourceName")
@Fluent
public final class ThreeTierFullResourceNames extends ThreeTierCustomResourceNames {
    /*
     * The full resource names object for central server layer resources.
     */
    @JsonProperty(value = "centralServer")
    private CentralServerFullResourceNames centralServer;

    /*
     * The full resource names object for application layer resources. The number of entries in this list should be
     * equal to the number VMs to be created for application layer.
     */
    @JsonProperty(value = "applicationServer")
    private ApplicationServerFullResourceNames applicationServer;

    /*
     * The full resource names object for database layer resources. The number of entries in this list should be equal
     * to the number VMs to be created for database layer.
     */
    @JsonProperty(value = "databaseServer")
    private DatabaseServerFullResourceNames databaseServer;

    /*
     * The resource names object for shared storage.
     */
    @JsonProperty(value = "sharedStorage")
    private SharedStorageResourceNames sharedStorage;

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

    /**
     * Get the centralServer property: The full resource names object for central server layer resources.
     *
     * @return the centralServer value.
     */
    public CentralServerFullResourceNames centralServer() {
        return this.centralServer;
    }

    /**
     * Set the centralServer property: The full resource names object for central server layer resources.
     *
     * @param centralServer the centralServer value to set.
     * @return the ThreeTierFullResourceNames object itself.
     */
    public ThreeTierFullResourceNames withCentralServer(CentralServerFullResourceNames centralServer) {
        this.centralServer = centralServer;
        return this;
    }

    /**
     * Get the applicationServer property: The full resource names object for application layer resources. The number of
     * entries in this list should be equal to the number VMs to be created for application layer.
     *
     * @return the applicationServer value.
     */
    public ApplicationServerFullResourceNames applicationServer() {
        return this.applicationServer;
    }

    /**
     * Set the applicationServer property: The full resource names object for application layer resources. The number of
     * entries in this list should be equal to the number VMs to be created for application layer.
     *
     * @param applicationServer the applicationServer value to set.
     * @return the ThreeTierFullResourceNames object itself.
     */
    public ThreeTierFullResourceNames withApplicationServer(ApplicationServerFullResourceNames applicationServer) {
        this.applicationServer = applicationServer;
        return this;
    }

    /**
     * Get the databaseServer property: The full resource names object for database layer resources. The number of
     * entries in this list should be equal to the number VMs to be created for database layer.
     *
     * @return the databaseServer value.
     */
    public DatabaseServerFullResourceNames databaseServer() {
        return this.databaseServer;
    }

    /**
     * Set the databaseServer property: The full resource names object for database layer resources. The number of
     * entries in this list should be equal to the number VMs to be created for database layer.
     *
     * @param databaseServer the databaseServer value to set.
     * @return the ThreeTierFullResourceNames object itself.
     */
    public ThreeTierFullResourceNames withDatabaseServer(DatabaseServerFullResourceNames databaseServer) {
        this.databaseServer = databaseServer;
        return this;
    }

    /**
     * Get the sharedStorage property: The resource names object for shared storage.
     *
     * @return the sharedStorage value.
     */
    public SharedStorageResourceNames sharedStorage() {
        return this.sharedStorage;
    }

    /**
     * Set the sharedStorage property: The resource names object for shared storage.
     *
     * @param sharedStorage the sharedStorage value to set.
     * @return the ThreeTierFullResourceNames object itself.
     */
    public ThreeTierFullResourceNames withSharedStorage(SharedStorageResourceNames sharedStorage) {
        this.sharedStorage = sharedStorage;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (centralServer() != null) {
            centralServer().validate();
        }
        if (applicationServer() != null) {
            applicationServer().validate();
        }
        if (databaseServer() != null) {
            databaseServer().validate();
        }
        if (sharedStorage() != null) {
            sharedStorage().validate();
        }
    }
}
