// 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.ResourceSetRulesImpl;
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.PagedFlux;
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 = ResourceSetRulesClientBuilder.class, isAsync = true)
public final class ResourceSetRulesAsyncClient {
    @Generated private final ResourceSetRulesImpl serviceClient;

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

    /**
     * Get a resource set config service model.
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     advancedResourceSet (Optional): {
     *         modifiedAt: OffsetDateTime (Optional)
     *         resourceSetProcessing: String(Default/Advanced) (Optional)
     *     }
     *     name: String (Optional)
     *     pathPatternConfig (Optional): {
     *         acceptedPatterns (Optional): [
     *              (Optional){
     *                 createdBy: String (Optional)
     *                 filterType: String(Pattern/Regex) (Optional)
     *                 lastUpdatedTimestamp: Long (Optional)
     *                 modifiedBy: String (Optional)
     *                 name: String (Required)
     *                 path: String (Required)
     *             }
     *         ]
     *         complexReplacers (Optional): [
     *              (Optional){
     *                 createdBy: String (Optional)
     *                 description: String (Optional)
     *                 disabled: Boolean (Optional)
     *                 disableRecursiveReplacerApplication: Boolean (Optional)
     *                 lastUpdatedTimestamp: Long (Optional)
     *                 modifiedBy: String (Optional)
     *                 name: String (Optional)
     *                 typeName: String (Optional)
     *             }
     *         ]
     *         createdBy: String (Required)
     *         enableDefaultPatterns: boolean (Required)
     *         lastUpdatedTimestamp: Long (Optional)
     *         modifiedBy: String (Optional)
     *         normalizationRules (Optional): [
     *              (Optional){
     *                 description: String (Optional)
     *                 disabled: Boolean (Optional)
     *                 dynamicReplacement: Boolean (Optional)
     *                 entityTypes (Optional): [
     *                     String (Optional)
     *                 ]
     *                 lastUpdatedTimestamp: Long (Optional)
     *                 name: String (Optional)
     *                 regex (Optional): {
     *                     maxDigits: Integer (Optional)
     *                     maxLetters: Integer (Optional)
     *                     minDashes: Integer (Optional)
     *                     minDigits: Integer (Optional)
     *                     minDigitsOrLetters: Integer (Optional)
     *                     minDots: Integer (Optional)
     *                     minHex: Integer (Optional)
     *                     minLetters: Integer (Optional)
     *                     minUnderscores: Integer (Optional)
     *                     options: Integer (Optional)
     *                     regexStr: String (Optional)
     *                 }
     *                 replaceWith: String (Optional)
     *                 version: Double (Optional)
     *             }
     *         ]
     *         regexReplacers (Optional): [
     *              (Optional){
     *                 condition: String (Optional)
     *                 createdBy: String (Optional)
     *                 description: String (Optional)
     *                 disabled: boolean (Required)
     *                 disableRecursiveReplacerApplication: Boolean (Optional)
     *                 doNotReplaceRegex (Optional): (recursive schema, see doNotReplaceRegex above)
     *                 lastUpdatedTimestamp: Long (Optional)
     *                 modifiedBy: String (Optional)
     *                 name: String (Required)
     *                 regex (Optional): (recursive schema, see regex above)
     *                 replaceWith: String (Optional)
     *             }
     *         ]
     *         rejectedPatterns (Optional): [
     *             (recursive schema, see above)
     *         ]
     *         scopedRules (Optional): [
     *              (Optional){
     *                 bindingUrl: String (Required)
     *                 rules (Optional): [
     *                      (Optional){
     *                         displayName: String (Optional)
     *                         isResourceSet: Boolean (Optional)
     *                         lastUpdatedTimestamp: Long (Optional)
     *                         name: String (Optional)
     *                         qualifiedName: String (Required)
     *                     }
     *                 ]
     *                 storeType: String (Required)
     *             }
     *         ]
     *         version: Integer (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 a resource set config service model along with {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> getResourceSetRuleWithResponse(RequestOptions requestOptions) {
        return this.serviceClient.getResourceSetRuleWithResponseAsync(requestOptions);
    }

    /**
     * Creates or updates an resource set config.
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     advancedResourceSet (Optional): {
     *         modifiedAt: OffsetDateTime (Optional)
     *         resourceSetProcessing: String(Default/Advanced) (Optional)
     *     }
     *     name: String (Optional)
     *     pathPatternConfig (Optional): {
     *         acceptedPatterns (Optional): [
     *              (Optional){
     *                 createdBy: String (Optional)
     *                 filterType: String(Pattern/Regex) (Optional)
     *                 lastUpdatedTimestamp: Long (Optional)
     *                 modifiedBy: String (Optional)
     *                 name: String (Required)
     *                 path: String (Required)
     *             }
     *         ]
     *         complexReplacers (Optional): [
     *              (Optional){
     *                 createdBy: String (Optional)
     *                 description: String (Optional)
     *                 disabled: Boolean (Optional)
     *                 disableRecursiveReplacerApplication: Boolean (Optional)
     *                 lastUpdatedTimestamp: Long (Optional)
     *                 modifiedBy: String (Optional)
     *                 name: String (Optional)
     *                 typeName: String (Optional)
     *             }
     *         ]
     *         createdBy: String (Required)
     *         enableDefaultPatterns: boolean (Required)
     *         lastUpdatedTimestamp: Long (Optional)
     *         modifiedBy: String (Optional)
     *         normalizationRules (Optional): [
     *              (Optional){
     *                 description: String (Optional)
     *                 disabled: Boolean (Optional)
     *                 dynamicReplacement: Boolean (Optional)
     *                 entityTypes (Optional): [
     *                     String (Optional)
     *                 ]
     *                 lastUpdatedTimestamp: Long (Optional)
     *                 name: String (Optional)
     *                 regex (Optional): {
     *                     maxDigits: Integer (Optional)
     *                     maxLetters: Integer (Optional)
     *                     minDashes: Integer (Optional)
     *                     minDigits: Integer (Optional)
     *                     minDigitsOrLetters: Integer (Optional)
     *                     minDots: Integer (Optional)
     *                     minHex: Integer (Optional)
     *                     minLetters: Integer (Optional)
     *                     minUnderscores: Integer (Optional)
     *                     options: Integer (Optional)
     *                     regexStr: String (Optional)
     *                 }
     *                 replaceWith: String (Optional)
     *                 version: Double (Optional)
     *             }
     *         ]
     *         regexReplacers (Optional): [
     *              (Optional){
     *                 condition: String (Optional)
     *                 createdBy: String (Optional)
     *                 description: String (Optional)
     *                 disabled: boolean (Required)
     *                 disableRecursiveReplacerApplication: Boolean (Optional)
     *                 doNotReplaceRegex (Optional): (recursive schema, see doNotReplaceRegex above)
     *                 lastUpdatedTimestamp: Long (Optional)
     *                 modifiedBy: String (Optional)
     *                 name: String (Required)
     *                 regex (Optional): (recursive schema, see regex above)
     *                 replaceWith: String (Optional)
     *             }
     *         ]
     *         rejectedPatterns (Optional): [
     *             (recursive schema, see above)
     *         ]
     *         scopedRules (Optional): [
     *              (Optional){
     *                 bindingUrl: String (Required)
     *                 rules (Optional): [
     *                      (Optional){
     *                         displayName: String (Optional)
     *                         isResourceSet: Boolean (Optional)
     *                         lastUpdatedTimestamp: Long (Optional)
     *                         name: String (Optional)
     *                         qualifiedName: String (Required)
     *                     }
     *                 ]
     *                 storeType: String (Required)
     *             }
     *         ]
     *         version: Integer (Optional)
     *     }
     * }
     * }</pre>
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     advancedResourceSet (Optional): {
     *         modifiedAt: OffsetDateTime (Optional)
     *         resourceSetProcessing: String(Default/Advanced) (Optional)
     *     }
     *     name: String (Optional)
     *     pathPatternConfig (Optional): {
     *         acceptedPatterns (Optional): [
     *              (Optional){
     *                 createdBy: String (Optional)
     *                 filterType: String(Pattern/Regex) (Optional)
     *                 lastUpdatedTimestamp: Long (Optional)
     *                 modifiedBy: String (Optional)
     *                 name: String (Required)
     *                 path: String (Required)
     *             }
     *         ]
     *         complexReplacers (Optional): [
     *              (Optional){
     *                 createdBy: String (Optional)
     *                 description: String (Optional)
     *                 disabled: Boolean (Optional)
     *                 disableRecursiveReplacerApplication: Boolean (Optional)
     *                 lastUpdatedTimestamp: Long (Optional)
     *                 modifiedBy: String (Optional)
     *                 name: String (Optional)
     *                 typeName: String (Optional)
     *             }
     *         ]
     *         createdBy: String (Required)
     *         enableDefaultPatterns: boolean (Required)
     *         lastUpdatedTimestamp: Long (Optional)
     *         modifiedBy: String (Optional)
     *         normalizationRules (Optional): [
     *              (Optional){
     *                 description: String (Optional)
     *                 disabled: Boolean (Optional)
     *                 dynamicReplacement: Boolean (Optional)
     *                 entityTypes (Optional): [
     *                     String (Optional)
     *                 ]
     *                 lastUpdatedTimestamp: Long (Optional)
     *                 name: String (Optional)
     *                 regex (Optional): {
     *                     maxDigits: Integer (Optional)
     *                     maxLetters: Integer (Optional)
     *                     minDashes: Integer (Optional)
     *                     minDigits: Integer (Optional)
     *                     minDigitsOrLetters: Integer (Optional)
     *                     minDots: Integer (Optional)
     *                     minHex: Integer (Optional)
     *                     minLetters: Integer (Optional)
     *                     minUnderscores: Integer (Optional)
     *                     options: Integer (Optional)
     *                     regexStr: String (Optional)
     *                 }
     *                 replaceWith: String (Optional)
     *                 version: Double (Optional)
     *             }
     *         ]
     *         regexReplacers (Optional): [
     *              (Optional){
     *                 condition: String (Optional)
     *                 createdBy: String (Optional)
     *                 description: String (Optional)
     *                 disabled: boolean (Required)
     *                 disableRecursiveReplacerApplication: Boolean (Optional)
     *                 doNotReplaceRegex (Optional): (recursive schema, see doNotReplaceRegex above)
     *                 lastUpdatedTimestamp: Long (Optional)
     *                 modifiedBy: String (Optional)
     *                 name: String (Required)
     *                 regex (Optional): (recursive schema, see regex above)
     *                 replaceWith: String (Optional)
     *             }
     *         ]
     *         rejectedPatterns (Optional): [
     *             (recursive schema, see above)
     *         ]
     *         scopedRules (Optional): [
     *              (Optional){
     *                 bindingUrl: String (Required)
     *                 rules (Optional): [
     *                      (Optional){
     *                         displayName: String (Optional)
     *                         isResourceSet: Boolean (Optional)
     *                         lastUpdatedTimestamp: Long (Optional)
     *                         name: String (Optional)
     *                         qualifiedName: String (Required)
     *                     }
     *                 ]
     *                 storeType: String (Required)
     *             }
     *         ]
     *         version: Integer (Optional)
     *     }
     * }
     * }</pre>
     *
     * @param resourceSetRuleConfig ResourceSetRuleConfig implementation class.
     * @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 resourceSetRuleConfig implementation class along with {@link Response} on successful completion of {@link
     *     Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> createOrUpdateResourceSetRuleWithResponse(
            BinaryData resourceSetRuleConfig, RequestOptions requestOptions) {
        return this.serviceClient.createOrUpdateResourceSetRuleWithResponseAsync(resourceSetRuleConfig, requestOptions);
    }

    /**
     * Deletes a ResourceSetRuleConfig resource.
     *
     * @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 {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<Void>> deleteResourceSetRuleWithResponse(RequestOptions requestOptions) {
        return this.serviceClient.deleteResourceSetRuleWithResponseAsync(requestOptions);
    }

    /**
     * Get a resource set config service model.
     *
     * <p><strong>Query Parameters</strong>
     *
     * <table border="1">
     *     <caption>Query Parameters</caption>
     *     <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
     *     <tr><td>$skipToken</td><td>String</td><td>No</td><td>The skipToken parameter</td></tr>
     * </table>
     *
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     advancedResourceSet (Optional): {
     *         modifiedAt: OffsetDateTime (Optional)
     *         resourceSetProcessing: String(Default/Advanced) (Optional)
     *     }
     *     name: String (Optional)
     *     pathPatternConfig (Optional): {
     *         acceptedPatterns (Optional): [
     *              (Optional){
     *                 createdBy: String (Optional)
     *                 filterType: String(Pattern/Regex) (Optional)
     *                 lastUpdatedTimestamp: Long (Optional)
     *                 modifiedBy: String (Optional)
     *                 name: String (Required)
     *                 path: String (Required)
     *             }
     *         ]
     *         complexReplacers (Optional): [
     *              (Optional){
     *                 createdBy: String (Optional)
     *                 description: String (Optional)
     *                 disabled: Boolean (Optional)
     *                 disableRecursiveReplacerApplication: Boolean (Optional)
     *                 lastUpdatedTimestamp: Long (Optional)
     *                 modifiedBy: String (Optional)
     *                 name: String (Optional)
     *                 typeName: String (Optional)
     *             }
     *         ]
     *         createdBy: String (Required)
     *         enableDefaultPatterns: boolean (Required)
     *         lastUpdatedTimestamp: Long (Optional)
     *         modifiedBy: String (Optional)
     *         normalizationRules (Optional): [
     *              (Optional){
     *                 description: String (Optional)
     *                 disabled: Boolean (Optional)
     *                 dynamicReplacement: Boolean (Optional)
     *                 entityTypes (Optional): [
     *                     String (Optional)
     *                 ]
     *                 lastUpdatedTimestamp: Long (Optional)
     *                 name: String (Optional)
     *                 regex (Optional): {
     *                     maxDigits: Integer (Optional)
     *                     maxLetters: Integer (Optional)
     *                     minDashes: Integer (Optional)
     *                     minDigits: Integer (Optional)
     *                     minDigitsOrLetters: Integer (Optional)
     *                     minDots: Integer (Optional)
     *                     minHex: Integer (Optional)
     *                     minLetters: Integer (Optional)
     *                     minUnderscores: Integer (Optional)
     *                     options: Integer (Optional)
     *                     regexStr: String (Optional)
     *                 }
     *                 replaceWith: String (Optional)
     *                 version: Double (Optional)
     *             }
     *         ]
     *         regexReplacers (Optional): [
     *              (Optional){
     *                 condition: String (Optional)
     *                 createdBy: String (Optional)
     *                 description: String (Optional)
     *                 disabled: boolean (Required)
     *                 disableRecursiveReplacerApplication: Boolean (Optional)
     *                 doNotReplaceRegex (Optional): (recursive schema, see doNotReplaceRegex above)
     *                 lastUpdatedTimestamp: Long (Optional)
     *                 modifiedBy: String (Optional)
     *                 name: String (Required)
     *                 regex (Optional): (recursive schema, see regex above)
     *                 replaceWith: String (Optional)
     *             }
     *         ]
     *         rejectedPatterns (Optional): [
     *             (recursive schema, see above)
     *         ]
     *         scopedRules (Optional): [
     *              (Optional){
     *                 bindingUrl: String (Required)
     *                 rules (Optional): [
     *                      (Optional){
     *                         displayName: String (Optional)
     *                         isResourceSet: Boolean (Optional)
     *                         lastUpdatedTimestamp: Long (Optional)
     *                         name: String (Optional)
     *                         qualifiedName: String (Required)
     *                     }
     *                 ]
     *                 storeType: String (Required)
     *             }
     *         ]
     *         version: Integer (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 a resource set config service model as paginated response with {@link PagedFlux}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<BinaryData> listResourceSetRules(RequestOptions requestOptions) {
        return this.serviceClient.listResourceSetRulesAsync(requestOptions);
    }
}
