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

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.PagedIterable;
import com.azure.core.http.rest.RequestOptions;
import com.azure.core.util.BinaryData;

/** Initializes a new instance of the synchronous PurviewShareClient type. */
@ServiceClient(builder = ShareResourcesClientBuilder.class)
public final class ShareResourcesClient {
    @Generated private final ShareResourcesAsyncClient client;

    /**
     * Initializes an instance of ShareResourcesClient class.
     *
     * @param client the async client.
     */
    @Generated
    ShareResourcesClient(ShareResourcesAsyncClient client) {
        this.client = client;
    }

    /**
     * API operation to list ShareResources.
     *
     * <p>List share resources.
     *
     * <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>filter</td><td>String</td><td>No</td><td>Filters the results using OData syntax</td></tr>
     *     <tr><td>orderby</td><td>String</td><td>No</td><td>Sorts the results using OData syntax</td></tr>
     * </table>
     *
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     id: String (Optional)
     *     type: String (Optional)
     *     receivedSharesCount: Integer (Optional)
     *     sentSharesCount: Integer (Optional)
     *     storeKind: String(AdlsGen2Account/BlobAccount) (Optional)
     *     storeReference (Optional): {
     *         referenceName: String (Optional)
     *         type: String(ArmResourceReference) (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 page of ShareResource results as paginated response with {@link PagedIterable}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<BinaryData> listShareResources(RequestOptions requestOptions) {
        return new PagedIterable<>(this.client.listShareResources(requestOptions));
    }
}
