// 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.http.rest.Response;
import com.azure.core.util.BinaryData;
import com.azure.identity.DefaultAzureCredentialBuilder;

public class SentSharesCreateUserInvitation {
    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.sentsharescreatesentshareinvitation.sentsharescreateuserinvitation
        BinaryData sentShareInvitation =
                BinaryData.fromString(
                        "{\"invitationKind\":\"User\",\"properties\":{\"expirationDate\":\"2025-07-21T23:52:00.7691109Z\",\"notify\":true,\"targetEmail\":\"testReceiver@microsoft.com\"}}");
        RequestOptions requestOptions = new RequestOptions();
        Response<BinaryData> response =
                sentSharesClient.createSentShareInvitationWithResponse(
                        "FF4A2AAE-8755-47BB-9C00-A774B5A7006E",
                        "9F154FA4-93D1-426B-A908-A9CAC7192B21",
                        sentShareInvitation,
                        requestOptions);
        // END:com.azure.analytics.purview.sharing.generated.sentsharescreatesentshareinvitation.sentsharescreateuserinvitation
    }
}
