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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.avs.models.AvailabilityProperties;
import com.azure.resourcemanager.avs.models.Circuit;
import com.azure.resourcemanager.avs.models.Encryption;
import com.azure.resourcemanager.avs.models.Endpoints;
import com.azure.resourcemanager.avs.models.IdentitySource;
import com.azure.resourcemanager.avs.models.InternetEnum;
import com.azure.resourcemanager.avs.models.ManagementCluster;
import com.azure.resourcemanager.avs.models.NsxPublicIpQuotaRaisedEnum;
import com.azure.resourcemanager.avs.models.PrivateCloudIdentity;
import com.azure.resourcemanager.avs.models.PrivateCloudProvisioningState;
import com.azure.resourcemanager.avs.models.Sku;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** A private cloud resource. */
@Fluent
public final class PrivateCloudInner extends Resource {
    /*
     * The private cloud SKU
     */
    @JsonProperty(value = "sku", required = true)
    private Sku sku;

    /*
     * The properties of a private cloud resource
     */
    @JsonProperty(value = "properties")
    private PrivateCloudProperties innerProperties;

    /*
     * The identity of the private cloud, if configured.
     */
    @JsonProperty(value = "identity")
    private PrivateCloudIdentity identity;

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

    /**
     * Get the sku property: The private cloud SKU.
     *
     * @return the sku value.
     */
    public Sku sku() {
        return this.sku;
    }

    /**
     * Set the sku property: The private cloud SKU.
     *
     * @param sku the sku value to set.
     * @return the PrivateCloudInner object itself.
     */
    public PrivateCloudInner withSku(Sku sku) {
        this.sku = sku;
        return this;
    }

    /**
     * Get the innerProperties property: The properties of a private cloud resource.
     *
     * @return the innerProperties value.
     */
    private PrivateCloudProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the identity property: The identity of the private cloud, if configured.
     *
     * @return the identity value.
     */
    public PrivateCloudIdentity identity() {
        return this.identity;
    }

    /**
     * Set the identity property: The identity of the private cloud, if configured.
     *
     * @param identity the identity value to set.
     * @return the PrivateCloudInner object itself.
     */
    public PrivateCloudInner withIdentity(PrivateCloudIdentity identity) {
        this.identity = identity;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public PrivateCloudInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public PrivateCloudInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Get the provisioningState property: The provisioning state.
     *
     * @return the provisioningState value.
     */
    public PrivateCloudProvisioningState provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the circuit property: An ExpressRoute Circuit.
     *
     * @return the circuit value.
     */
    public Circuit circuit() {
        return this.innerProperties() == null ? null : this.innerProperties().circuit();
    }

    /**
     * Set the circuit property: An ExpressRoute Circuit.
     *
     * @param circuit the circuit value to set.
     * @return the PrivateCloudInner object itself.
     */
    public PrivateCloudInner withCircuit(Circuit circuit) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PrivateCloudProperties();
        }
        this.innerProperties().withCircuit(circuit);
        return this;
    }

    /**
     * Get the endpoints property: The endpoints.
     *
     * @return the endpoints value.
     */
    public Endpoints endpoints() {
        return this.innerProperties() == null ? null : this.innerProperties().endpoints();
    }

    /**
     * Get the networkBlock property: The block of addresses should be unique across VNet in your subscription as well
     * as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X
     * is between 0 and 22.
     *
     * @return the networkBlock value.
     */
    public String networkBlock() {
        return this.innerProperties() == null ? null : this.innerProperties().networkBlock();
    }

    /**
     * Set the networkBlock property: The block of addresses should be unique across VNet in your subscription as well
     * as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X
     * is between 0 and 22.
     *
     * @param networkBlock the networkBlock value to set.
     * @return the PrivateCloudInner object itself.
     */
    public PrivateCloudInner withNetworkBlock(String networkBlock) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PrivateCloudProperties();
        }
        this.innerProperties().withNetworkBlock(networkBlock);
        return this;
    }

    /**
     * Get the managementNetwork property: Network used to access vCenter Server and NSX-T Manager.
     *
     * @return the managementNetwork value.
     */
    public String managementNetwork() {
        return this.innerProperties() == null ? null : this.innerProperties().managementNetwork();
    }

    /**
     * Get the provisioningNetwork property: Used for virtual machine cold migration, cloning, and snapshot migration.
     *
     * @return the provisioningNetwork value.
     */
    public String provisioningNetwork() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningNetwork();
    }

    /**
     * Get the vmotionNetwork property: Used for live migration of virtual machines.
     *
     * @return the vmotionNetwork value.
     */
    public String vmotionNetwork() {
        return this.innerProperties() == null ? null : this.innerProperties().vmotionNetwork();
    }

    /**
     * Get the vcenterPassword property: Optionally, set the vCenter admin password when the private cloud is created.
     *
     * @return the vcenterPassword value.
     */
    public String vcenterPassword() {
        return this.innerProperties() == null ? null : this.innerProperties().vcenterPassword();
    }

    /**
     * Set the vcenterPassword property: Optionally, set the vCenter admin password when the private cloud is created.
     *
     * @param vcenterPassword the vcenterPassword value to set.
     * @return the PrivateCloudInner object itself.
     */
    public PrivateCloudInner withVcenterPassword(String vcenterPassword) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PrivateCloudProperties();
        }
        this.innerProperties().withVcenterPassword(vcenterPassword);
        return this;
    }

    /**
     * Get the nsxtPassword property: Optionally, set the NSX-T Manager password when the private cloud is created.
     *
     * @return the nsxtPassword value.
     */
    public String nsxtPassword() {
        return this.innerProperties() == null ? null : this.innerProperties().nsxtPassword();
    }

    /**
     * Set the nsxtPassword property: Optionally, set the NSX-T Manager password when the private cloud is created.
     *
     * @param nsxtPassword the nsxtPassword value to set.
     * @return the PrivateCloudInner object itself.
     */
    public PrivateCloudInner withNsxtPassword(String nsxtPassword) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PrivateCloudProperties();
        }
        this.innerProperties().withNsxtPassword(nsxtPassword);
        return this;
    }

    /**
     * Get the vcenterCertificateThumbprint property: Thumbprint of the vCenter Server SSL certificate.
     *
     * @return the vcenterCertificateThumbprint value.
     */
    public String vcenterCertificateThumbprint() {
        return this.innerProperties() == null ? null : this.innerProperties().vcenterCertificateThumbprint();
    }

    /**
     * Get the nsxtCertificateThumbprint property: Thumbprint of the NSX-T Manager SSL certificate.
     *
     * @return the nsxtCertificateThumbprint value.
     */
    public String nsxtCertificateThumbprint() {
        return this.innerProperties() == null ? null : this.innerProperties().nsxtCertificateThumbprint();
    }

    /**
     * Get the externalCloudLinks property: Array of cloud link IDs from other clouds that connect to this one.
     *
     * @return the externalCloudLinks value.
     */
    public List<String> externalCloudLinks() {
        return this.innerProperties() == null ? null : this.innerProperties().externalCloudLinks();
    }

    /**
     * Get the secondaryCircuit property: A secondary expressRoute circuit from a separate AZ. Only present in a
     * stretched private cloud.
     *
     * @return the secondaryCircuit value.
     */
    public Circuit secondaryCircuit() {
        return this.innerProperties() == null ? null : this.innerProperties().secondaryCircuit();
    }

    /**
     * Set the secondaryCircuit property: A secondary expressRoute circuit from a separate AZ. Only present in a
     * stretched private cloud.
     *
     * @param secondaryCircuit the secondaryCircuit value to set.
     * @return the PrivateCloudInner object itself.
     */
    public PrivateCloudInner withSecondaryCircuit(Circuit secondaryCircuit) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PrivateCloudProperties();
        }
        this.innerProperties().withSecondaryCircuit(secondaryCircuit);
        return this;
    }

    /**
     * Get the nsxPublicIpQuotaRaised property: Flag to indicate whether the private cloud has the quota for provisioned
     * NSX Public IP count raised from 64 to 1024.
     *
     * @return the nsxPublicIpQuotaRaised value.
     */
    public NsxPublicIpQuotaRaisedEnum nsxPublicIpQuotaRaised() {
        return this.innerProperties() == null ? null : this.innerProperties().nsxPublicIpQuotaRaised();
    }

    /**
     * Get the managementCluster property: The default cluster used for management.
     *
     * @return the managementCluster value.
     */
    public ManagementCluster managementCluster() {
        return this.innerProperties() == null ? null : this.innerProperties().managementCluster();
    }

    /**
     * Set the managementCluster property: The default cluster used for management.
     *
     * @param managementCluster the managementCluster value to set.
     * @return the PrivateCloudInner object itself.
     */
    public PrivateCloudInner withManagementCluster(ManagementCluster managementCluster) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PrivateCloudProperties();
        }
        this.innerProperties().withManagementCluster(managementCluster);
        return this;
    }

    /**
     * Get the internet property: Connectivity to internet is enabled or disabled.
     *
     * @return the internet value.
     */
    public InternetEnum internet() {
        return this.innerProperties() == null ? null : this.innerProperties().internet();
    }

    /**
     * Set the internet property: Connectivity to internet is enabled or disabled.
     *
     * @param internet the internet value to set.
     * @return the PrivateCloudInner object itself.
     */
    public PrivateCloudInner withInternet(InternetEnum internet) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PrivateCloudProperties();
        }
        this.innerProperties().withInternet(internet);
        return this;
    }

    /**
     * Get the identitySources property: vCenter Single Sign On Identity Sources.
     *
     * @return the identitySources value.
     */
    public List<IdentitySource> identitySources() {
        return this.innerProperties() == null ? null : this.innerProperties().identitySources();
    }

    /**
     * Set the identitySources property: vCenter Single Sign On Identity Sources.
     *
     * @param identitySources the identitySources value to set.
     * @return the PrivateCloudInner object itself.
     */
    public PrivateCloudInner withIdentitySources(List<IdentitySource> identitySources) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PrivateCloudProperties();
        }
        this.innerProperties().withIdentitySources(identitySources);
        return this;
    }

    /**
     * Get the availability property: Properties describing how the cloud is distributed across availability zones.
     *
     * @return the availability value.
     */
    public AvailabilityProperties availability() {
        return this.innerProperties() == null ? null : this.innerProperties().availability();
    }

    /**
     * Set the availability property: Properties describing how the cloud is distributed across availability zones.
     *
     * @param availability the availability value to set.
     * @return the PrivateCloudInner object itself.
     */
    public PrivateCloudInner withAvailability(AvailabilityProperties availability) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PrivateCloudProperties();
        }
        this.innerProperties().withAvailability(availability);
        return this;
    }

    /**
     * Get the encryption property: Customer managed key encryption, can be enabled or disabled.
     *
     * @return the encryption value.
     */
    public Encryption encryption() {
        return this.innerProperties() == null ? null : this.innerProperties().encryption();
    }

    /**
     * Set the encryption property: Customer managed key encryption, can be enabled or disabled.
     *
     * @param encryption the encryption value to set.
     * @return the PrivateCloudInner object itself.
     */
    public PrivateCloudInner withEncryption(Encryption encryption) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PrivateCloudProperties();
        }
        this.innerProperties().withEncryption(encryption);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (sku() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property sku in model PrivateCloudInner"));
        } else {
            sku().validate();
        }
        if (innerProperties() != null) {
            innerProperties().validate();
        }
        if (identity() != null) {
            identity().validate();
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(PrivateCloudInner.class);
}
