// 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.catalog.generated;

import com.azure.analytics.purview.catalog.CollectionClient;
import com.azure.analytics.purview.catalog.CollectionClientBuilder;
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 CollectionCreateOrUpdateBulk {
    public static void main(String[] args) {
        CollectionClient collectionClient =
                new CollectionClientBuilder()
                        .credential(new DefaultAzureCredentialBuilder().build())
                        .endpoint("{Endpoint}")
                        .buildClient();
        // BEGIN:com.azure.analytics.purview.catalog.generated.collectioncreateorupdatebulk.collectioncreateorupdatebulk
        BinaryData entities =
                BinaryData.fromString(
                        "{\"entities\":[{\"attributes\":{\"name\":\"exampleaccount\",\"description\":\"Example Description\",\"qualifiedName\":\"exampleaccount\"},\"typeName\":\"azure_storage_account\"},{\"attributes\":{\"name\":\"exampleaccount2\",\"qualifiedName\":\"exampleaccount2\"},\"typeName\":\"azure_storage_account\"}],\"referredEntities\":{}}");
        RequestOptions requestOptions = new RequestOptions();
        Response<BinaryData> response =
                collectionClient.createOrUpdateBulkWithResponse("ExampleCollection", entities, requestOptions);
        // END:com.azure.analytics.purview.catalog.generated.collectioncreateorupdatebulk.collectioncreateorupdatebulk
    }
}
