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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.synapse.models.EncryptionDetails;
import com.azure.resourcemanager.synapse.models.ManagedVirtualNetworkSettings;
import com.azure.resourcemanager.synapse.models.PurviewConfiguration;
import com.azure.resourcemanager.synapse.models.WorkspacePublicNetworkAccess;
import com.azure.resourcemanager.synapse.models.WorkspaceRepositoryConfiguration;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Workspace patch properties. */
@Fluent
public final class WorkspacePatchProperties {
    /*
     * SQL administrator login password
     */
    @JsonProperty(value = "sqlAdministratorLoginPassword")
    private String sqlAdministratorLoginPassword;

    /*
     * Managed Virtual Network Settings
     */
    @JsonProperty(value = "managedVirtualNetworkSettings")
    private ManagedVirtualNetworkSettings managedVirtualNetworkSettings;

    /*
     * Git integration settings
     */
    @JsonProperty(value = "workspaceRepositoryConfiguration")
    private WorkspaceRepositoryConfiguration workspaceRepositoryConfiguration;

    /*
     * Purview Configuration
     */
    @JsonProperty(value = "purviewConfiguration")
    private PurviewConfiguration purviewConfiguration;

    /*
     * Resource provisioning state
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private String provisioningState;

    /*
     * The encryption details of the workspace
     */
    @JsonProperty(value = "encryption")
    private EncryptionDetails encryption;

    /*
     * Enable or Disable public network access to workspace
     */
    @JsonProperty(value = "publicNetworkAccess")
    private WorkspacePublicNetworkAccess publicNetworkAccess;

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

    /**
     * Get the sqlAdministratorLoginPassword property: SQL administrator login password.
     *
     * @return the sqlAdministratorLoginPassword value.
     */
    public String sqlAdministratorLoginPassword() {
        return this.sqlAdministratorLoginPassword;
    }

    /**
     * Set the sqlAdministratorLoginPassword property: SQL administrator login password.
     *
     * @param sqlAdministratorLoginPassword the sqlAdministratorLoginPassword value to set.
     * @return the WorkspacePatchProperties object itself.
     */
    public WorkspacePatchProperties withSqlAdministratorLoginPassword(String sqlAdministratorLoginPassword) {
        this.sqlAdministratorLoginPassword = sqlAdministratorLoginPassword;
        return this;
    }

    /**
     * Get the managedVirtualNetworkSettings property: Managed Virtual Network Settings.
     *
     * @return the managedVirtualNetworkSettings value.
     */
    public ManagedVirtualNetworkSettings managedVirtualNetworkSettings() {
        return this.managedVirtualNetworkSettings;
    }

    /**
     * Set the managedVirtualNetworkSettings property: Managed Virtual Network Settings.
     *
     * @param managedVirtualNetworkSettings the managedVirtualNetworkSettings value to set.
     * @return the WorkspacePatchProperties object itself.
     */
    public WorkspacePatchProperties withManagedVirtualNetworkSettings(
        ManagedVirtualNetworkSettings managedVirtualNetworkSettings) {
        this.managedVirtualNetworkSettings = managedVirtualNetworkSettings;
        return this;
    }

    /**
     * Get the workspaceRepositoryConfiguration property: Git integration settings.
     *
     * @return the workspaceRepositoryConfiguration value.
     */
    public WorkspaceRepositoryConfiguration workspaceRepositoryConfiguration() {
        return this.workspaceRepositoryConfiguration;
    }

    /**
     * Set the workspaceRepositoryConfiguration property: Git integration settings.
     *
     * @param workspaceRepositoryConfiguration the workspaceRepositoryConfiguration value to set.
     * @return the WorkspacePatchProperties object itself.
     */
    public WorkspacePatchProperties withWorkspaceRepositoryConfiguration(
        WorkspaceRepositoryConfiguration workspaceRepositoryConfiguration) {
        this.workspaceRepositoryConfiguration = workspaceRepositoryConfiguration;
        return this;
    }

    /**
     * Get the purviewConfiguration property: Purview Configuration.
     *
     * @return the purviewConfiguration value.
     */
    public PurviewConfiguration purviewConfiguration() {
        return this.purviewConfiguration;
    }

    /**
     * Set the purviewConfiguration property: Purview Configuration.
     *
     * @param purviewConfiguration the purviewConfiguration value to set.
     * @return the WorkspacePatchProperties object itself.
     */
    public WorkspacePatchProperties withPurviewConfiguration(PurviewConfiguration purviewConfiguration) {
        this.purviewConfiguration = purviewConfiguration;
        return this;
    }

    /**
     * Get the provisioningState property: Resource provisioning state.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.provisioningState;
    }

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

    /**
     * Set the encryption property: The encryption details of the workspace.
     *
     * @param encryption the encryption value to set.
     * @return the WorkspacePatchProperties object itself.
     */
    public WorkspacePatchProperties withEncryption(EncryptionDetails encryption) {
        this.encryption = encryption;
        return this;
    }

    /**
     * Get the publicNetworkAccess property: Enable or Disable public network access to workspace.
     *
     * @return the publicNetworkAccess value.
     */
    public WorkspacePublicNetworkAccess publicNetworkAccess() {
        return this.publicNetworkAccess;
    }

    /**
     * Set the publicNetworkAccess property: Enable or Disable public network access to workspace.
     *
     * @param publicNetworkAccess the publicNetworkAccess value to set.
     * @return the WorkspacePatchProperties object itself.
     */
    public WorkspacePatchProperties withPublicNetworkAccess(WorkspacePublicNetworkAccess publicNetworkAccess) {
        this.publicNetworkAccess = publicNetworkAccess;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (managedVirtualNetworkSettings() != null) {
            managedVirtualNetworkSettings().validate();
        }
        if (workspaceRepositoryConfiguration() != null) {
            workspaceRepositoryConfiguration().validate();
        }
        if (purviewConfiguration() != null) {
            purviewConfiguration().validate();
        }
        if (encryption() != null) {
            encryption().validate();
        }
    }
}
