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

import com.azure.analytics.purview.sharing.SentSharesClient;
import com.azure.analytics.purview.sharing.SentSharesClientBuilder;
import com.azure.core.http.rest.RequestOptions;
import com.azure.core.util.BinaryData;
import com.azure.core.util.polling.SyncPoller;
import com.azure.identity.DefaultAzureCredentialBuilder;

public class SentSharesCreateOrReplaceAdlsGen2Account {
    public static void main(String[] args) {
        SentSharesClient sentSharesClient =
                new SentSharesClientBuilder()
                        .credential(new DefaultAzureCredentialBuilder().build())
                        .endpoint("accountName.purview.azure.com/share")
                        .buildClient();
        // BEGIN:com.azure.analytics.purview.sharing.generated.sentsharescreateorreplacesentshare.sentsharescreateorreplaceadlsgen2account
        BinaryData sentShare =
                BinaryData.fromString(
                        "{\"properties\":{\"description\":\"description\",\"artifact\":{\"properties\":{\"paths\":[{\"containerName\":\"container1\",\"receiverPath\":\"SharedFile.txt\",\"senderPath\":\"directory/file.txt\"}]},\"storeKind\":\"AdlsGen2Account\",\"storeReference\":{\"type\":\"ArmResourceReference\",\"referenceName\":\"/subscriptions/de06c3a0-4610-4ca0-8cbb-bbdac204bd65/resourceGroups/sender-storage-rg/providers/Microsoft.Storage/storageAccounts/providerstorage\"}},\"displayName\":\"sentShare1\"},\"shareKind\":\"InPlace\"}");
        RequestOptions requestOptions = new RequestOptions();
        SyncPoller<BinaryData, BinaryData> response =
                sentSharesClient.beginCreateOrReplaceSentShare(
                        "FF4A2AAE-8755-47BB-9C00-A774B5A7006E", sentShare, requestOptions);
        // END:com.azure.analytics.purview.sharing.generated.sentsharescreateorreplacesentshare.sentsharescreateorreplaceadlsgen2account
    }
}
