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

package com.azure.analytics.purview.scanning.generated;

import com.azure.analytics.purview.scanning.PurviewScanningClientBuilder;
import com.azure.analytics.purview.scanning.ScanRulesetsClient;
import com.azure.core.http.rest.RequestOptions;
import com.azure.core.http.rest.Response;
import com.azure.core.util.BinaryData;
import com.azure.identity.DefaultAzureCredentialBuilder;

public class ScanRulesetsCreateOrUpdate {
    public static void main(String[] args) {
        ScanRulesetsClient scanRulesetsClient =
                new PurviewScanningClientBuilder()
                        .credential(new DefaultAzureCredentialBuilder().build())
                        .endpoint("{Endpoint}")
                        .buildScanRulesetsClient();
        // BEGIN:com.azure.analytics.purview.scanning.generated.scanrulesetscreateorupdate.scanrulesetscreateorupdate
        RequestOptions requestOptions =
                new RequestOptions()
                        .setBody(
                                BinaryData.fromString(
                                        "{\"kind\":\"AzureStorage\",\"properties\":{\"description\":null,\"excludedSystemClassifications\":[\"MICROSOFT.FINANCIAL.AUSTRALIA.BANK_ACCOUNT_NUMBER\",\"MICROSOFT.MISCELLANEOUS.IPADDRESS\"],\"includedCustomClassificationRuleNames\":[\"BF_PII\",\"Dummy_Rule2\"],\"scanningRule\":{\"customFileExtensions\":[{\"description\":\"model file type\",\"customFileType\":{\"builtInType\":null,\"customDelimiter\":\"$\"},\"enabled\":true,\"fileExtension\":\".model\"},{\"description\":\"mdoel1 type\",\"customFileType\":{\"builtInType\":\"JSON\",\"customDelimiter\":null},\"enabled\":true,\"fileExtension\":\".model1\"}],\"fileExtensions\":[\"CSV\",\"JSON\",\"PSV\",\"SSV\",\"TSV\",\"TXT\",\"XML\",\"PARQUET\"]}},\"scanRulesetType\":\"Custom\"}"));
        Response<BinaryData> response =
                scanRulesetsClient.createOrUpdateWithResponse("nyScanRulesetName", requestOptions);
        // END:com.azure.analytics.purview.scanning.generated.scanrulesetscreateorupdate.scanrulesetscreateorupdate
    }
}
