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

package com.azure.resourcemanager.cognitiveservices.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionInner;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** Properties of Cognitive Services account. */
@Fluent
public final class AccountProperties {
    /*
     * Gets the status of the cognitive services account at the time the operation was called.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

    /*
     * Endpoint of the created account.
     */
    @JsonProperty(value = "endpoint", access = JsonProperty.Access.WRITE_ONLY)
    private String endpoint;

    /*
     * The internal identifier (deprecated, do not use this property).
     */
    @JsonProperty(value = "internalId", access = JsonProperty.Access.WRITE_ONLY)
    private String internalId;

    /*
     * Gets the capabilities of the cognitive services account. Each item indicates the capability of a specific
     * feature. The values are read-only and for reference only.
     */
    @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY)
    private List<SkuCapability> capabilities;

    /*
     * If the resource is migrated from an existing key.
     */
    @JsonProperty(value = "isMigrated", access = JsonProperty.Access.WRITE_ONLY)
    private Boolean isMigrated;

    /*
     * Resource migration token.
     */
    @JsonProperty(value = "migrationToken")
    private String migrationToken;

    /*
     * Sku change info of account.
     */
    @JsonProperty(value = "skuChangeInfo", access = JsonProperty.Access.WRITE_ONLY)
    private SkuChangeInfo skuChangeInfo;

    /*
     * Optional subdomain name used for token-based authentication.
     */
    @JsonProperty(value = "customSubDomainName")
    private String customSubDomainName;

    /*
     * A collection of rules governing the accessibility from specific network locations.
     */
    @JsonProperty(value = "networkAcls")
    private NetworkRuleSet networkAcls;

    /*
     * The encryption properties for this resource.
     */
    @JsonProperty(value = "encryption")
    private Encryption encryption;

    /*
     * The storage accounts for this resource.
     */
    @JsonProperty(value = "userOwnedStorage")
    private List<UserOwnedStorage> userOwnedStorage;

    /*
     * The private endpoint connection associated with the Cognitive Services account.
     */
    @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY)
    private List<PrivateEndpointConnectionInner> privateEndpointConnections;

    /*
     * Whether or not public endpoint access is allowed for this account.
     */
    @JsonProperty(value = "publicNetworkAccess")
    private PublicNetworkAccess publicNetworkAccess;

    /*
     * The api properties for special APIs.
     */
    @JsonProperty(value = "apiProperties")
    private ApiProperties apiProperties;

    /*
     * Gets the date of cognitive services account creation.
     */
    @JsonProperty(value = "dateCreated", access = JsonProperty.Access.WRITE_ONLY)
    private String dateCreated;

    /*
     * The call rate limit Cognitive Services account.
     */
    @JsonProperty(value = "callRateLimit", access = JsonProperty.Access.WRITE_ONLY)
    private CallRateLimit callRateLimit;

    /*
     * The flag to enable dynamic throttling.
     */
    @JsonProperty(value = "dynamicThrottlingEnabled")
    private Boolean dynamicThrottlingEnabled;

    /*
     * The quotaLimit property.
     */
    @JsonProperty(value = "quotaLimit", access = JsonProperty.Access.WRITE_ONLY)
    private QuotaLimit quotaLimit;

    /*
     * The restrictOutboundNetworkAccess property.
     */
    @JsonProperty(value = "restrictOutboundNetworkAccess")
    private Boolean restrictOutboundNetworkAccess;

    /*
     * The allowedFqdnList property.
     */
    @JsonProperty(value = "allowedFqdnList")
    private List<String> allowedFqdnList;

    /*
     * The disableLocalAuth property.
     */
    @JsonProperty(value = "disableLocalAuth")
    private Boolean disableLocalAuth;

    /*
     * Dictionary of <string>
     */
    @JsonProperty(value = "endpoints", access = JsonProperty.Access.WRITE_ONLY)
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> endpoints;

    /*
     * The restore property.
     */
    @JsonProperty(value = "restore")
    private Boolean restore;

    /*
     * The deletion date, only available for deleted account.
     */
    @JsonProperty(value = "deletionDate", access = JsonProperty.Access.WRITE_ONLY)
    private String deletionDate;

    /*
     * The scheduled purge date, only available for deleted account.
     */
    @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY)
    private String scheduledPurgeDate;

    /*
     * The multiregion settings of Cognitive Services account.
     */
    @JsonProperty(value = "locations")
    private MultiRegionSettings locations;

    /*
     * The commitment plan associations of Cognitive Services account.
     */
    @JsonProperty(value = "commitmentPlanAssociations", access = JsonProperty.Access.WRITE_ONLY)
    private List<CommitmentPlanAssociation> commitmentPlanAssociations;

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

    /**
     * Get the provisioningState property: Gets the status of the cognitive services account at the time the operation
     * was called.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the endpoint property: Endpoint of the created account.
     *
     * @return the endpoint value.
     */
    public String endpoint() {
        return this.endpoint;
    }

    /**
     * Get the internalId property: The internal identifier (deprecated, do not use this property).
     *
     * @return the internalId value.
     */
    public String internalId() {
        return this.internalId;
    }

    /**
     * Get the capabilities property: Gets the capabilities of the cognitive services account. Each item indicates the
     * capability of a specific feature. The values are read-only and for reference only.
     *
     * @return the capabilities value.
     */
    public List<SkuCapability> capabilities() {
        return this.capabilities;
    }

    /**
     * Get the isMigrated property: If the resource is migrated from an existing key.
     *
     * @return the isMigrated value.
     */
    public Boolean isMigrated() {
        return this.isMigrated;
    }

    /**
     * Get the migrationToken property: Resource migration token.
     *
     * @return the migrationToken value.
     */
    public String migrationToken() {
        return this.migrationToken;
    }

    /**
     * Set the migrationToken property: Resource migration token.
     *
     * @param migrationToken the migrationToken value to set.
     * @return the AccountProperties object itself.
     */
    public AccountProperties withMigrationToken(String migrationToken) {
        this.migrationToken = migrationToken;
        return this;
    }

    /**
     * Get the skuChangeInfo property: Sku change info of account.
     *
     * @return the skuChangeInfo value.
     */
    public SkuChangeInfo skuChangeInfo() {
        return this.skuChangeInfo;
    }

    /**
     * Get the customSubDomainName property: Optional subdomain name used for token-based authentication.
     *
     * @return the customSubDomainName value.
     */
    public String customSubDomainName() {
        return this.customSubDomainName;
    }

    /**
     * Set the customSubDomainName property: Optional subdomain name used for token-based authentication.
     *
     * @param customSubDomainName the customSubDomainName value to set.
     * @return the AccountProperties object itself.
     */
    public AccountProperties withCustomSubDomainName(String customSubDomainName) {
        this.customSubDomainName = customSubDomainName;
        return this;
    }

    /**
     * Get the networkAcls property: A collection of rules governing the accessibility from specific network locations.
     *
     * @return the networkAcls value.
     */
    public NetworkRuleSet networkAcls() {
        return this.networkAcls;
    }

    /**
     * Set the networkAcls property: A collection of rules governing the accessibility from specific network locations.
     *
     * @param networkAcls the networkAcls value to set.
     * @return the AccountProperties object itself.
     */
    public AccountProperties withNetworkAcls(NetworkRuleSet networkAcls) {
        this.networkAcls = networkAcls;
        return this;
    }

    /**
     * Get the encryption property: The encryption properties for this resource.
     *
     * @return the encryption value.
     */
    public Encryption encryption() {
        return this.encryption;
    }

    /**
     * Set the encryption property: The encryption properties for this resource.
     *
     * @param encryption the encryption value to set.
     * @return the AccountProperties object itself.
     */
    public AccountProperties withEncryption(Encryption encryption) {
        this.encryption = encryption;
        return this;
    }

    /**
     * Get the userOwnedStorage property: The storage accounts for this resource.
     *
     * @return the userOwnedStorage value.
     */
    public List<UserOwnedStorage> userOwnedStorage() {
        return this.userOwnedStorage;
    }

    /**
     * Set the userOwnedStorage property: The storage accounts for this resource.
     *
     * @param userOwnedStorage the userOwnedStorage value to set.
     * @return the AccountProperties object itself.
     */
    public AccountProperties withUserOwnedStorage(List<UserOwnedStorage> userOwnedStorage) {
        this.userOwnedStorage = userOwnedStorage;
        return this;
    }

    /**
     * Get the privateEndpointConnections property: The private endpoint connection associated with the Cognitive
     * Services account.
     *
     * @return the privateEndpointConnections value.
     */
    public List<PrivateEndpointConnectionInner> privateEndpointConnections() {
        return this.privateEndpointConnections;
    }

    /**
     * Get the publicNetworkAccess property: Whether or not public endpoint access is allowed for this account.
     *
     * @return the publicNetworkAccess value.
     */
    public PublicNetworkAccess publicNetworkAccess() {
        return this.publicNetworkAccess;
    }

    /**
     * Set the publicNetworkAccess property: Whether or not public endpoint access is allowed for this account.
     *
     * @param publicNetworkAccess the publicNetworkAccess value to set.
     * @return the AccountProperties object itself.
     */
    public AccountProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) {
        this.publicNetworkAccess = publicNetworkAccess;
        return this;
    }

    /**
     * Get the apiProperties property: The api properties for special APIs.
     *
     * @return the apiProperties value.
     */
    public ApiProperties apiProperties() {
        return this.apiProperties;
    }

    /**
     * Set the apiProperties property: The api properties for special APIs.
     *
     * @param apiProperties the apiProperties value to set.
     * @return the AccountProperties object itself.
     */
    public AccountProperties withApiProperties(ApiProperties apiProperties) {
        this.apiProperties = apiProperties;
        return this;
    }

    /**
     * Get the dateCreated property: Gets the date of cognitive services account creation.
     *
     * @return the dateCreated value.
     */
    public String dateCreated() {
        return this.dateCreated;
    }

    /**
     * Get the callRateLimit property: The call rate limit Cognitive Services account.
     *
     * @return the callRateLimit value.
     */
    public CallRateLimit callRateLimit() {
        return this.callRateLimit;
    }

    /**
     * Get the dynamicThrottlingEnabled property: The flag to enable dynamic throttling.
     *
     * @return the dynamicThrottlingEnabled value.
     */
    public Boolean dynamicThrottlingEnabled() {
        return this.dynamicThrottlingEnabled;
    }

    /**
     * Set the dynamicThrottlingEnabled property: The flag to enable dynamic throttling.
     *
     * @param dynamicThrottlingEnabled the dynamicThrottlingEnabled value to set.
     * @return the AccountProperties object itself.
     */
    public AccountProperties withDynamicThrottlingEnabled(Boolean dynamicThrottlingEnabled) {
        this.dynamicThrottlingEnabled = dynamicThrottlingEnabled;
        return this;
    }

    /**
     * Get the quotaLimit property: The quotaLimit property.
     *
     * @return the quotaLimit value.
     */
    public QuotaLimit quotaLimit() {
        return this.quotaLimit;
    }

    /**
     * Get the restrictOutboundNetworkAccess property: The restrictOutboundNetworkAccess property.
     *
     * @return the restrictOutboundNetworkAccess value.
     */
    public Boolean restrictOutboundNetworkAccess() {
        return this.restrictOutboundNetworkAccess;
    }

    /**
     * Set the restrictOutboundNetworkAccess property: The restrictOutboundNetworkAccess property.
     *
     * @param restrictOutboundNetworkAccess the restrictOutboundNetworkAccess value to set.
     * @return the AccountProperties object itself.
     */
    public AccountProperties withRestrictOutboundNetworkAccess(Boolean restrictOutboundNetworkAccess) {
        this.restrictOutboundNetworkAccess = restrictOutboundNetworkAccess;
        return this;
    }

    /**
     * Get the allowedFqdnList property: The allowedFqdnList property.
     *
     * @return the allowedFqdnList value.
     */
    public List<String> allowedFqdnList() {
        return this.allowedFqdnList;
    }

    /**
     * Set the allowedFqdnList property: The allowedFqdnList property.
     *
     * @param allowedFqdnList the allowedFqdnList value to set.
     * @return the AccountProperties object itself.
     */
    public AccountProperties withAllowedFqdnList(List<String> allowedFqdnList) {
        this.allowedFqdnList = allowedFqdnList;
        return this;
    }

    /**
     * Get the disableLocalAuth property: The disableLocalAuth property.
     *
     * @return the disableLocalAuth value.
     */
    public Boolean disableLocalAuth() {
        return this.disableLocalAuth;
    }

    /**
     * Set the disableLocalAuth property: The disableLocalAuth property.
     *
     * @param disableLocalAuth the disableLocalAuth value to set.
     * @return the AccountProperties object itself.
     */
    public AccountProperties withDisableLocalAuth(Boolean disableLocalAuth) {
        this.disableLocalAuth = disableLocalAuth;
        return this;
    }

    /**
     * Get the endpoints property: Dictionary of &lt;string&gt;.
     *
     * @return the endpoints value.
     */
    public Map<String, String> endpoints() {
        return this.endpoints;
    }

    /**
     * Get the restore property: The restore property.
     *
     * @return the restore value.
     */
    public Boolean restore() {
        return this.restore;
    }

    /**
     * Set the restore property: The restore property.
     *
     * @param restore the restore value to set.
     * @return the AccountProperties object itself.
     */
    public AccountProperties withRestore(Boolean restore) {
        this.restore = restore;
        return this;
    }

    /**
     * Get the deletionDate property: The deletion date, only available for deleted account.
     *
     * @return the deletionDate value.
     */
    public String deletionDate() {
        return this.deletionDate;
    }

    /**
     * Get the scheduledPurgeDate property: The scheduled purge date, only available for deleted account.
     *
     * @return the scheduledPurgeDate value.
     */
    public String scheduledPurgeDate() {
        return this.scheduledPurgeDate;
    }

    /**
     * Get the locations property: The multiregion settings of Cognitive Services account.
     *
     * @return the locations value.
     */
    public MultiRegionSettings locations() {
        return this.locations;
    }

    /**
     * Set the locations property: The multiregion settings of Cognitive Services account.
     *
     * @param locations the locations value to set.
     * @return the AccountProperties object itself.
     */
    public AccountProperties withLocations(MultiRegionSettings locations) {
        this.locations = locations;
        return this;
    }

    /**
     * Get the commitmentPlanAssociations property: The commitment plan associations of Cognitive Services account.
     *
     * @return the commitmentPlanAssociations value.
     */
    public List<CommitmentPlanAssociation> commitmentPlanAssociations() {
        return this.commitmentPlanAssociations;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (capabilities() != null) {
            capabilities().forEach(e -> e.validate());
        }
        if (skuChangeInfo() != null) {
            skuChangeInfo().validate();
        }
        if (networkAcls() != null) {
            networkAcls().validate();
        }
        if (encryption() != null) {
            encryption().validate();
        }
        if (userOwnedStorage() != null) {
            userOwnedStorage().forEach(e -> e.validate());
        }
        if (privateEndpointConnections() != null) {
            privateEndpointConnections().forEach(e -> e.validate());
        }
        if (apiProperties() != null) {
            apiProperties().validate();
        }
        if (callRateLimit() != null) {
            callRateLimit().validate();
        }
        if (quotaLimit() != null) {
            quotaLimit().validate();
        }
        if (locations() != null) {
            locations().validate();
        }
        if (commitmentPlanAssociations() != null) {
            commitmentPlanAssociations().forEach(e -> e.validate());
        }
    }
}
