cadl-output/java/src/main/java/com/notificationhubs/InstallationsAsyncClient.java
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.notificationhubs;

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 com.notificationhubs.implementation.InstallationsImpl;
import reactor.core.publisher.Mono;

/** Initializes a new instance of the asynchronous AzureNotificationHubsServiceClient type. */
@ServiceClient(builder = InstallationsClientBuilder.class, isAsync = true)
public final class InstallationsAsyncClient {
    @Generated private final InstallationsImpl serviceClient;

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

    /**
     * Get an Azure Notification Hubs installation.
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     installationId: String (Required)
     *     userId: String (Optional)
     *     expirationTime: String (Optional)
     *     lastUpdate: String (Optional)
     *     tags (Required): [
     *         String (Required)
     *     ]
     *     templates (Required): {
     *         String: String (Required)
     *     }
     * }
     * }</pre>
     *
     * @param installationId The installation ID.
     * @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 Azure Notification Hubs installation along with {@link Response} on successful completion of {@link
     *     Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> getWithResponse(String installationId, RequestOptions requestOptions) {
        return this.serviceClient.getWithResponseAsync(installationId, requestOptions);
    }

    /**
     * Delete an Azure Notification Hubs installation.
     *
     * @param installationId The installation ID.
     * @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>> deleteWithResponse(String installationId, RequestOptions requestOptions) {
        return this.serviceClient.deleteWithResponseAsync(installationId, requestOptions);
    }

    /**
     * Create or update an Azure Notification Hubs installation.
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     installationId: String (Required)
     *     userId: String (Optional)
     *     expirationTime: String (Optional)
     *     lastUpdate: String (Optional)
     *     tags (Required): [
     *         String (Required)
     *     ]
     *     templates (Required): {
     *         String: String (Required)
     *     }
     * }
     * }</pre>
     *
     * @param installationId The installation ID.
     * @param installation The installation object.
     * @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>> createOrUpdateWithResponse(
            String installationId, BinaryData installation, RequestOptions requestOptions) {
        return this.serviceClient.createOrUpdateWithResponseAsync(installationId, installation, requestOptions);
    }

    /**
     * Update an Azure Notification Hubs installation using JSON Patch semantics.
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * [
     *      (Required){
     *         op: String(add/remove/replace) (Required)
     *         path: String (Required)
     *         value: String (Optional)
     *     }
     * ]
     * }</pre>
     *
     * @param installationId The installation ID.
     * @param updates The installation patches.
     * @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>> updateWithResponse(
            String installationId, BinaryData updates, RequestOptions requestOptions) {
        return this.serviceClient.updateWithResponseAsync(installationId, updates, requestOptions);
    }
}
