tsp-output/@azure-tools/typespec-java/src/main/java/com/notificationhubs/implementation/NotificationHubsClientImpl.java
<filename>tsp-output/@azure-tools/typespec-java/src/main/java/com/notificationhubs/implementation/NotificationHubsClientImpl.java// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.notificationhubs.implementation;

import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.Delete;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.Patch;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.Post;
import com.azure.core.annotation.Put;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
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.HttpPipeline;
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.policy.CookiePolicy;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.http.rest.RequestOptions;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.util.BinaryData;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.serializer.JacksonAdapter;
import com.azure.core.util.serializer.SerializerAdapter;
import com.notificationhubs.NotificationHubsServiceVersion;
import reactor.core.publisher.Mono;

/** Initializes a new instance of the NotificationHubsClient type. */
public final class NotificationHubsClientImpl {
    /** The proxy service used to perform REST calls. */
    private final NotificationHubsClientService service;

    /** Notification Hubs Namespace. */
    private final String namespaceName;

    /**
     * Gets Notification Hubs Namespace.
     *
     * @return the namespaceName value.
     */
    public String getNamespaceName() {
        return this.namespaceName;
    }

    /** Notification Hub Name. */
    private final String hubName;

    /**
     * Gets Notification Hub Name.
     *
     * @return the hubName value.
     */
    public String getHubName() {
        return this.hubName;
    }

    /** Service version. */
    private final NotificationHubsServiceVersion serviceVersion;

    /**
     * Gets Service version.
     *
     * @return the serviceVersion value.
     */
    public NotificationHubsServiceVersion getServiceVersion() {
        return this.serviceVersion;
    }

    /** The HTTP pipeline to send requests through. */
    private final HttpPipeline httpPipeline;

    /**
     * Gets The HTTP pipeline to send requests through.
     *
     * @return the httpPipeline value.
     */
    public HttpPipeline getHttpPipeline() {
        return this.httpPipeline;
    }

    /** The serializer to serialize an object into a string. */
    private final SerializerAdapter serializerAdapter;

    /**
     * Gets The serializer to serialize an object into a string.
     *
     * @return the serializerAdapter value.
     */
    public SerializerAdapter getSerializerAdapter() {
        return this.serializerAdapter;
    }

    /**
     * Initializes an instance of NotificationHubsClient client.
     *
     * @param namespaceName Notification Hubs Namespace.
     * @param hubName Notification Hub Name.
     * @param serviceVersion Service version.
     */
    public NotificationHubsClientImpl(
            String namespaceName, String hubName, NotificationHubsServiceVersion serviceVersion) {
        this(
                new HttpPipelineBuilder()
                        .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy())
                        .build(),
                JacksonAdapter.createDefaultSerializerAdapter(),
                namespaceName,
                hubName,
                serviceVersion);
    }

    /**
     * Initializes an instance of NotificationHubsClient client.
     *
     * @param httpPipeline The HTTP pipeline to send requests through.
     * @param namespaceName Notification Hubs Namespace.
     * @param hubName Notification Hub Name.
     * @param serviceVersion Service version.
     */
    public NotificationHubsClientImpl(
            HttpPipeline httpPipeline,
            String namespaceName,
            String hubName,
            NotificationHubsServiceVersion serviceVersion) {
        this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), namespaceName, hubName, serviceVersion);
    }

    /**
     * Initializes an instance of NotificationHubsClient client.
     *
     * @param httpPipeline The HTTP pipeline to send requests through.
     * @param serializerAdapter The serializer to serialize an object into a string.
     * @param namespaceName Notification Hubs Namespace.
     * @param hubName Notification Hub Name.
     * @param serviceVersion Service version.
     */
    public NotificationHubsClientImpl(
            HttpPipeline httpPipeline,
            SerializerAdapter serializerAdapter,
            String namespaceName,
            String hubName,
            NotificationHubsServiceVersion serviceVersion) {
        this.httpPipeline = httpPipeline;
        this.serializerAdapter = serializerAdapter;
        this.namespaceName = namespaceName;
        this.hubName = hubName;
        this.serviceVersion = serviceVersion;
        this.service =
                RestProxy.create(NotificationHubsClientService.class, this.httpPipeline, this.getSerializerAdapter());
    }

    /**
     * The interface defining all the services for NotificationHubsClient to be used by the proxy service to perform
     * REST calls.
     */
    @Host("https://{namespaceName}.servicebus.windows.net/{hubName}")
    @ServiceInterface(name = "NotificationHubsClie")
    public interface NotificationHubsClientService {
        @Get("/installations/installation/{installationId}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<BinaryData>> getInstallation(
                @HostParam("namespaceName") String namespaceName,
                @HostParam("hubName") String hubName,
                @QueryParam("api-version") String apiVersion,
                @PathParam("installationId") String installationId,
                @HeaderParam("accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Delete("/installations/installation/{installationId}")
        @ExpectedResponses({204})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<Void>> deleteInstallation(
                @HostParam("namespaceName") String namespaceName,
                @HostParam("hubName") String hubName,
                @QueryParam("api-version") String apiVersion,
                @PathParam("installationId") String installationId,
                @HeaderParam("accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Put("/installations/installation/{installationId}")
        @ExpectedResponses({200, 201})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<BinaryData>> createOrUpdateInstallation(
                @HostParam("namespaceName") String namespaceName,
                @HostParam("hubName") String hubName,
                @QueryParam("api-version") String apiVersion,
                @PathParam("installationId") String installationId,
                @HeaderParam("accept") String accept,
                @BodyParam("application/json") BinaryData resource,
                RequestOptions requestOptions,
                Context context);

        @Patch("/installations/{installationId}")
        @ExpectedResponses({201})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<BinaryData>> updateInstallation(
                @HostParam("namespaceName") String namespaceName,
                @HostParam("hubName") String hubName,
                @PathParam("installationId") String installationId,
                @HeaderParam("accept") String accept,
                @BodyParam("application/json") BinaryData updates,
                RequestOptions requestOptions,
                Context context);

        @Post("/messages")
        @ExpectedResponses({201})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<BinaryData>> sendNotification(
                @HostParam("namespaceName") String namespaceName,
                @HostParam("hubName") String hubName,
                @HeaderParam("Content-Type") String contentType,
                @QueryParam("test") boolean test,
                @HeaderParam("ServiceBusNotification-Format") String platform,
                @HeaderParam("accept") String accept,
                @BodyParam("application/json") BinaryData notification,
                RequestOptions requestOptions,
                Context context);

        @Delete("/schedulednotifications/{notificationId}")
        @ExpectedResponses({201})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<BinaryData>> cancelNotification(
                @HostParam("namespaceName") String namespaceName,
                @HostParam("hubName") String hubName,
                @PathParam("notificationId") String notificationId,
                @HeaderParam("accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Post("/schedulednotifications")
        @ExpectedResponses({201})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<BinaryData>> scheduleNotification(
                @HostParam("namespaceName") String namespaceName,
                @HostParam("hubName") String hubName,
                @HeaderParam("Content-Type") String contentType,
                @HeaderParam("ServiceBusNotification-Format") String platform,
                @HeaderParam("ServiceBusNotification-ScheduleTime") String scheduleTime,
                @HeaderParam("accept") String accept,
                @BodyParam("application/json") BinaryData notification,
                RequestOptions requestOptions,
                Context context);

        @Get("/feedbackcontainer")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<BinaryData>> getFeedbackContainerUrl(
                @HostParam("namespaceName") String namespaceName,
                @HostParam("hubName") String hubName,
                @HeaderParam("accept") String accept,
                RequestOptions requestOptions,
                Context context);
    }

    /**
     * Gets an Azure Notification Hubs installation by Installation ID.
     *
     * <p>Get an installation by ID.
     *
     * <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 installation by ID along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> getInstallationWithResponseAsync(
            String installationId, RequestOptions requestOptions) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.getInstallation(
                                this.getNamespaceName(),
                                this.getHubName(),
                                this.getServiceVersion().getVersion(),
                                installationId,
                                accept,
                                requestOptions,
                                context));
    }

    /**
     * Gets an Azure Notification Hubs installation by Installation ID.
     *
     * <p>Get an installation by ID.
     *
     * <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 installation by ID along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> getInstallationWithResponse(String installationId, RequestOptions requestOptions) {
        return getInstallationWithResponseAsync(installationId, requestOptions).block();
    }

    /**
     * Delete an installation by ID.
     *
     * @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}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<Void>> deleteInstallationWithResponseAsync(
            String installationId, RequestOptions requestOptions) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.deleteInstallation(
                                this.getNamespaceName(),
                                this.getHubName(),
                                this.getServiceVersion().getVersion(),
                                installationId,
                                accept,
                                requestOptions,
                                context));
    }

    /**
     * Delete an installation by ID.
     *
     * @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}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> deleteInstallationWithResponse(String installationId, RequestOptions requestOptions) {
        return deleteInstallationWithResponseAsync(installationId, requestOptions).block();
    }

    /**
     * Creates or overwrites an existing installation in the Notification Hub.
     *
     * <p>Creates or updates an 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>
     *
     * <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 resource The resource instance.
     * @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 represents an Azure Notification Hubs Installation along with {@link Response} on successful completion
     *     of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> createOrUpdateInstallationWithResponseAsync(
            String installationId, BinaryData resource, RequestOptions requestOptions) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.createOrUpdateInstallation(
                                this.getNamespaceName(),
                                this.getHubName(),
                                this.getServiceVersion().getVersion(),
                                installationId,
                                accept,
                                resource,
                                requestOptions,
                                context));
    }

    /**
     * Creates or overwrites an existing installation in the Notification Hub.
     *
     * <p>Creates or updates an 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>
     *
     * <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 resource The resource instance.
     * @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 represents an Azure Notification Hubs Installation along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> createOrUpdateInstallationWithResponse(
            String installationId, BinaryData resource, RequestOptions requestOptions) {
        return createOrUpdateInstallationWithResponseAsync(installationId, resource, requestOptions).block();
    }

    /**
     * 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>
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * String
     * }</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 response body along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> updateInstallationWithResponseAsync(
            String installationId, BinaryData updates, RequestOptions requestOptions) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.updateInstallation(
                                this.getNamespaceName(),
                                this.getHubName(),
                                installationId,
                                accept,
                                updates,
                                requestOptions,
                                context));
    }

    /**
     * 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>
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * String
     * }</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 response body along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> updateInstallationWithResponse(
            String installationId, BinaryData updates, RequestOptions requestOptions) {
        return updateInstallationWithResponseAsync(installationId, updates, requestOptions).block();
    }

    /**
     * Send a notification using Azure Notification Hubs.
     *
     * <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>direct</td><td>Boolean</td><td>No</td><td>Direct send operation</td></tr>
     * </table>
     *
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     *
     * <p><strong>Header Parameters</strong>
     *
     * <table border="1">
     *     <caption>Header Parameters</caption>
     *     <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
     *     <tr><td>ServiceBusNotification-DeviceHandle</td><td>String</td><td>No</td><td>The notification target device handle</td></tr>
     *     <tr><td>ServiceBusNotification-Tags</td><td>String</td><td>No</td><td>The notification target tag expression</td></tr>
     * </table>
     *
     * You can add these to a request with {@link RequestOptions#addHeader}
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * String
     * }</pre>
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * String
     * }</pre>
     *
     * @param contentType Content-Type header for the request. Allowed values: "application/json;charset=utf-8",
     *     "application/xml;charset=utf-8", "application/octet-stream".
     * @param test Enables test send for debug purposes.
     * @param platform The notification target platform.
     * @param notification The notification to send.
     * @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 response body along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> sendNotificationWithResponseAsync(
            String contentType, boolean test, String platform, BinaryData notification, RequestOptions requestOptions) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.sendNotification(
                                this.getNamespaceName(),
                                this.getHubName(),
                                contentType,
                                test,
                                platform,
                                accept,
                                notification,
                                requestOptions,
                                context));
    }

    /**
     * Send a notification using Azure Notification Hubs.
     *
     * <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>direct</td><td>Boolean</td><td>No</td><td>Direct send operation</td></tr>
     * </table>
     *
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     *
     * <p><strong>Header Parameters</strong>
     *
     * <table border="1">
     *     <caption>Header Parameters</caption>
     *     <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
     *     <tr><td>ServiceBusNotification-DeviceHandle</td><td>String</td><td>No</td><td>The notification target device handle</td></tr>
     *     <tr><td>ServiceBusNotification-Tags</td><td>String</td><td>No</td><td>The notification target tag expression</td></tr>
     * </table>
     *
     * You can add these to a request with {@link RequestOptions#addHeader}
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * String
     * }</pre>
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * String
     * }</pre>
     *
     * @param contentType Content-Type header for the request. Allowed values: "application/json;charset=utf-8",
     *     "application/xml;charset=utf-8", "application/octet-stream".
     * @param test Enables test send for debug purposes.
     * @param platform The notification target platform.
     * @param notification The notification to send.
     * @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 response body along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> sendNotificationWithResponse(
            String contentType, boolean test, String platform, BinaryData notification, RequestOptions requestOptions) {
        return sendNotificationWithResponseAsync(contentType, test, platform, notification, requestOptions).block();
    }

    /**
     * Cancel a scheduled notification.
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * String
     * }</pre>
     *
     * @param notificationId The ID of the notification to cancel.
     * @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 response body along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> cancelNotificationWithResponseAsync(
            String notificationId, RequestOptions requestOptions) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.cancelNotification(
                                this.getNamespaceName(),
                                this.getHubName(),
                                notificationId,
                                accept,
                                requestOptions,
                                context));
    }

    /**
     * Cancel a scheduled notification.
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * String
     * }</pre>
     *
     * @param notificationId The ID of the notification to cancel.
     * @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 response body along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> cancelNotificationWithResponse(String notificationId, RequestOptions requestOptions) {
        return cancelNotificationWithResponseAsync(notificationId, requestOptions).block();
    }

    /**
     * Schedule a notification.
     *
     * <p><strong>Header Parameters</strong>
     *
     * <table border="1">
     *     <caption>Header Parameters</caption>
     *     <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
     *     <tr><td>ServiceBusNotification-DeviceHandle</td><td>String</td><td>No</td><td>The notification target device handle</td></tr>
     *     <tr><td>ServiceBusNotification-Tags</td><td>String</td><td>No</td><td>The notification target tag expression</td></tr>
     * </table>
     *
     * You can add these to a request with {@link RequestOptions#addHeader}
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * String
     * }</pre>
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * String
     * }</pre>
     *
     * @param contentType Content-Type header for the request. Allowed values: "application/json;charset=utf-8",
     *     "application/xml;charset=utf-8", "application/octet-stream".
     * @param platform The notification target platform.
     * @param scheduleTime The notification schedule time.
     * @param notification The notification to send.
     * @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 response body along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> scheduleNotificationWithResponseAsync(
            String contentType,
            String platform,
            String scheduleTime,
            BinaryData notification,
            RequestOptions requestOptions) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.scheduleNotification(
                                this.getNamespaceName(),
                                this.getHubName(),
                                contentType,
                                platform,
                                scheduleTime,
                                accept,
                                notification,
                                requestOptions,
                                context));
    }

    /**
     * Schedule a notification.
     *
     * <p><strong>Header Parameters</strong>
     *
     * <table border="1">
     *     <caption>Header Parameters</caption>
     *     <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
     *     <tr><td>ServiceBusNotification-DeviceHandle</td><td>String</td><td>No</td><td>The notification target device handle</td></tr>
     *     <tr><td>ServiceBusNotification-Tags</td><td>String</td><td>No</td><td>The notification target tag expression</td></tr>
     * </table>
     *
     * You can add these to a request with {@link RequestOptions#addHeader}
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * String
     * }</pre>
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * String
     * }</pre>
     *
     * @param contentType Content-Type header for the request. Allowed values: "application/json;charset=utf-8",
     *     "application/xml;charset=utf-8", "application/octet-stream".
     * @param platform The notification target platform.
     * @param scheduleTime The notification schedule time.
     * @param notification The notification to send.
     * @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 response body along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> scheduleNotificationWithResponse(
            String contentType,
            String platform,
            String scheduleTime,
            BinaryData notification,
            RequestOptions requestOptions) {
        return scheduleNotificationWithResponseAsync(contentType, platform, scheduleTime, notification, requestOptions)
                .block();
    }

    /**
     * Get the feedback for a notification hub.
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * String
     * }</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 the feedback for a notification hub along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> getFeedbackContainerUrlWithResponseAsync(RequestOptions requestOptions) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.getFeedbackContainerUrl(
                                this.getNamespaceName(), this.getHubName(), accept, requestOptions, context));
    }

    /**
     * Get the feedback for a notification hub.
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * String
     * }</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 the feedback for a notification hub along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> getFeedbackContainerUrlWithResponse(RequestOptions requestOptions) {
        return getFeedbackContainerUrlWithResponseAsync(requestOptions).block();
    }
}
