text: /*
   * Copyright (c) Microsoft Corporation.
   * Licensed under the MIT License.
   *
   * Code generated by Microsoft (R) AutoRest Code Generator.
   * Changes may cause incorrect behavior and will be lost if the code is regenerated.
   */
  
  // Copyright (c) Microsoft Corporation.
  // Licensed under the MIT License.
  const { SqlManagementClient } = require("@azure/arm-sql");
  const { DefaultAzureCredential } = require("@azure/identity");
  
  /**
   * This sample demonstrates how to Creates or updates a database data masking policy
   *
   * @summary Creates or updates a database data masking policy
   * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyCreateOrUpdateMax.json
   */
  async function createOrUpdateDataMaskingPolicyMax() {
    const subscriptionId = "00000000-1111-2222-3333-444444444444";
    const resourceGroupName = "sqlcrudtest-6852";
    const serverName = "sqlcrudtest-2080";
    const databaseName = "sqlcrudtest-331";
    const parameters = {
      dataMaskingState: "Enabled",
      exemptPrincipals: "testuser;",
    };
    const credential = new DefaultAzureCredential();
    const client = new SqlManagementClient(credential, subscriptionId);
    const result = await client.dataMaskingPolicies.createOrUpdate(
      resourceGroupName,
      serverName,
      databaseName,
      parameters
    );
    console.log(result);
  }
  
  createOrUpdateDataMaskingPolicyMax().catch(console.error);
  
  /**
   * This sample demonstrates how to Creates or updates a database data masking policy
   *
   * @summary Creates or updates a database data masking policy
   * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyCreateOrUpdateMin.json
   */
  async function createOrUpdateDataMaskingPolicyMin() {
    const subscriptionId = "00000000-1111-2222-3333-444444444444";
    const resourceGroupName = "sqlcrudtest-6852";
    const serverName = "sqlcrudtest-2080";
    const databaseName = "sqlcrudtest-331";
    const parameters = { dataMaskingState: "Enabled" };
    const credential = new DefaultAzureCredential();
    const client = new SqlManagementClient(credential, subscriptionId);
    const result = await client.dataMaskingPolicies.createOrUpdate(
      resourceGroupName,
      serverName,
      databaseName,
      parameters
    );
    console.log(result);
  }
  
  createOrUpdateDataMaskingPolicyMin().catch(console.error);
  