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

import com.azure.analytics.purview.catalog.implementation.DiscoveriesImpl;
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 PurviewCatalogClient type. */
@ServiceClient(builder = DiscoveryClientBuilder.class, isAsync = true)
public final class DiscoveryAsyncClient {
    @Generated private final DiscoveriesImpl serviceClient;

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

    /**
     * Gets data using search.
     * <p><strong>Request Body Schema</strong></p>
     * <pre>{@code
     * {
     *     keywords: String (Optional)
     *     offset: Integer (Optional)
     *     limit: Integer (Optional)
     *     filter: Object (Optional)
     *     facets (Optional): [
     *          (Optional){
     *             count: Integer (Optional)
     *             facet: String (Optional)
     *             sort: Object (Optional)
     *         }
     *     ]
     *     taxonomySetting (Optional): {
     *         assetTypes (Optional): [
     *             String (Optional)
     *         ]
     *         facet (Optional): (recursive schema, see facet above)
     *     }
     * }
     * }</pre>
     * <p><strong>Response Body Schema</strong></p>
     * <pre>{@code
     * {
     *     @search.count: Integer (Optional)
     *     @search.facets (Optional): {
     *         assetType (Optional): [
     *              (Optional){
     *                 count: Integer (Optional)
     *                 value: String (Optional)
     *             }
     *         ]
     *         classification (Optional): [
     *             (recursive schema, see above)
     *         ]
     *         classificationCategory (Optional): [
     *             (recursive schema, see above)
     *         ]
     *         contactId (Optional): [
     *             (recursive schema, see above)
     *         ]
     *         fileExtension (Optional): [
     *             (recursive schema, see above)
     *         ]
     *         label (Optional): [
     *             (recursive schema, see above)
     *         ]
     *         term (Optional): [
     *             (recursive schema, see above)
     *         ]
     *     }
     *     value (Optional): [
     *          (Optional){
     *             @search.score: Float (Optional)
     *             @search.highlights (Optional): {
     *                 id (Optional): [
     *                     String (Optional)
     *                 ]
     *                 qualifiedName (Optional): [
     *                     String (Optional)
     *                 ]
     *                 name (Optional): [
     *                     String (Optional)
     *                 ]
     *                 description (Optional): [
     *                     String (Optional)
     *                 ]
     *                 entityType (Optional): [
     *                     String (Optional)
     *                 ]
     *             }
     *             @search.text: String (Optional)
     *             description: String (Optional)
     *             id: String (Optional)
     *             name: String (Optional)
     *             owner: String (Optional)
     *             qualifiedName: String (Optional)
     *             entityType: String (Optional)
     *             classification (Optional): [
     *                 String (Optional)
     *             ]
     *             label (Optional): [
     *                 String (Optional)
     *             ]
     *             term (Optional): [
     *                  (Optional){
     *                     name: String (Optional)
     *                     glossaryName: String (Optional)
     *                     guid: String (Optional)
     *                 }
     *             ]
     *             contact (Optional): [
     *                  (Optional){
     *                     id: String (Optional)
     *                     info: String (Optional)
     *                     contactType: String (Optional)
     *                 }
     *             ]
     *             assetType (Optional): [
     *                 String (Optional)
     *             ]
     *         }
     *     ]
     * }
     * }</pre>
     *
     * @param searchRequest An object specifying the search criteria.
     * @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 data using search along with {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> queryWithResponse(BinaryData searchRequest, RequestOptions requestOptions) {
        return this.serviceClient.queryWithResponseAsync(searchRequest, requestOptions);
    }

    /**
     * Get search suggestions by query criteria.
     * <p><strong>Request Body Schema</strong></p>
     * <pre>{@code
     * {
     *     keywords: String (Optional)
     *     limit: Integer (Optional)
     *     filter: Object (Optional)
     * }
     * }</pre>
     * <p><strong>Response Body Schema</strong></p>
     * <pre>{@code
     * {
     *     value (Optional): [
     *          (Optional){
     *             @search.score: Float (Optional)
     *             @search.text: String (Optional)
     *             description: String (Optional)
     *             id: String (Optional)
     *             name: String (Optional)
     *             owner: String (Optional)
     *             qualifiedName: String (Optional)
     *             entityType: String (Optional)
     *             classification (Optional): [
     *                 String (Optional)
     *             ]
     *             label (Optional): [
     *                 String (Optional)
     *             ]
     *             term (Optional): [
     *                  (Optional){
     *                     name: String (Optional)
     *                     glossaryName: String (Optional)
     *                     guid: String (Optional)
     *                 }
     *             ]
     *             contact (Optional): [
     *                  (Optional){
     *                     id: String (Optional)
     *                     info: String (Optional)
     *                     contactType: String (Optional)
     *                 }
     *             ]
     *             assetType (Optional): [
     *                 String (Optional)
     *             ]
     *         }
     *     ]
     * }
     * }</pre>
     *
     * @param suggestRequest An object specifying the suggest criteria.
     * @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 search suggestions by query criteria along with {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> suggestWithResponse(BinaryData suggestRequest, RequestOptions requestOptions) {
        return this.serviceClient.suggestWithResponseAsync(suggestRequest, requestOptions);
    }

    /**
     * Browse entities by path or entity type.
     * <p><strong>Request Body Schema</strong></p>
     * <pre>{@code
     * {
     *     entityType: String (Optional)
     *     path: String (Optional)
     *     limit: Integer (Optional)
     *     offset: Integer (Optional)
     * }
     * }</pre>
     * <p><strong>Response Body Schema</strong></p>
     * <pre>{@code
     * {
     *     @search.count: Integer (Optional)
     *     value (Optional): [
     *          (Optional){
     *             entityType: String (Optional)
     *             id: String (Optional)
     *             isLeaf: Boolean (Optional)
     *             name: String (Optional)
     *             owner (Optional): [
     *                  (Optional){
     *                     id: String (Optional)
     *                     displayName: String (Optional)
     *                     mail: String (Optional)
     *                     contactType: String (Optional)
     *                 }
     *             ]
     *             path: String (Optional)
     *             qualifiedName: String (Optional)
     *         }
     *     ]
     * }
     * }</pre>
     *
     * @param browseRequest An object specifying the browse criteria.
     * @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 browseResult along with {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> browseWithResponse(BinaryData browseRequest, RequestOptions requestOptions) {
        return this.serviceClient.browseWithResponseAsync(browseRequest, requestOptions);
    }

    /**
     * Get auto complete options.
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     keywords: String (Optional)
     *     limit: Integer (Optional)
     *     filter: Object (Optional)
     * }
     * }</pre>
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     value (Optional): [
     *          (Optional){
     *             text: String (Optional)
     *             queryPlusText: String (Optional)
     *         }
     *     ]
     * }
     * }</pre>
     *
     * @param autoCompleteRequest An object specifying the autocomplete criteria.
     * @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 auto complete options along with {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> autoCompleteWithResponse(
            BinaryData autoCompleteRequest, RequestOptions requestOptions) {
        return this.serviceClient.autoCompleteWithResponseAsync(autoCompleteRequest, requestOptions);
    }
}
