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

import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.Patch;
import com.azure.core.annotation.Post;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
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.http.rest.RestProxy;
import com.azure.core.util.BinaryData;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import reactor.core.publisher.Mono;

/** An instance of this class provides access to all the operations defined in Accounts. */
public final class AccountsImpl {
    /** The proxy service used to perform REST calls. */
    private final AccountsService service;

    /** The service client containing this operation class. */
    private final PurviewAccountClientImpl client;

    /**
     * Initializes an instance of AccountsImpl.
     *
     * @param client the instance of the service client containing this operation class.
     */
    AccountsImpl(PurviewAccountClientImpl client) {
        this.service = RestProxy.create(AccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
        this.client = client;
    }

    /**
     * The interface defining all the services for PurviewAccountClientAccounts to be used by the proxy service to
     * perform REST calls.
     */
    @Host("{endpoint}")
    @ServiceInterface(name = "PurviewAccountClient")
    public interface AccountsService {
        @Get("/")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<BinaryData>> getAccountProperties(
                @HostParam("endpoint") String endpoint,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Get("/")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Response<BinaryData> getAccountPropertiesSync(
                @HostParam("endpoint") String endpoint,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Patch("/")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<BinaryData>> updateAccountProperties(
                @HostParam("endpoint") String endpoint,
                @QueryParam("api-version") String apiVersion,
                @BodyParam("application/json") BinaryData accountUpdateParameters,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Patch("/")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Response<BinaryData> updateAccountPropertiesSync(
                @HostParam("endpoint") String endpoint,
                @QueryParam("api-version") String apiVersion,
                @BodyParam("application/json") BinaryData accountUpdateParameters,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Post("/listkeys")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<BinaryData>> getAccessKeys(
                @HostParam("endpoint") String endpoint,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Post("/listkeys")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Response<BinaryData> getAccessKeysSync(
                @HostParam("endpoint") String endpoint,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Post("/regeneratekeys")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<BinaryData>> regenerateAccessKey(
                @HostParam("endpoint") String endpoint,
                @QueryParam("api-version") String apiVersion,
                @BodyParam("application/json") BinaryData keyOptions,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Post("/regeneratekeys")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Response<BinaryData> regenerateAccessKeySync(
                @HostParam("endpoint") String endpoint,
                @QueryParam("api-version") String apiVersion,
                @BodyParam("application/json") BinaryData keyOptions,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);
    }

    /**
     * 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}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> getAccountPropertiesWithResponseAsync(RequestOptions requestOptions) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.getAccountProperties(
                                this.client.getEndpoint(),
                                this.client.getServiceVersion().getVersion(),
                                accept,
                                requestOptions,
                                context));
    }

    /**
     * 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}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> getAccountPropertiesWithResponse(RequestOptions requestOptions) {
        final String accept = "application/json";
        return service.getAccountPropertiesSync(
                this.client.getEndpoint(),
                this.client.getServiceVersion().getVersion(),
                accept,
                requestOptions,
                Context.NONE);
    }

    /**
     * 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}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> updateAccountPropertiesWithResponseAsync(
            BinaryData accountUpdateParameters, RequestOptions requestOptions) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.updateAccountProperties(
                                this.client.getEndpoint(),
                                this.client.getServiceVersion().getVersion(),
                                accountUpdateParameters,
                                accept,
                                requestOptions,
                                context));
    }

    /**
     * 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}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> updateAccountPropertiesWithResponse(
            BinaryData accountUpdateParameters, RequestOptions requestOptions) {
        final String accept = "application/json";
        return service.updateAccountPropertiesSync(
                this.client.getEndpoint(),
                this.client.getServiceVersion().getVersion(),
                accountUpdateParameters,
                accept,
                requestOptions,
                Context.NONE);
    }

    /**
     * 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}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> getAccessKeysWithResponseAsync(RequestOptions requestOptions) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.getAccessKeys(
                                this.client.getEndpoint(),
                                this.client.getServiceVersion().getVersion(),
                                accept,
                                requestOptions,
                                context));
    }

    /**
     * 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}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> getAccessKeysWithResponse(RequestOptions requestOptions) {
        final String accept = "application/json";
        return service.getAccessKeysSync(
                this.client.getEndpoint(),
                this.client.getServiceVersion().getVersion(),
                accept,
                requestOptions,
                Context.NONE);
    }

    /**
     * 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}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> regenerateAccessKeyWithResponseAsync(
            BinaryData keyOptions, RequestOptions requestOptions) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.regenerateAccessKey(
                                this.client.getEndpoint(),
                                this.client.getServiceVersion().getVersion(),
                                keyOptions,
                                accept,
                                requestOptions,
                                context));
    }

    /**
     * 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}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> regenerateAccessKeyWithResponse(BinaryData keyOptions, RequestOptions requestOptions) {
        final String accept = "application/json";
        return service.regenerateAccessKeySync(
                this.client.getEndpoint(),
                this.client.getServiceVersion().getVersion(),
                keyOptions,
                accept,
                requestOptions,
                Context.NONE);
    }
}
