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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.machinelearning.models.EncryptionProperty;
import com.azure.resourcemanager.machinelearning.models.ManagedServiceIdentity;
import com.azure.resourcemanager.machinelearning.models.ProvisioningState;
import com.azure.resourcemanager.machinelearning.models.PublicNetworkAccess;
import com.azure.resourcemanager.machinelearning.models.ServiceManagedResourcesSettings;
import com.azure.resourcemanager.machinelearning.models.SharedPrivateLinkResource;
import com.azure.resourcemanager.machinelearning.models.Sku;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** An object that represents a machine learning workspace. */
@Fluent
public final class WorkspaceInner extends ProxyResource {
    /*
     * The properties of the machine learning workspace.
     */
    @JsonProperty(value = "properties")
    private WorkspacePropertiesInner innerProperties;

    /*
     * The identity of the resource.
     */
    @JsonProperty(value = "identity")
    private ManagedServiceIdentity identity;

    /*
     * Specifies the location of the resource.
     */
    @JsonProperty(value = "location")
    private String location;

    /*
     * Contains resource tags defined as key/value pairs.
     */
    @JsonProperty(value = "tags")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> tags;

    /*
     * The sku of the workspace.
     */
    @JsonProperty(value = "sku")
    private Sku sku;

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

    /**
     * Get the innerProperties property: The properties of the machine learning workspace.
     *
     * @return the innerProperties value.
     */
    private WorkspacePropertiesInner innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the identity property: The identity of the resource.
     *
     * @return the identity value.
     */
    public ManagedServiceIdentity identity() {
        return this.identity;
    }

    /**
     * Set the identity property: The identity of the resource.
     *
     * @param identity the identity value to set.
     * @return the WorkspaceInner object itself.
     */
    public WorkspaceInner withIdentity(ManagedServiceIdentity identity) {
        this.identity = identity;
        return this;
    }

    /**
     * Get the location property: Specifies the location of the resource.
     *
     * @return the location value.
     */
    public String location() {
        return this.location;
    }

    /**
     * Set the location property: Specifies the location of the resource.
     *
     * @param location the location value to set.
     * @return the WorkspaceInner object itself.
     */
    public WorkspaceInner withLocation(String location) {
        this.location = location;
        return this;
    }

    /**
     * Get the tags property: Contains resource tags defined as key/value pairs.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Set the tags property: Contains resource tags defined as key/value pairs.
     *
     * @param tags the tags value to set.
     * @return the WorkspaceInner object itself.
     */
    public WorkspaceInner withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

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

    /**
     * Set the sku property: The sku of the workspace.
     *
     * @param sku the sku value to set.
     * @return the WorkspaceInner object itself.
     */
    public WorkspaceInner withSku(Sku sku) {
        this.sku = sku;
        return this;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the workspaceId property: The immutable id associated with this workspace.
     *
     * @return the workspaceId value.
     */
    public String workspaceId() {
        return this.innerProperties() == null ? null : this.innerProperties().workspaceId();
    }

    /**
     * Get the description property: The description of this workspace.
     *
     * @return the description value.
     */
    public String description() {
        return this.innerProperties() == null ? null : this.innerProperties().description();
    }

    /**
     * Set the description property: The description of this workspace.
     *
     * @param description the description value to set.
     * @return the WorkspaceInner object itself.
     */
    public WorkspaceInner withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkspacePropertiesInner();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

    /**
     * Get the friendlyName property: The friendly name for this workspace. This name in mutable.
     *
     * @return the friendlyName value.
     */
    public String friendlyName() {
        return this.innerProperties() == null ? null : this.innerProperties().friendlyName();
    }

    /**
     * Set the friendlyName property: The friendly name for this workspace. This name in mutable.
     *
     * @param friendlyName the friendlyName value to set.
     * @return the WorkspaceInner object itself.
     */
    public WorkspaceInner withFriendlyName(String friendlyName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkspacePropertiesInner();
        }
        this.innerProperties().withFriendlyName(friendlyName);
        return this;
    }

    /**
     * Get the keyVault property: ARM id of the key vault associated with this workspace. This cannot be changed once
     * the workspace has been created.
     *
     * @return the keyVault value.
     */
    public String keyVault() {
        return this.innerProperties() == null ? null : this.innerProperties().keyVault();
    }

    /**
     * Set the keyVault property: ARM id of the key vault associated with this workspace. This cannot be changed once
     * the workspace has been created.
     *
     * @param keyVault the keyVault value to set.
     * @return the WorkspaceInner object itself.
     */
    public WorkspaceInner withKeyVault(String keyVault) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkspacePropertiesInner();
        }
        this.innerProperties().withKeyVault(keyVault);
        return this;
    }

    /**
     * Get the applicationInsights property: ARM id of the application insights associated with this workspace.
     *
     * @return the applicationInsights value.
     */
    public String applicationInsights() {
        return this.innerProperties() == null ? null : this.innerProperties().applicationInsights();
    }

    /**
     * Set the applicationInsights property: ARM id of the application insights associated with this workspace.
     *
     * @param applicationInsights the applicationInsights value to set.
     * @return the WorkspaceInner object itself.
     */
    public WorkspaceInner withApplicationInsights(String applicationInsights) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkspacePropertiesInner();
        }
        this.innerProperties().withApplicationInsights(applicationInsights);
        return this;
    }

    /**
     * Get the containerRegistry property: ARM id of the container registry associated with this workspace.
     *
     * @return the containerRegistry value.
     */
    public String containerRegistry() {
        return this.innerProperties() == null ? null : this.innerProperties().containerRegistry();
    }

    /**
     * Set the containerRegistry property: ARM id of the container registry associated with this workspace.
     *
     * @param containerRegistry the containerRegistry value to set.
     * @return the WorkspaceInner object itself.
     */
    public WorkspaceInner withContainerRegistry(String containerRegistry) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkspacePropertiesInner();
        }
        this.innerProperties().withContainerRegistry(containerRegistry);
        return this;
    }

    /**
     * Get the storageAccount property: ARM id of the storage account associated with this workspace. This cannot be
     * changed once the workspace has been created.
     *
     * @return the storageAccount value.
     */
    public String storageAccount() {
        return this.innerProperties() == null ? null : this.innerProperties().storageAccount();
    }

    /**
     * Set the storageAccount property: ARM id of the storage account associated with this workspace. This cannot be
     * changed once the workspace has been created.
     *
     * @param storageAccount the storageAccount value to set.
     * @return the WorkspaceInner object itself.
     */
    public WorkspaceInner withStorageAccount(String storageAccount) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkspacePropertiesInner();
        }
        this.innerProperties().withStorageAccount(storageAccount);
        return this;
    }

    /**
     * Get the discoveryUrl property: Url for the discovery service to identify regional endpoints for machine learning
     * experimentation services.
     *
     * @return the discoveryUrl value.
     */
    public String discoveryUrl() {
        return this.innerProperties() == null ? null : this.innerProperties().discoveryUrl();
    }

    /**
     * Set the discoveryUrl property: Url for the discovery service to identify regional endpoints for machine learning
     * experimentation services.
     *
     * @param discoveryUrl the discoveryUrl value to set.
     * @return the WorkspaceInner object itself.
     */
    public WorkspaceInner withDiscoveryUrl(String discoveryUrl) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkspacePropertiesInner();
        }
        this.innerProperties().withDiscoveryUrl(discoveryUrl);
        return this;
    }

    /**
     * Get the provisioningState property: The current deployment state of workspace resource. The provisioningState is
     * to indicate states for resource provisioning.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the encryption property: The encryption settings of Azure ML workspace.
     *
     * @return the encryption value.
     */
    public EncryptionProperty encryption() {
        return this.innerProperties() == null ? null : this.innerProperties().encryption();
    }

    /**
     * Set the encryption property: The encryption settings of Azure ML workspace.
     *
     * @param encryption the encryption value to set.
     * @return the WorkspaceInner object itself.
     */
    public WorkspaceInner withEncryption(EncryptionProperty encryption) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkspacePropertiesInner();
        }
        this.innerProperties().withEncryption(encryption);
        return this;
    }

    /**
     * Get the hbiWorkspace property: The flag to signal HBI data in the workspace and reduce diagnostic data collected
     * by the service.
     *
     * @return the hbiWorkspace value.
     */
    public Boolean hbiWorkspace() {
        return this.innerProperties() == null ? null : this.innerProperties().hbiWorkspace();
    }

    /**
     * Set the hbiWorkspace property: The flag to signal HBI data in the workspace and reduce diagnostic data collected
     * by the service.
     *
     * @param hbiWorkspace the hbiWorkspace value to set.
     * @return the WorkspaceInner object itself.
     */
    public WorkspaceInner withHbiWorkspace(Boolean hbiWorkspace) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkspacePropertiesInner();
        }
        this.innerProperties().withHbiWorkspace(hbiWorkspace);
        return this;
    }

    /**
     * Get the serviceProvisionedResourceGroup property: The name of the managed resource group created by workspace RP
     * in customer subscription if the workspace is CMK workspace.
     *
     * @return the serviceProvisionedResourceGroup value.
     */
    public String serviceProvisionedResourceGroup() {
        return this.innerProperties() == null ? null : this.innerProperties().serviceProvisionedResourceGroup();
    }

    /**
     * Get the privateLinkCount property: Count of private connections in the workspace.
     *
     * @return the privateLinkCount value.
     */
    public Integer privateLinkCount() {
        return this.innerProperties() == null ? null : this.innerProperties().privateLinkCount();
    }

    /**
     * Get the imageBuildCompute property: The compute name for image build.
     *
     * @return the imageBuildCompute value.
     */
    public String imageBuildCompute() {
        return this.innerProperties() == null ? null : this.innerProperties().imageBuildCompute();
    }

    /**
     * Set the imageBuildCompute property: The compute name for image build.
     *
     * @param imageBuildCompute the imageBuildCompute value to set.
     * @return the WorkspaceInner object itself.
     */
    public WorkspaceInner withImageBuildCompute(String imageBuildCompute) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkspacePropertiesInner();
        }
        this.innerProperties().withImageBuildCompute(imageBuildCompute);
        return this;
    }

    /**
     * Get the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public access when behind
     * VNet.
     *
     * @return the allowPublicAccessWhenBehindVnet value.
     */
    public Boolean allowPublicAccessWhenBehindVnet() {
        return this.innerProperties() == null ? null : this.innerProperties().allowPublicAccessWhenBehindVnet();
    }

    /**
     * Set the allowPublicAccessWhenBehindVnet property: The flag to indicate whether to allow public access when behind
     * VNet.
     *
     * @param allowPublicAccessWhenBehindVnet the allowPublicAccessWhenBehindVnet value to set.
     * @return the WorkspaceInner object itself.
     */
    public WorkspaceInner withAllowPublicAccessWhenBehindVnet(Boolean allowPublicAccessWhenBehindVnet) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkspacePropertiesInner();
        }
        this.innerProperties().withAllowPublicAccessWhenBehindVnet(allowPublicAccessWhenBehindVnet);
        return this;
    }

    /**
     * Get the publicNetworkAccess property: Whether requests from Public Network are allowed.
     *
     * @return the publicNetworkAccess value.
     */
    public PublicNetworkAccess publicNetworkAccess() {
        return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess();
    }

    /**
     * Set the publicNetworkAccess property: Whether requests from Public Network are allowed.
     *
     * @param publicNetworkAccess the publicNetworkAccess value to set.
     * @return the WorkspaceInner object itself.
     */
    public WorkspaceInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkspacePropertiesInner();
        }
        this.innerProperties().withPublicNetworkAccess(publicNetworkAccess);
        return this;
    }

    /**
     * Get the privateEndpointConnections property: The list of private endpoint connections in the workspace.
     *
     * @return the privateEndpointConnections value.
     */
    public List<PrivateEndpointConnectionInner> privateEndpointConnections() {
        return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections();
    }

    /**
     * Get the sharedPrivateLinkResources property: The list of shared private link resources in this workspace.
     *
     * @return the sharedPrivateLinkResources value.
     */
    public List<SharedPrivateLinkResource> sharedPrivateLinkResources() {
        return this.innerProperties() == null ? null : this.innerProperties().sharedPrivateLinkResources();
    }

    /**
     * Set the sharedPrivateLinkResources property: The list of shared private link resources in this workspace.
     *
     * @param sharedPrivateLinkResources the sharedPrivateLinkResources value to set.
     * @return the WorkspaceInner object itself.
     */
    public WorkspaceInner withSharedPrivateLinkResources(List<SharedPrivateLinkResource> sharedPrivateLinkResources) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkspacePropertiesInner();
        }
        this.innerProperties().withSharedPrivateLinkResources(sharedPrivateLinkResources);
        return this;
    }

    /**
     * Get the notebookInfo property: The notebook info of Azure ML workspace.
     *
     * @return the notebookInfo value.
     */
    public NotebookResourceInfoInner notebookInfo() {
        return this.innerProperties() == null ? null : this.innerProperties().notebookInfo();
    }

    /**
     * Get the serviceManagedResourcesSettings property: The service managed resource settings.
     *
     * @return the serviceManagedResourcesSettings value.
     */
    public ServiceManagedResourcesSettings serviceManagedResourcesSettings() {
        return this.innerProperties() == null ? null : this.innerProperties().serviceManagedResourcesSettings();
    }

    /**
     * Set the serviceManagedResourcesSettings property: The service managed resource settings.
     *
     * @param serviceManagedResourcesSettings the serviceManagedResourcesSettings value to set.
     * @return the WorkspaceInner object itself.
     */
    public WorkspaceInner withServiceManagedResourcesSettings(
        ServiceManagedResourcesSettings serviceManagedResourcesSettings) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkspacePropertiesInner();
        }
        this.innerProperties().withServiceManagedResourcesSettings(serviceManagedResourcesSettings);
        return this;
    }

    /**
     * Get the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the
     * workspace identity.
     *
     * @return the primaryUserAssignedIdentity value.
     */
    public String primaryUserAssignedIdentity() {
        return this.innerProperties() == null ? null : this.innerProperties().primaryUserAssignedIdentity();
    }

    /**
     * Set the primaryUserAssignedIdentity property: The user assigned identity resource id that represents the
     * workspace identity.
     *
     * @param primaryUserAssignedIdentity the primaryUserAssignedIdentity value to set.
     * @return the WorkspaceInner object itself.
     */
    public WorkspaceInner withPrimaryUserAssignedIdentity(String primaryUserAssignedIdentity) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkspacePropertiesInner();
        }
        this.innerProperties().withPrimaryUserAssignedIdentity(primaryUserAssignedIdentity);
        return this;
    }

    /**
     * Get the tenantId property: The tenant id associated with this workspace.
     *
     * @return the tenantId value.
     */
    public String tenantId() {
        return this.innerProperties() == null ? null : this.innerProperties().tenantId();
    }

    /**
     * Get the storageHnsEnabled property: If the storage associated with the workspace has hierarchical namespace(HNS)
     * enabled.
     *
     * @return the storageHnsEnabled value.
     */
    public Boolean storageHnsEnabled() {
        return this.innerProperties() == null ? null : this.innerProperties().storageHnsEnabled();
    }

    /**
     * Get the mlFlowTrackingUri property: The URI associated with this workspace that machine learning flow must point
     * at to set up tracking.
     *
     * @return the mlFlowTrackingUri value.
     */
    public String mlFlowTrackingUri() {
        return this.innerProperties() == null ? null : this.innerProperties().mlFlowTrackingUri();
    }

    /**
     * Get the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided by the v2
     * API.
     *
     * @return the v1LegacyMode value.
     */
    public Boolean v1LegacyMode() {
        return this.innerProperties() == null ? null : this.innerProperties().v1LegacyMode();
    }

    /**
     * Set the v1LegacyMode property: Enabling v1_legacy_mode may prevent you from using features provided by the v2
     * API.
     *
     * @param v1LegacyMode the v1LegacyMode value to set.
     * @return the WorkspaceInner object itself.
     */
    public WorkspaceInner withV1LegacyMode(Boolean v1LegacyMode) {
        if (this.innerProperties() == null) {
            this.innerProperties = new WorkspacePropertiesInner();
        }
        this.innerProperties().withV1LegacyMode(v1LegacyMode);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() != null) {
            innerProperties().validate();
        }
        if (identity() != null) {
            identity().validate();
        }
        if (sku() != null) {
            sku().validate();
        }
    }
}
