// 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.administration;

import com.azure.analytics.purview.administration.implementation.AccountsImpl;
import com.azure.core.annotation.Generated;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceClient;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.exception.ClientAuthenticationException;
import com.azure.core.exception.HttpResponseException;
import com.azure.core.exception.ResourceModifiedException;
import com.azure.core.exception.ResourceNotFoundException;
import com.azure.core.http.rest.RequestOptions;
import com.azure.core.http.rest.Response;
import com.azure.core.util.BinaryData;
import reactor.core.publisher.Mono;

/** Initializes a new instance of the asynchronous PurviewAccountClient type. */
@ServiceClient(builder = AccountsClientBuilder.class, isAsync = true)
public final class AccountsAsyncClient {
    @Generated private final AccountsImpl serviceClient;

    /**
     * Initializes an instance of AccountsAsyncClient class.
     *
     * @param serviceClient the service client implementation.
     */
    @Generated
    AccountsAsyncClient(AccountsImpl serviceClient) {
        this.serviceClient = serviceClient;
    }

    /**
     * Get an account.
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     id: String (Optional)
     *     identity (Optional): {
     *         principalId: String (Optional)
     *         tenantId: String (Optional)
     *         type: String(SystemAssigned) (Optional)
     *     }
     *     location: String (Optional)
     *     name: String (Optional)
     *     properties (Optional): {
     *         cloudConnectors (Optional): {
     *             awsExternalId: String (Optional)
     *         }
     *         createdAt: OffsetDateTime (Optional)
     *         createdBy: String (Optional)
     *         createdByObjectId: String (Optional)
     *         endpoints (Optional): {
     *             catalog: String (Optional)
     *             guardian: String (Optional)
     *             scan: String (Optional)
     *         }
     *         friendlyName: String (Optional)
     *         managedResourceGroupName: String (Optional)
     *         managedResources (Optional): {
     *             eventHubNamespace: String (Optional)
     *             resourceGroup: String (Optional)
     *             storageAccount: String (Optional)
     *         }
     *         privateEndpointConnections (Optional): [
     *              (Optional){
     *                 id: String (Optional)
     *                 name: String (Optional)
     *                 properties (Optional): {
     *                     privateEndpoint (Optional): {
     *                         id: String (Optional)
     *                     }
     *                     privateLinkServiceConnectionState (Optional): {
     *                         actionsRequired: String (Optional)
     *                         description: String (Optional)
     *                         status: String(Unknown/Pending/Approved/Rejected/Disconnected) (Optional)
     *                     }
     *                     provisioningState: String (Optional)
     *                 }
     *                 type: String (Optional)
     *             }
     *         ]
     *         provisioningState: String(Unknown/Creating/Moving/Deleting/SoftDeleting/SoftDeleted/Failed/Succeeded/Canceled) (Optional)
     *         publicNetworkAccess: String(NotSpecified/Enabled/Disabled) (Optional)
     *     }
     *     sku (Optional): {
     *         capacity: Integer (Optional)
     *         name: String(Standard) (Optional)
     *     }
     *     systemData (Optional): {
     *         createdAt: OffsetDateTime (Optional)
     *         createdBy: String (Optional)
     *         createdByType: String(User/Application/ManagedIdentity/Key) (Optional)
     *         lastModifiedAt: OffsetDateTime (Optional)
     *         lastModifiedBy: String (Optional)
     *         lastModifiedByType: String(User/Application/ManagedIdentity/Key) (Optional)
     *     }
     *     tags (Optional): {
     *         String: String (Optional)
     *     }
     *     type: String (Optional)
     * }
     * }</pre>
     *
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return an account along with {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> getAccountPropertiesWithResponse(RequestOptions requestOptions) {
        return this.serviceClient.getAccountPropertiesWithResponseAsync(requestOptions);
    }

    /**
     * Updates an account.
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     friendlyName: String (Optional)
     * }
     * }</pre>
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     id: String (Optional)
     *     identity (Optional): {
     *         principalId: String (Optional)
     *         tenantId: String (Optional)
     *         type: String(SystemAssigned) (Optional)
     *     }
     *     location: String (Optional)
     *     name: String (Optional)
     *     properties (Optional): {
     *         cloudConnectors (Optional): {
     *             awsExternalId: String (Optional)
     *         }
     *         createdAt: OffsetDateTime (Optional)
     *         createdBy: String (Optional)
     *         createdByObjectId: String (Optional)
     *         endpoints (Optional): {
     *             catalog: String (Optional)
     *             guardian: String (Optional)
     *             scan: String (Optional)
     *         }
     *         friendlyName: String (Optional)
     *         managedResourceGroupName: String (Optional)
     *         managedResources (Optional): {
     *             eventHubNamespace: String (Optional)
     *             resourceGroup: String (Optional)
     *             storageAccount: String (Optional)
     *         }
     *         privateEndpointConnections (Optional): [
     *              (Optional){
     *                 id: String (Optional)
     *                 name: String (Optional)
     *                 properties (Optional): {
     *                     privateEndpoint (Optional): {
     *                         id: String (Optional)
     *                     }
     *                     privateLinkServiceConnectionState (Optional): {
     *                         actionsRequired: String (Optional)
     *                         description: String (Optional)
     *                         status: String(Unknown/Pending/Approved/Rejected/Disconnected) (Optional)
     *                     }
     *                     provisioningState: String (Optional)
     *                 }
     *                 type: String (Optional)
     *             }
     *         ]
     *         provisioningState: String(Unknown/Creating/Moving/Deleting/SoftDeleting/SoftDeleted/Failed/Succeeded/Canceled) (Optional)
     *         publicNetworkAccess: String(NotSpecified/Enabled/Disabled) (Optional)
     *     }
     *     sku (Optional): {
     *         capacity: Integer (Optional)
     *         name: String(Standard) (Optional)
     *     }
     *     systemData (Optional): {
     *         createdAt: OffsetDateTime (Optional)
     *         createdBy: String (Optional)
     *         createdByType: String(User/Application/ManagedIdentity/Key) (Optional)
     *         lastModifiedAt: OffsetDateTime (Optional)
     *         lastModifiedBy: String (Optional)
     *         lastModifiedByType: String(User/Application/ManagedIdentity/Key) (Optional)
     *     }
     *     tags (Optional): {
     *         String: String (Optional)
     *     }
     *     type: String (Optional)
     * }
     * }</pre>
     *
     * @param accountUpdateParameters The account properties that can be updated through data plane.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return account resource along with {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> updateAccountPropertiesWithResponse(
            BinaryData accountUpdateParameters, RequestOptions requestOptions) {
        return this.serviceClient.updateAccountPropertiesWithResponseAsync(accountUpdateParameters, requestOptions);
    }

    /**
     * List the authorization keys associated with this account.
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     atlasKafkaPrimaryEndpoint: String (Optional)
     *     atlasKafkaSecondaryEndpoint: String (Optional)
     * }
     * }</pre>
     *
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the Account access keys along with {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> getAccessKeysWithResponse(RequestOptions requestOptions) {
        return this.serviceClient.getAccessKeysWithResponseAsync(requestOptions);
    }

    /**
     * Regenerate the authorization keys associated with this data catalog.
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     keyType: String(PrimaryAtlasKafkaKey/SecondaryAtlasKafkaKey) (Optional)
     * }
     * }</pre>
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     atlasKafkaPrimaryEndpoint: String (Optional)
     *     atlasKafkaSecondaryEndpoint: String (Optional)
     * }
     * }</pre>
     *
     * @param keyOptions A access key options used for regeneration.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the Account access keys along with {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> regenerateAccessKeyWithResponse(
            BinaryData keyOptions, RequestOptions requestOptions) {
        return this.serviceClient.regenerateAccessKeyWithResponseAsync(keyOptions, requestOptions);
    }
}
