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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.purview.models.AccountPropertiesEndpoints;
import com.azure.resourcemanager.purview.models.AccountPropertiesManagedResources;
import com.azure.resourcemanager.purview.models.CloudConnectors;
import com.azure.resourcemanager.purview.models.ProvisioningState;
import com.azure.resourcemanager.purview.models.PublicNetworkAccess;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;

/** The account properties. */
@Fluent
public final class AccountProperties {
    /*
     * Cloud connectors.
     * External cloud identifier used as part of scanning configuration.
     */
    @JsonProperty(value = "cloudConnectors")
    private CloudConnectors cloudConnectors;

    /*
     * Gets the time at which the entity was created.
     */
    @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime createdAt;

    /*
     * Gets the creator of the entity.
     */
    @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY)
    private String createdBy;

    /*
     * Gets the creators of the entity's object id.
     */
    @JsonProperty(value = "createdByObjectId", access = JsonProperty.Access.WRITE_ONLY)
    private String createdByObjectId;

    /*
     * The URIs that are the public endpoints of the account.
     */
    @JsonProperty(value = "endpoints", access = JsonProperty.Access.WRITE_ONLY)
    private AccountPropertiesEndpoints endpoints;

    /*
     * Gets or sets the friendly name.
     */
    @JsonProperty(value = "friendlyName", access = JsonProperty.Access.WRITE_ONLY)
    private String friendlyName;

    /*
     * Gets or sets the managed resource group name
     */
    @JsonProperty(value = "managedResourceGroupName")
    private String managedResourceGroupName;

    /*
     * Gets the resource identifiers of the managed resources.
     */
    @JsonProperty(value = "managedResources", access = JsonProperty.Access.WRITE_ONLY)
    private AccountPropertiesManagedResources managedResources;

    /*
     * Gets the private endpoint connections information.
     */
    @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY)
    private List<PrivateEndpointConnectionInner> privateEndpointConnections;

    /*
     * Gets or sets the state of the provisioning.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

    /*
     * Gets or sets the public network access.
     */
    @JsonProperty(value = "publicNetworkAccess")
    private PublicNetworkAccess publicNetworkAccess;

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

    /**
     * Get the cloudConnectors property: Cloud connectors. External cloud identifier used as part of scanning
     * configuration.
     *
     * @return the cloudConnectors value.
     */
    public CloudConnectors cloudConnectors() {
        return this.cloudConnectors;
    }

    /**
     * Set the cloudConnectors property: Cloud connectors. External cloud identifier used as part of scanning
     * configuration.
     *
     * @param cloudConnectors the cloudConnectors value to set.
     * @return the AccountProperties object itself.
     */
    public AccountProperties withCloudConnectors(CloudConnectors cloudConnectors) {
        this.cloudConnectors = cloudConnectors;
        return this;
    }

    /**
     * Get the createdAt property: Gets the time at which the entity was created.
     *
     * @return the createdAt value.
     */
    public OffsetDateTime createdAt() {
        return this.createdAt;
    }

    /**
     * Get the createdBy property: Gets the creator of the entity.
     *
     * @return the createdBy value.
     */
    public String createdBy() {
        return this.createdBy;
    }

    /**
     * Get the createdByObjectId property: Gets the creators of the entity's object id.
     *
     * @return the createdByObjectId value.
     */
    public String createdByObjectId() {
        return this.createdByObjectId;
    }

    /**
     * Get the endpoints property: The URIs that are the public endpoints of the account.
     *
     * @return the endpoints value.
     */
    public AccountPropertiesEndpoints endpoints() {
        return this.endpoints;
    }

    /**
     * Get the friendlyName property: Gets or sets the friendly name.
     *
     * @return the friendlyName value.
     */
    public String friendlyName() {
        return this.friendlyName;
    }

    /**
     * Get the managedResourceGroupName property: Gets or sets the managed resource group name.
     *
     * @return the managedResourceGroupName value.
     */
    public String managedResourceGroupName() {
        return this.managedResourceGroupName;
    }

    /**
     * Set the managedResourceGroupName property: Gets or sets the managed resource group name.
     *
     * @param managedResourceGroupName the managedResourceGroupName value to set.
     * @return the AccountProperties object itself.
     */
    public AccountProperties withManagedResourceGroupName(String managedResourceGroupName) {
        this.managedResourceGroupName = managedResourceGroupName;
        return this;
    }

    /**
     * Get the managedResources property: Gets the resource identifiers of the managed resources.
     *
     * @return the managedResources value.
     */
    public AccountPropertiesManagedResources managedResources() {
        return this.managedResources;
    }

    /**
     * Get the privateEndpointConnections property: Gets the private endpoint connections information.
     *
     * @return the privateEndpointConnections value.
     */
    public List<PrivateEndpointConnectionInner> privateEndpointConnections() {
        return this.privateEndpointConnections;
    }

    /**
     * Get the provisioningState property: Gets or sets the state of the provisioning.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the publicNetworkAccess property: Gets or sets the public network access.
     *
     * @return the publicNetworkAccess value.
     */
    public PublicNetworkAccess publicNetworkAccess() {
        return this.publicNetworkAccess;
    }

    /**
     * Set the publicNetworkAccess property: Gets or sets the public network access.
     *
     * @param publicNetworkAccess the publicNetworkAccess value to set.
     * @return the AccountProperties object itself.
     */
    public AccountProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) {
        this.publicNetworkAccess = publicNetworkAccess;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (cloudConnectors() != null) {
            cloudConnectors().validate();
        }
        if (endpoints() != null) {
            endpoints().validate();
        }
        if (managedResources() != null) {
            managedResources().validate();
        }
        if (privateEndpointConnections() != null) {
            privateEndpointConnections().forEach(e -> e.validate());
        }
    }
}
