// 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.MetadataRolesImpl;
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.util.BinaryData;

/** Initializes a new instance of the asynchronous PurviewMetadataClient type. */
@ServiceClient(builder = MetadataRolesClientBuilder.class, isAsync = true)
public final class MetadataRolesAsyncClient {
    @Generated private final MetadataRolesImpl serviceClient;

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

    /**
     * Lists roles for Purview Account.
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     id: String (Optional)
     *     name: String (Optional)
     *     type: String (Optional)
     *     properties (Optional): {
     *         provisioningState: String (Optional)
     *         roleType: String (Optional)
     *         friendlyName: String (Optional)
     *         description: String (Optional)
     *         cnfCondition (Optional): [
     *              (Optional)[
     *                  (Optional){
     *                     attributeName: String (Optional)
     *                     attributeValueIncludes: String (Optional)
     *                     attributeValueIncludedIn (Optional): [
     *                         String (Optional)
     *                     ]
     *                     attributeValueExcludes: String (Optional)
     *                     attributeValueExcludedIn (Optional): [
     *                         String (Optional)
     *                     ]
     *                 }
     *             ]
     *         ]
     *         dnfCondition (Optional): [
     *              (Optional)[
     *                 (recursive schema, see above)
     *             ]
     *         ]
     *         version: Long (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 list of Metadata roles as paginated response with {@link PagedFlux}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<BinaryData> list(RequestOptions requestOptions) {
        return this.serviceClient.listAsync(requestOptions);
    }
}
