// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.data.appconfiguration.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.Head;
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.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.HttpResponseException;
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.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.ResponseBase;
import com.azure.core.http.rest.RestProxy;
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.azure.data.appconfiguration.implementation.models.CheckKeyValueHeaders;
import com.azure.data.appconfiguration.implementation.models.CheckKeyValuesHeaders;
import com.azure.data.appconfiguration.implementation.models.CheckKeysHeaders;
import com.azure.data.appconfiguration.implementation.models.CheckLabelsHeaders;
import com.azure.data.appconfiguration.implementation.models.CheckRevisionsHeaders;
import com.azure.data.appconfiguration.implementation.models.CheckSnapshotHeaders;
import com.azure.data.appconfiguration.implementation.models.CheckSnapshotsHeaders;
import com.azure.data.appconfiguration.implementation.models.CreateSnapshotHeaders;
import com.azure.data.appconfiguration.implementation.models.DeleteKeyValueHeaders;
import com.azure.data.appconfiguration.implementation.models.DeleteLockHeaders;
import com.azure.data.appconfiguration.implementation.models.GetKeyValueHeaders;
import com.azure.data.appconfiguration.implementation.models.GetKeyValuesHeaders;
import com.azure.data.appconfiguration.implementation.models.GetKeyValuesNextHeaders;
import com.azure.data.appconfiguration.implementation.models.GetKeysHeaders;
import com.azure.data.appconfiguration.implementation.models.GetKeysNextHeaders;
import com.azure.data.appconfiguration.implementation.models.GetLabelsHeaders;
import com.azure.data.appconfiguration.implementation.models.GetLabelsNextHeaders;
import com.azure.data.appconfiguration.implementation.models.GetRevisionsHeaders;
import com.azure.data.appconfiguration.implementation.models.GetRevisionsNextHeaders;
import com.azure.data.appconfiguration.implementation.models.GetSnapshotHeaders;
import com.azure.data.appconfiguration.implementation.models.GetSnapshotsHeaders;
import com.azure.data.appconfiguration.implementation.models.GetSnapshotsNextHeaders;
import com.azure.data.appconfiguration.implementation.models.Key;
import com.azure.data.appconfiguration.implementation.models.KeyListResult;
import com.azure.data.appconfiguration.implementation.models.KeyValue;
import com.azure.data.appconfiguration.implementation.models.KeyValueListResult;
import com.azure.data.appconfiguration.implementation.models.Label;
import com.azure.data.appconfiguration.implementation.models.LabelFields;
import com.azure.data.appconfiguration.implementation.models.LabelListResult;
import com.azure.data.appconfiguration.implementation.models.OperationDetails;
import com.azure.data.appconfiguration.implementation.models.PutKeyValueHeaders;
import com.azure.data.appconfiguration.implementation.models.PutLockHeaders;
import com.azure.data.appconfiguration.implementation.models.SnapshotFields;
import com.azure.data.appconfiguration.implementation.models.SnapshotListResult;
import com.azure.data.appconfiguration.implementation.models.SnapshotUpdateParameters;
import com.azure.data.appconfiguration.implementation.models.UpdateSnapshotHeaders;
import com.azure.data.appconfiguration.models.ConfigurationSettingSnapshot;
import com.azure.data.appconfiguration.models.SettingFields;
import com.azure.data.appconfiguration.models.SnapshotStatus;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import reactor.core.publisher.Mono;

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

    /** Used to guarantee real-time consistency between requests. */
    private final String syncToken;

    /**
     * Gets Used to guarantee real-time consistency between requests.
     *
     * @return the syncToken value.
     */
    public String getSyncToken() {
        return this.syncToken;
    }

    /** The endpoint of the App Configuration instance to send requests to. */
    private final String endpoint;

    /**
     * Gets The endpoint of the App Configuration instance to send requests to.
     *
     * @return the endpoint value.
     */
    public String getEndpoint() {
        return this.endpoint;
    }

    /** Api Version. */
    private final String apiVersion;

    /**
     * Gets Api Version.
     *
     * @return the apiVersion value.
     */
    public String getApiVersion() {
        return this.apiVersion;
    }

    /** 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 AzureAppConfiguration client.
     *
     * @param syncToken Used to guarantee real-time consistency between requests.
     * @param endpoint The endpoint of the App Configuration instance to send requests to.
     * @param apiVersion Api Version.
     */
    public AzureAppConfigurationImpl(String syncToken, String endpoint, String apiVersion) {
        this(
                new HttpPipelineBuilder()
                        .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy())
                        .build(),
                JacksonAdapter.createDefaultSerializerAdapter(),
                syncToken,
                endpoint,
                apiVersion);
    }

    /**
     * Initializes an instance of AzureAppConfiguration client.
     *
     * @param httpPipeline The HTTP pipeline to send requests through.
     * @param syncToken Used to guarantee real-time consistency between requests.
     * @param endpoint The endpoint of the App Configuration instance to send requests to.
     * @param apiVersion Api Version.
     */
    public AzureAppConfigurationImpl(HttpPipeline httpPipeline, String syncToken, String endpoint, String apiVersion) {
        this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), syncToken, endpoint, apiVersion);
    }

    /**
     * Initializes an instance of AzureAppConfiguration client.
     *
     * @param httpPipeline The HTTP pipeline to send requests through.
     * @param serializerAdapter The serializer to serialize an object into a string.
     * @param syncToken Used to guarantee real-time consistency between requests.
     * @param endpoint The endpoint of the App Configuration instance to send requests to.
     * @param apiVersion Api Version.
     */
    public AzureAppConfigurationImpl(
            HttpPipeline httpPipeline,
            SerializerAdapter serializerAdapter,
            String syncToken,
            String endpoint,
            String apiVersion) {
        this.httpPipeline = httpPipeline;
        this.serializerAdapter = serializerAdapter;
        this.syncToken = syncToken;
        this.endpoint = endpoint;
        this.apiVersion = apiVersion;
        this.service =
                RestProxy.create(AzureAppConfigurationService.class, this.httpPipeline, this.getSerializerAdapter());
    }

    /**
     * The interface defining all the services for AzureAppConfiguration to be used by the proxy service to perform REST
     * calls.
     */
    @Host("{endpoint}")
    @ServiceInterface(name = "AzureAppConfiguratio")
    public interface AzureAppConfigurationService {
        @Get("/keys")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<GetKeysHeaders, KeyListResult>> getKeys(
                @HostParam("endpoint") String endpoint,
                @QueryParam("name") String name,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("After") String after,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("/keys")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<GetKeysHeaders, KeyListResult> getKeysSync(
                @HostParam("endpoint") String endpoint,
                @QueryParam("name") String name,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("After") String after,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @HeaderParam("Accept") String accept,
                Context context);

        @Head("/keys")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<CheckKeysHeaders, Void>> checkKeys(
                @HostParam("endpoint") String endpoint,
                @QueryParam("name") String name,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("After") String after,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                Context context);

        @Head("/keys")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<CheckKeysHeaders, Void> checkKeysSync(
                @HostParam("endpoint") String endpoint,
                @QueryParam("name") String name,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("After") String after,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                Context context);

        @Get("/kv")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<GetKeyValuesHeaders, KeyValueListResult>> getKeyValues(
                @HostParam("endpoint") String endpoint,
                @QueryParam("key") String key,
                @QueryParam("label") String label,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("After") String after,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @QueryParam("$Select") String select,
                @QueryParam("snapshot") String snapshot,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("/kv")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<GetKeyValuesHeaders, KeyValueListResult> getKeyValuesSync(
                @HostParam("endpoint") String endpoint,
                @QueryParam("key") String key,
                @QueryParam("label") String label,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("After") String after,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @QueryParam("$Select") String select,
                @QueryParam("snapshot") String snapshot,
                @HeaderParam("Accept") String accept,
                Context context);

        @Head("/kv")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<CheckKeyValuesHeaders, Void>> checkKeyValues(
                @HostParam("endpoint") String endpoint,
                @QueryParam("key") String key,
                @QueryParam("label") String label,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("After") String after,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @QueryParam("$Select") String select,
                @QueryParam("snapshot") String snapshot,
                Context context);

        @Head("/kv")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<CheckKeyValuesHeaders, Void> checkKeyValuesSync(
                @HostParam("endpoint") String endpoint,
                @QueryParam("key") String key,
                @QueryParam("label") String label,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("After") String after,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @QueryParam("$Select") String select,
                @QueryParam("snapshot") String snapshot,
                Context context);

        @Get("/kv/{key}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<GetKeyValueHeaders, KeyValue>> getKeyValue(
                @HostParam("endpoint") String endpoint,
                @PathParam("key") String key,
                @QueryParam("label") String label,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @HeaderParam("If-Match") String ifMatch,
                @HeaderParam("If-None-Match") String ifNoneMatch,
                @QueryParam("$Select") String select,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("/kv/{key}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<GetKeyValueHeaders, KeyValue> getKeyValueSync(
                @HostParam("endpoint") String endpoint,
                @PathParam("key") String key,
                @QueryParam("label") String label,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @HeaderParam("If-Match") String ifMatch,
                @HeaderParam("If-None-Match") String ifNoneMatch,
                @QueryParam("$Select") String select,
                @HeaderParam("Accept") String accept,
                Context context);

        @Put("/kv/{key}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<PutKeyValueHeaders, KeyValue>> putKeyValue(
                @HostParam("endpoint") String endpoint,
                @PathParam("key") String key,
                @QueryParam("label") String label,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("If-Match") String ifMatch,
                @HeaderParam("If-None-Match") String ifNoneMatch,
                @BodyParam("application/json") KeyValue entity,
                @HeaderParam("Accept") String accept,
                Context context);

        @Put("/kv/{key}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<PutKeyValueHeaders, KeyValue> putKeyValueSync(
                @HostParam("endpoint") String endpoint,
                @PathParam("key") String key,
                @QueryParam("label") String label,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("If-Match") String ifMatch,
                @HeaderParam("If-None-Match") String ifNoneMatch,
                @BodyParam("application/json") KeyValue entity,
                @HeaderParam("Accept") String accept,
                Context context);

        @Delete("/kv/{key}")
        @ExpectedResponses({200, 204})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<DeleteKeyValueHeaders, KeyValue>> deleteKeyValue(
                @HostParam("endpoint") String endpoint,
                @PathParam("key") String key,
                @QueryParam("label") String label,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("If-Match") String ifMatch,
                @HeaderParam("Accept") String accept,
                Context context);

        @Delete("/kv/{key}")
        @ExpectedResponses({200, 204})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<DeleteKeyValueHeaders, KeyValue> deleteKeyValueSync(
                @HostParam("endpoint") String endpoint,
                @PathParam("key") String key,
                @QueryParam("label") String label,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("If-Match") String ifMatch,
                @HeaderParam("Accept") String accept,
                Context context);

        @Head("/kv/{key}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<CheckKeyValueHeaders, Void>> checkKeyValue(
                @HostParam("endpoint") String endpoint,
                @PathParam("key") String key,
                @QueryParam("label") String label,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @HeaderParam("If-Match") String ifMatch,
                @HeaderParam("If-None-Match") String ifNoneMatch,
                @QueryParam("$Select") String select,
                Context context);

        @Head("/kv/{key}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<CheckKeyValueHeaders, Void> checkKeyValueSync(
                @HostParam("endpoint") String endpoint,
                @PathParam("key") String key,
                @QueryParam("label") String label,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @HeaderParam("If-Match") String ifMatch,
                @HeaderParam("If-None-Match") String ifNoneMatch,
                @QueryParam("$Select") String select,
                Context context);

        @Get("/snapshots")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<GetSnapshotsHeaders, SnapshotListResult>> getSnapshots(
                @HostParam("endpoint") String endpoint,
                @QueryParam("name") String name,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("After") String after,
                @QueryParam("$Select") String select,
                @QueryParam("Status") String status,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("/snapshots")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<GetSnapshotsHeaders, SnapshotListResult> getSnapshotsSync(
                @HostParam("endpoint") String endpoint,
                @QueryParam("name") String name,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("After") String after,
                @QueryParam("$Select") String select,
                @QueryParam("Status") String status,
                @HeaderParam("Accept") String accept,
                Context context);

        @Head("/snapshots")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<CheckSnapshotsHeaders, Void>> checkSnapshots(
                @HostParam("endpoint") String endpoint,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("After") String after,
                Context context);

        @Head("/snapshots")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<CheckSnapshotsHeaders, Void> checkSnapshotsSync(
                @HostParam("endpoint") String endpoint,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("After") String after,
                Context context);

        @Get("/snapshots/{name}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<GetSnapshotHeaders, ConfigurationSettingSnapshot>> getSnapshot(
                @HostParam("endpoint") String endpoint,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @PathParam("name") String name,
                @HeaderParam("If-Match") String ifMatch,
                @HeaderParam("If-None-Match") String ifNoneMatch,
                @QueryParam("$Select") String select,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("/snapshots/{name}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<GetSnapshotHeaders, ConfigurationSettingSnapshot> getSnapshotSync(
                @HostParam("endpoint") String endpoint,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @PathParam("name") String name,
                @HeaderParam("If-Match") String ifMatch,
                @HeaderParam("If-None-Match") String ifNoneMatch,
                @QueryParam("$Select") String select,
                @HeaderParam("Accept") String accept,
                Context context);

        @Put("/snapshots/{name}")
        @ExpectedResponses({201})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<CreateSnapshotHeaders, ConfigurationSettingSnapshot>> createSnapshot(
                @HostParam("endpoint") String endpoint,
                @PathParam("name") String name,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @BodyParam("application/json") ConfigurationSettingSnapshot entity,
                @HeaderParam("Accept") String accept,
                Context context);

        @Put("/snapshots/{name}")
        @ExpectedResponses({201})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<CreateSnapshotHeaders, ConfigurationSettingSnapshot> createSnapshotSync(
                @HostParam("endpoint") String endpoint,
                @PathParam("name") String name,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @BodyParam("application/json") ConfigurationSettingSnapshot entity,
                @HeaderParam("Accept") String accept,
                Context context);

        @Patch("/snapshots/{name}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<UpdateSnapshotHeaders, ConfigurationSettingSnapshot>> updateSnapshot(
                @HostParam("endpoint") String endpoint,
                @PathParam("name") String name,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("If-Match") String ifMatch,
                @HeaderParam("If-None-Match") String ifNoneMatch,
                @BodyParam("application/json") SnapshotUpdateParameters entity,
                @HeaderParam("Accept") String accept,
                Context context);

        @Patch("/snapshots/{name}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<UpdateSnapshotHeaders, ConfigurationSettingSnapshot> updateSnapshotSync(
                @HostParam("endpoint") String endpoint,
                @PathParam("name") String name,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("If-Match") String ifMatch,
                @HeaderParam("If-None-Match") String ifNoneMatch,
                @BodyParam("application/json") SnapshotUpdateParameters entity,
                @HeaderParam("Accept") String accept,
                Context context);

        @Head("/snapshots/{name}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<CheckSnapshotHeaders, Void>> checkSnapshot(
                @HostParam("endpoint") String endpoint,
                @PathParam("name") String name,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("If-Match") String ifMatch,
                @HeaderParam("If-None-Match") String ifNoneMatch,
                Context context);

        @Head("/snapshots/{name}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<CheckSnapshotHeaders, Void> checkSnapshotSync(
                @HostParam("endpoint") String endpoint,
                @PathParam("name") String name,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("If-Match") String ifMatch,
                @HeaderParam("If-None-Match") String ifNoneMatch,
                Context context);

        @Get("/labels")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<GetLabelsHeaders, LabelListResult>> getLabels(
                @HostParam("endpoint") String endpoint,
                @QueryParam("name") String name,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("After") String after,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @QueryParam("$Select") String select,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("/labels")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<GetLabelsHeaders, LabelListResult> getLabelsSync(
                @HostParam("endpoint") String endpoint,
                @QueryParam("name") String name,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("After") String after,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @QueryParam("$Select") String select,
                @HeaderParam("Accept") String accept,
                Context context);

        @Head("/labels")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<CheckLabelsHeaders, Void>> checkLabels(
                @HostParam("endpoint") String endpoint,
                @QueryParam("name") String name,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("After") String after,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @QueryParam("$Select") String select,
                Context context);

        @Head("/labels")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<CheckLabelsHeaders, Void> checkLabelsSync(
                @HostParam("endpoint") String endpoint,
                @QueryParam("name") String name,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("After") String after,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @QueryParam("$Select") String select,
                Context context);

        @Put("/locks/{key}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<PutLockHeaders, KeyValue>> putLock(
                @HostParam("endpoint") String endpoint,
                @PathParam("key") String key,
                @QueryParam("label") String label,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("If-Match") String ifMatch,
                @HeaderParam("If-None-Match") String ifNoneMatch,
                @HeaderParam("Accept") String accept,
                Context context);

        @Put("/locks/{key}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<PutLockHeaders, KeyValue> putLockSync(
                @HostParam("endpoint") String endpoint,
                @PathParam("key") String key,
                @QueryParam("label") String label,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("If-Match") String ifMatch,
                @HeaderParam("If-None-Match") String ifNoneMatch,
                @HeaderParam("Accept") String accept,
                Context context);

        @Delete("/locks/{key}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<DeleteLockHeaders, KeyValue>> deleteLock(
                @HostParam("endpoint") String endpoint,
                @PathParam("key") String key,
                @QueryParam("label") String label,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("If-Match") String ifMatch,
                @HeaderParam("If-None-Match") String ifNoneMatch,
                @HeaderParam("Accept") String accept,
                Context context);

        @Delete("/locks/{key}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<DeleteLockHeaders, KeyValue> deleteLockSync(
                @HostParam("endpoint") String endpoint,
                @PathParam("key") String key,
                @QueryParam("label") String label,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("If-Match") String ifMatch,
                @HeaderParam("If-None-Match") String ifNoneMatch,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("/revisions")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<GetRevisionsHeaders, KeyValueListResult>> getRevisions(
                @HostParam("endpoint") String endpoint,
                @QueryParam("key") String key,
                @QueryParam("label") String label,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("After") String after,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @QueryParam("$Select") String select,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("/revisions")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<GetRevisionsHeaders, KeyValueListResult> getRevisionsSync(
                @HostParam("endpoint") String endpoint,
                @QueryParam("key") String key,
                @QueryParam("label") String label,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("After") String after,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @QueryParam("$Select") String select,
                @HeaderParam("Accept") String accept,
                Context context);

        @Head("/revisions")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<CheckRevisionsHeaders, Void>> checkRevisions(
                @HostParam("endpoint") String endpoint,
                @QueryParam("key") String key,
                @QueryParam("label") String label,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("After") String after,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @QueryParam("$Select") String select,
                Context context);

        @Head("/revisions")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<CheckRevisionsHeaders, Void> checkRevisionsSync(
                @HostParam("endpoint") String endpoint,
                @QueryParam("key") String key,
                @QueryParam("label") String label,
                @HeaderParam("Sync-Token") String syncToken,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("After") String after,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @QueryParam("$Select") String select,
                Context context);

        @Get("/operations")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<OperationDetails>> getOperationDetails(
                @HostParam("endpoint") String endpoint,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("snapshot") String snapshot,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("/operations")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Response<OperationDetails> getOperationDetailsSync(
                @HostParam("endpoint") String endpoint,
                @QueryParam("api-version") String apiVersion,
                @QueryParam("snapshot") String snapshot,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<GetKeysNextHeaders, KeyListResult>> getKeysNext(
                @PathParam(value = "nextLink", encoded = true) String nextLink,
                @HostParam("endpoint") String endpoint,
                @HeaderParam("Sync-Token") String syncToken,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<GetKeysNextHeaders, KeyListResult> getKeysNextSync(
                @PathParam(value = "nextLink", encoded = true) String nextLink,
                @HostParam("endpoint") String endpoint,
                @HeaderParam("Sync-Token") String syncToken,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<GetKeyValuesNextHeaders, KeyValueListResult>> getKeyValuesNext(
                @PathParam(value = "nextLink", encoded = true) String nextLink,
                @HostParam("endpoint") String endpoint,
                @HeaderParam("Sync-Token") String syncToken,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<GetKeyValuesNextHeaders, KeyValueListResult> getKeyValuesNextSync(
                @PathParam(value = "nextLink", encoded = true) String nextLink,
                @HostParam("endpoint") String endpoint,
                @HeaderParam("Sync-Token") String syncToken,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<GetSnapshotsNextHeaders, SnapshotListResult>> getSnapshotsNext(
                @PathParam(value = "nextLink", encoded = true) String nextLink,
                @HostParam("endpoint") String endpoint,
                @HeaderParam("Sync-Token") String syncToken,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<GetSnapshotsNextHeaders, SnapshotListResult> getSnapshotsNextSync(
                @PathParam(value = "nextLink", encoded = true) String nextLink,
                @HostParam("endpoint") String endpoint,
                @HeaderParam("Sync-Token") String syncToken,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<GetLabelsNextHeaders, LabelListResult>> getLabelsNext(
                @PathParam(value = "nextLink", encoded = true) String nextLink,
                @HostParam("endpoint") String endpoint,
                @HeaderParam("Sync-Token") String syncToken,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<GetLabelsNextHeaders, LabelListResult> getLabelsNextSync(
                @PathParam(value = "nextLink", encoded = true) String nextLink,
                @HostParam("endpoint") String endpoint,
                @HeaderParam("Sync-Token") String syncToken,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<ResponseBase<GetRevisionsNextHeaders, KeyValueListResult>> getRevisionsNext(
                @PathParam(value = "nextLink", encoded = true) String nextLink,
                @HostParam("endpoint") String endpoint,
                @HeaderParam("Sync-Token") String syncToken,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        ResponseBase<GetRevisionsNextHeaders, KeyValueListResult> getRevisionsNextSync(
                @PathParam(value = "nextLink", encoded = true) String nextLink,
                @HostParam("endpoint") String endpoint,
                @HeaderParam("Sync-Token") String syncToken,
                @HeaderParam("Accept-Datetime") String acceptDatetime,
                @HeaderParam("Accept") String accept,
                Context context);
    }

    /**
     * Gets a list of keys.
     *
     * @param name A filter for the name of the returned keys.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of keys along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PagedResponse<Key>> getKeysSinglePageAsync(String name, String after, String acceptDatetime) {
        final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json";
        return FluxUtil.withContext(
                        context ->
                                service.getKeys(
                                        this.getEndpoint(),
                                        name,
                                        this.getSyncToken(),
                                        this.getApiVersion(),
                                        after,
                                        acceptDatetime,
                                        accept,
                                        context))
                .map(
                        res ->
                                new PagedResponseBase<>(
                                        res.getRequest(),
                                        res.getStatusCode(),
                                        res.getHeaders(),
                                        res.getValue().getItems(),
                                        res.getValue().getNextLink(),
                                        res.getDeserializedHeaders()));
    }

    /**
     * Gets a list of keys.
     *
     * @param name A filter for the name of the returned keys.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of keys along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PagedResponse<Key>> getKeysSinglePageAsync(
            String name, String after, String acceptDatetime, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json";
        return service.getKeys(
                        this.getEndpoint(),
                        name,
                        this.getSyncToken(),
                        this.getApiVersion(),
                        after,
                        acceptDatetime,
                        accept,
                        context)
                .map(
                        res ->
                                new PagedResponseBase<>(
                                        res.getRequest(),
                                        res.getStatusCode(),
                                        res.getHeaders(),
                                        res.getValue().getItems(),
                                        res.getValue().getNextLink(),
                                        res.getDeserializedHeaders()));
    }

    /**
     * Gets a list of keys.
     *
     * @param name A filter for the name of the returned keys.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of keys as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<Key> getKeysAsync(String name, String after, String acceptDatetime) {
        return new PagedFlux<>(
                () -> getKeysSinglePageAsync(name, after, acceptDatetime),
                nextLink -> getKeysNextSinglePageAsync(nextLink, acceptDatetime));
    }

    /**
     * Gets a list of keys.
     *
     * @param name A filter for the name of the returned keys.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of keys as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<Key> getKeysAsync(String name, String after, String acceptDatetime, Context context) {
        return new PagedFlux<>(
                () -> getKeysSinglePageAsync(name, after, acceptDatetime, context),
                nextLink -> getKeysNextSinglePageAsync(nextLink, acceptDatetime, context));
    }

    /**
     * Gets a list of keys.
     *
     * @param name A filter for the name of the returned keys.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of keys along with {@link PagedResponse}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PagedResponse<Key> getKeysSinglePage(String name, String after, String acceptDatetime) {
        final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json";
        ResponseBase<GetKeysHeaders, KeyListResult> res =
                service.getKeysSync(
                        this.getEndpoint(),
                        name,
                        this.getSyncToken(),
                        this.getApiVersion(),
                        after,
                        acceptDatetime,
                        accept,
                        Context.NONE);
        return new PagedResponseBase<>(
                res.getRequest(),
                res.getStatusCode(),
                res.getHeaders(),
                res.getValue().getItems(),
                res.getValue().getNextLink(),
                res.getDeserializedHeaders());
    }

    /**
     * Gets a list of keys.
     *
     * @param name A filter for the name of the returned keys.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of keys along with {@link PagedResponse}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PagedResponse<Key> getKeysSinglePage(String name, String after, String acceptDatetime, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json";
        ResponseBase<GetKeysHeaders, KeyListResult> res =
                service.getKeysSync(
                        this.getEndpoint(),
                        name,
                        this.getSyncToken(),
                        this.getApiVersion(),
                        after,
                        acceptDatetime,
                        accept,
                        context);
        return new PagedResponseBase<>(
                res.getRequest(),
                res.getStatusCode(),
                res.getHeaders(),
                res.getValue().getItems(),
                res.getValue().getNextLink(),
                res.getDeserializedHeaders());
    }

    /**
     * Gets a list of keys.
     *
     * @param name A filter for the name of the returned keys.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of keys as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<Key> getKeys(String name, String after, String acceptDatetime) {
        return new PagedIterable<>(
                () -> getKeysSinglePage(name, after, acceptDatetime, Context.NONE),
                nextLink -> getKeysNextSinglePage(nextLink, acceptDatetime));
    }

    /**
     * Gets a list of keys.
     *
     * @param name A filter for the name of the returned keys.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of keys as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<Key> getKeys(String name, String after, String acceptDatetime, Context context) {
        return new PagedIterable<>(
                () -> getKeysSinglePage(name, after, acceptDatetime, context),
                nextLink -> getKeysNextSinglePage(nextLink, acceptDatetime, context));
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param name A filter for the name of the returned keys.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<CheckKeysHeaders, Void>> checkKeysWithResponseAsync(
            String name, String after, String acceptDatetime) {
        return FluxUtil.withContext(
                context ->
                        service.checkKeys(
                                this.getEndpoint(),
                                name,
                                this.getSyncToken(),
                                this.getApiVersion(),
                                after,
                                acceptDatetime,
                                context));
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param name A filter for the name of the returned keys.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<CheckKeysHeaders, Void>> checkKeysWithResponseAsync(
            String name, String after, String acceptDatetime, Context context) {
        return service.checkKeys(
                this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), after, acceptDatetime, context);
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param name A filter for the name of the returned keys.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> checkKeysAsync(String name, String after, String acceptDatetime) {
        return checkKeysWithResponseAsync(name, after, acceptDatetime).flatMap(ignored -> Mono.empty());
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param name A filter for the name of the returned keys.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> checkKeysAsync(String name, String after, String acceptDatetime, Context context) {
        return checkKeysWithResponseAsync(name, after, acceptDatetime, context).flatMap(ignored -> Mono.empty());
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param name A filter for the name of the returned keys.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ResponseBase<CheckKeysHeaders, Void> checkKeysWithResponse(
            String name, String after, String acceptDatetime, Context context) {
        return service.checkKeysSync(
                this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), after, acceptDatetime, context);
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param name A filter for the name of the returned keys.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void checkKeys(String name, String after, String acceptDatetime) {
        checkKeysWithResponse(name, after, acceptDatetime, Context.NONE);
    }

    /**
     * Gets a list of key-values.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not
     *     valid when used with 'key' and 'label' filters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-values along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PagedResponse<KeyValue>> getKeyValuesSinglePageAsync(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            String snapshot) {
        final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return FluxUtil.withContext(
                        context ->
                                service.getKeyValues(
                                        this.getEndpoint(),
                                        key,
                                        label,
                                        this.getSyncToken(),
                                        this.getApiVersion(),
                                        after,
                                        acceptDatetime,
                                        selectConverted,
                                        snapshot,
                                        accept,
                                        context))
                .map(
                        res ->
                                new PagedResponseBase<>(
                                        res.getRequest(),
                                        res.getStatusCode(),
                                        res.getHeaders(),
                                        res.getValue().getItems(),
                                        res.getValue().getNextLink(),
                                        res.getDeserializedHeaders()));
    }

    /**
     * Gets a list of key-values.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not
     *     valid when used with 'key' and 'label' filters.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-values along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PagedResponse<KeyValue>> getKeyValuesSinglePageAsync(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            String snapshot,
            Context context) {
        final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return service.getKeyValues(
                        this.getEndpoint(),
                        key,
                        label,
                        this.getSyncToken(),
                        this.getApiVersion(),
                        after,
                        acceptDatetime,
                        selectConverted,
                        snapshot,
                        accept,
                        context)
                .map(
                        res ->
                                new PagedResponseBase<>(
                                        res.getRequest(),
                                        res.getStatusCode(),
                                        res.getHeaders(),
                                        res.getValue().getItems(),
                                        res.getValue().getNextLink(),
                                        res.getDeserializedHeaders()));
    }

    /**
     * Gets a list of key-values.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not
     *     valid when used with 'key' and 'label' filters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-values as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<KeyValue> getKeyValuesAsync(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            String snapshot) {
        return new PagedFlux<>(
                () -> getKeyValuesSinglePageAsync(key, label, after, acceptDatetime, select, snapshot),
                nextLink -> getKeyValuesNextSinglePageAsync(nextLink, acceptDatetime));
    }

    /**
     * Gets a list of key-values.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not
     *     valid when used with 'key' and 'label' filters.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-values as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<KeyValue> getKeyValuesAsync(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            String snapshot,
            Context context) {
        return new PagedFlux<>(
                () -> getKeyValuesSinglePageAsync(key, label, after, acceptDatetime, select, snapshot, context),
                nextLink -> getKeyValuesNextSinglePageAsync(nextLink, acceptDatetime, context));
    }

    /**
     * Gets a list of key-values.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not
     *     valid when used with 'key' and 'label' filters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-values along with {@link PagedResponse}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PagedResponse<KeyValue> getKeyValuesSinglePage(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            String snapshot) {
        final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        ResponseBase<GetKeyValuesHeaders, KeyValueListResult> res =
                service.getKeyValuesSync(
                        this.getEndpoint(),
                        key,
                        label,
                        this.getSyncToken(),
                        this.getApiVersion(),
                        after,
                        acceptDatetime,
                        selectConverted,
                        snapshot,
                        accept,
                        Context.NONE);
        return new PagedResponseBase<>(
                res.getRequest(),
                res.getStatusCode(),
                res.getHeaders(),
                res.getValue().getItems(),
                res.getValue().getNextLink(),
                res.getDeserializedHeaders());
    }

    /**
     * Gets a list of key-values.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not
     *     valid when used with 'key' and 'label' filters.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-values along with {@link PagedResponse}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PagedResponse<KeyValue> getKeyValuesSinglePage(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            String snapshot,
            Context context) {
        final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        ResponseBase<GetKeyValuesHeaders, KeyValueListResult> res =
                service.getKeyValuesSync(
                        this.getEndpoint(),
                        key,
                        label,
                        this.getSyncToken(),
                        this.getApiVersion(),
                        after,
                        acceptDatetime,
                        selectConverted,
                        snapshot,
                        accept,
                        context);
        return new PagedResponseBase<>(
                res.getRequest(),
                res.getStatusCode(),
                res.getHeaders(),
                res.getValue().getItems(),
                res.getValue().getNextLink(),
                res.getDeserializedHeaders());
    }

    /**
     * Gets a list of key-values.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not
     *     valid when used with 'key' and 'label' filters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-values as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<KeyValue> getKeyValues(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            String snapshot) {
        return new PagedIterable<>(
                () -> getKeyValuesSinglePage(key, label, after, acceptDatetime, select, snapshot, Context.NONE),
                nextLink -> getKeyValuesNextSinglePage(nextLink, acceptDatetime));
    }

    /**
     * Gets a list of key-values.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not
     *     valid when used with 'key' and 'label' filters.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-values as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<KeyValue> getKeyValues(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            String snapshot,
            Context context) {
        return new PagedIterable<>(
                () -> getKeyValuesSinglePage(key, label, after, acceptDatetime, select, snapshot, context),
                nextLink -> getKeyValuesNextSinglePage(nextLink, acceptDatetime, context));
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param snapshot A filter used get key-values for a snapshot. Not valid when used with 'key' and 'label' filters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<CheckKeyValuesHeaders, Void>> checkKeyValuesWithResponseAsync(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            String snapshot) {
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return FluxUtil.withContext(
                context ->
                        service.checkKeyValues(
                                this.getEndpoint(),
                                key,
                                label,
                                this.getSyncToken(),
                                this.getApiVersion(),
                                after,
                                acceptDatetime,
                                selectConverted,
                                snapshot,
                                context));
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param snapshot A filter used get key-values for a snapshot. Not valid when used with 'key' and 'label' filters.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<CheckKeyValuesHeaders, Void>> checkKeyValuesWithResponseAsync(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            String snapshot,
            Context context) {
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return service.checkKeyValues(
                this.getEndpoint(),
                key,
                label,
                this.getSyncToken(),
                this.getApiVersion(),
                after,
                acceptDatetime,
                selectConverted,
                snapshot,
                context);
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param snapshot A filter used get key-values for a snapshot. Not valid when used with 'key' and 'label' filters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> checkKeyValuesAsync(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            String snapshot) {
        return checkKeyValuesWithResponseAsync(key, label, after, acceptDatetime, select, snapshot)
                .flatMap(ignored -> Mono.empty());
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param snapshot A filter used get key-values for a snapshot. Not valid when used with 'key' and 'label' filters.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> checkKeyValuesAsync(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            String snapshot,
            Context context) {
        return checkKeyValuesWithResponseAsync(key, label, after, acceptDatetime, select, snapshot, context)
                .flatMap(ignored -> Mono.empty());
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param snapshot A filter used get key-values for a snapshot. Not valid when used with 'key' and 'label' filters.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ResponseBase<CheckKeyValuesHeaders, Void> checkKeyValuesWithResponse(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            String snapshot,
            Context context) {
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return service.checkKeyValuesSync(
                this.getEndpoint(),
                key,
                label,
                this.getSyncToken(),
                this.getApiVersion(),
                after,
                acceptDatetime,
                selectConverted,
                snapshot,
                context);
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param snapshot A filter used get key-values for a snapshot. Not valid when used with 'key' and 'label' filters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void checkKeyValues(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            String snapshot) {
        checkKeyValuesWithResponse(key, label, after, acceptDatetime, select, snapshot, Context.NONE);
    }

    /**
     * Gets a single key-value.
     *
     * @param key The key of the key-value to retrieve.
     * @param label The label of the key-value to retrieve.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a single key-value along with {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<GetKeyValueHeaders, KeyValue>> getKeyValueWithResponseAsync(
            String key,
            String label,
            String acceptDatetime,
            String ifMatch,
            String ifNoneMatch,
            List<SettingFields> select) {
        final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return FluxUtil.withContext(
                context ->
                        service.getKeyValue(
                                this.getEndpoint(),
                                key,
                                label,
                                this.getSyncToken(),
                                this.getApiVersion(),
                                acceptDatetime,
                                ifMatch,
                                ifNoneMatch,
                                selectConverted,
                                accept,
                                context));
    }

    /**
     * Gets a single key-value.
     *
     * @param key The key of the key-value to retrieve.
     * @param label The label of the key-value to retrieve.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a single key-value along with {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<GetKeyValueHeaders, KeyValue>> getKeyValueWithResponseAsync(
            String key,
            String label,
            String acceptDatetime,
            String ifMatch,
            String ifNoneMatch,
            List<SettingFields> select,
            Context context) {
        final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return service.getKeyValue(
                this.getEndpoint(),
                key,
                label,
                this.getSyncToken(),
                this.getApiVersion(),
                acceptDatetime,
                ifMatch,
                ifNoneMatch,
                selectConverted,
                accept,
                context);
    }

    /**
     * Gets a single key-value.
     *
     * @param key The key of the key-value to retrieve.
     * @param label The label of the key-value to retrieve.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a single key-value on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<KeyValue> getKeyValueAsync(
            String key,
            String label,
            String acceptDatetime,
            String ifMatch,
            String ifNoneMatch,
            List<SettingFields> select) {
        return getKeyValueWithResponseAsync(key, label, acceptDatetime, ifMatch, ifNoneMatch, select)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Gets a single key-value.
     *
     * @param key The key of the key-value to retrieve.
     * @param label The label of the key-value to retrieve.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a single key-value on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<KeyValue> getKeyValueAsync(
            String key,
            String label,
            String acceptDatetime,
            String ifMatch,
            String ifNoneMatch,
            List<SettingFields> select,
            Context context) {
        return getKeyValueWithResponseAsync(key, label, acceptDatetime, ifMatch, ifNoneMatch, select, context)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Gets a single key-value.
     *
     * @param key The key of the key-value to retrieve.
     * @param label The label of the key-value to retrieve.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a single key-value along with {@link ResponseBase}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ResponseBase<GetKeyValueHeaders, KeyValue> getKeyValueWithResponse(
            String key,
            String label,
            String acceptDatetime,
            String ifMatch,
            String ifNoneMatch,
            List<SettingFields> select,
            Context context) {
        final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return service.getKeyValueSync(
                this.getEndpoint(),
                key,
                label,
                this.getSyncToken(),
                this.getApiVersion(),
                acceptDatetime,
                ifMatch,
                ifNoneMatch,
                selectConverted,
                accept,
                context);
    }

    /**
     * Gets a single key-value.
     *
     * @param key The key of the key-value to retrieve.
     * @param label The label of the key-value to retrieve.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a single key-value.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public KeyValue getKeyValue(
            String key,
            String label,
            String acceptDatetime,
            String ifMatch,
            String ifNoneMatch,
            List<SettingFields> select) {
        return getKeyValueWithResponse(key, label, acceptDatetime, ifMatch, ifNoneMatch, select, Context.NONE)
                .getValue();
    }

    /**
     * Creates a key-value.
     *
     * @param key The key of the key-value to create.
     * @param label The label of the key-value to create.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param entity The key-value to create.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<PutKeyValueHeaders, KeyValue>> putKeyValueWithResponseAsync(
            String key, String label, String ifMatch, String ifNoneMatch, KeyValue entity) {
        final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json";
        return FluxUtil.withContext(
                context ->
                        service.putKeyValue(
                                this.getEndpoint(),
                                key,
                                label,
                                this.getSyncToken(),
                                this.getApiVersion(),
                                ifMatch,
                                ifNoneMatch,
                                entity,
                                accept,
                                context));
    }

    /**
     * Creates a key-value.
     *
     * @param key The key of the key-value to create.
     * @param label The label of the key-value to create.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param entity The key-value to create.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<PutKeyValueHeaders, KeyValue>> putKeyValueWithResponseAsync(
            String key, String label, String ifMatch, String ifNoneMatch, KeyValue entity, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json";
        return service.putKeyValue(
                this.getEndpoint(),
                key,
                label,
                this.getSyncToken(),
                this.getApiVersion(),
                ifMatch,
                ifNoneMatch,
                entity,
                accept,
                context);
    }

    /**
     * Creates a key-value.
     *
     * @param key The key of the key-value to create.
     * @param label The label of the key-value to create.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param entity The key-value to create.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<KeyValue> putKeyValueAsync(
            String key, String label, String ifMatch, String ifNoneMatch, KeyValue entity) {
        return putKeyValueWithResponseAsync(key, label, ifMatch, ifNoneMatch, entity)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Creates a key-value.
     *
     * @param key The key of the key-value to create.
     * @param label The label of the key-value to create.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param entity The key-value to create.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<KeyValue> putKeyValueAsync(
            String key, String label, String ifMatch, String ifNoneMatch, KeyValue entity, Context context) {
        return putKeyValueWithResponseAsync(key, label, ifMatch, ifNoneMatch, entity, context)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Creates a key-value.
     *
     * @param key The key of the key-value to create.
     * @param label The label of the key-value to create.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param entity The key-value to create.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link ResponseBase}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ResponseBase<PutKeyValueHeaders, KeyValue> putKeyValueWithResponse(
            String key, String label, String ifMatch, String ifNoneMatch, KeyValue entity, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json";
        return service.putKeyValueSync(
                this.getEndpoint(),
                key,
                label,
                this.getSyncToken(),
                this.getApiVersion(),
                ifMatch,
                ifNoneMatch,
                entity,
                accept,
                context);
    }

    /**
     * Creates a key-value.
     *
     * @param key The key of the key-value to create.
     * @param label The label of the key-value to create.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param entity The key-value to create.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public KeyValue putKeyValue(String key, String label, String ifMatch, String ifNoneMatch, KeyValue entity) {
        return putKeyValueWithResponse(key, label, ifMatch, ifNoneMatch, entity, Context.NONE).getValue();
    }

    /**
     * Deletes a key-value.
     *
     * @param key The key of the key-value to delete.
     * @param label The label of the key-value to delete.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<DeleteKeyValueHeaders, KeyValue>> deleteKeyValueWithResponseAsync(
            String key, String label, String ifMatch) {
        final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json";
        return FluxUtil.withContext(
                context ->
                        service.deleteKeyValue(
                                this.getEndpoint(),
                                key,
                                label,
                                this.getSyncToken(),
                                this.getApiVersion(),
                                ifMatch,
                                accept,
                                context));
    }

    /**
     * Deletes a key-value.
     *
     * @param key The key of the key-value to delete.
     * @param label The label of the key-value to delete.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<DeleteKeyValueHeaders, KeyValue>> deleteKeyValueWithResponseAsync(
            String key, String label, String ifMatch, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json";
        return service.deleteKeyValue(
                this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), ifMatch, accept, context);
    }

    /**
     * Deletes a key-value.
     *
     * @param key The key of the key-value to delete.
     * @param label The label of the key-value to delete.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<KeyValue> deleteKeyValueAsync(String key, String label, String ifMatch) {
        return deleteKeyValueWithResponseAsync(key, label, ifMatch).flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Deletes a key-value.
     *
     * @param key The key of the key-value to delete.
     * @param label The label of the key-value to delete.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<KeyValue> deleteKeyValueAsync(String key, String label, String ifMatch, Context context) {
        return deleteKeyValueWithResponseAsync(key, label, ifMatch, context)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Deletes a key-value.
     *
     * @param key The key of the key-value to delete.
     * @param label The label of the key-value to delete.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link ResponseBase}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ResponseBase<DeleteKeyValueHeaders, KeyValue> deleteKeyValueWithResponse(
            String key, String label, String ifMatch, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json";
        return service.deleteKeyValueSync(
                this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), ifMatch, accept, context);
    }

    /**
     * Deletes a key-value.
     *
     * @param key The key of the key-value to delete.
     * @param label The label of the key-value to delete.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public KeyValue deleteKeyValue(String key, String label, String ifMatch) {
        return deleteKeyValueWithResponse(key, label, ifMatch, Context.NONE).getValue();
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param key The key of the key-value to retrieve.
     * @param label The label of the key-value to retrieve.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<CheckKeyValueHeaders, Void>> checkKeyValueWithResponseAsync(
            String key,
            String label,
            String acceptDatetime,
            String ifMatch,
            String ifNoneMatch,
            List<SettingFields> select) {
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return FluxUtil.withContext(
                context ->
                        service.checkKeyValue(
                                this.getEndpoint(),
                                key,
                                label,
                                this.getSyncToken(),
                                this.getApiVersion(),
                                acceptDatetime,
                                ifMatch,
                                ifNoneMatch,
                                selectConverted,
                                context));
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param key The key of the key-value to retrieve.
     * @param label The label of the key-value to retrieve.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<CheckKeyValueHeaders, Void>> checkKeyValueWithResponseAsync(
            String key,
            String label,
            String acceptDatetime,
            String ifMatch,
            String ifNoneMatch,
            List<SettingFields> select,
            Context context) {
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return service.checkKeyValue(
                this.getEndpoint(),
                key,
                label,
                this.getSyncToken(),
                this.getApiVersion(),
                acceptDatetime,
                ifMatch,
                ifNoneMatch,
                selectConverted,
                context);
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param key The key of the key-value to retrieve.
     * @param label The label of the key-value to retrieve.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> checkKeyValueAsync(
            String key,
            String label,
            String acceptDatetime,
            String ifMatch,
            String ifNoneMatch,
            List<SettingFields> select) {
        return checkKeyValueWithResponseAsync(key, label, acceptDatetime, ifMatch, ifNoneMatch, select)
                .flatMap(ignored -> Mono.empty());
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param key The key of the key-value to retrieve.
     * @param label The label of the key-value to retrieve.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> checkKeyValueAsync(
            String key,
            String label,
            String acceptDatetime,
            String ifMatch,
            String ifNoneMatch,
            List<SettingFields> select,
            Context context) {
        return checkKeyValueWithResponseAsync(key, label, acceptDatetime, ifMatch, ifNoneMatch, select, context)
                .flatMap(ignored -> Mono.empty());
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param key The key of the key-value to retrieve.
     * @param label The label of the key-value to retrieve.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ResponseBase<CheckKeyValueHeaders, Void> checkKeyValueWithResponse(
            String key,
            String label,
            String acceptDatetime,
            String ifMatch,
            String ifNoneMatch,
            List<SettingFields> select,
            Context context) {
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return service.checkKeyValueSync(
                this.getEndpoint(),
                key,
                label,
                this.getSyncToken(),
                this.getApiVersion(),
                acceptDatetime,
                ifMatch,
                ifNoneMatch,
                selectConverted,
                context);
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param key The key of the key-value to retrieve.
     * @param label The label of the key-value to retrieve.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void checkKeyValue(
            String key,
            String label,
            String acceptDatetime,
            String ifMatch,
            String ifNoneMatch,
            List<SettingFields> select) {
        checkKeyValueWithResponse(key, label, acceptDatetime, ifMatch, ifNoneMatch, select, Context.NONE);
    }

    /**
     * Gets a list of key-value snapshots.
     *
     * @param name A filter for the name of the returned snapshots.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param status Used to filter returned snapshots by their status property.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-value snapshots along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PagedResponse<ConfigurationSettingSnapshot>> getSnapshotsSinglePageAsync(
            String name, String after, List<SnapshotFields> select, List<SnapshotStatus> status) {
        final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        String statusConverted =
                (status == null)
                        ? null
                        : status.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return FluxUtil.withContext(
                        context ->
                                service.getSnapshots(
                                        this.getEndpoint(),
                                        name,
                                        this.getSyncToken(),
                                        this.getApiVersion(),
                                        after,
                                        selectConverted,
                                        statusConverted,
                                        accept,
                                        context))
                .map(
                        res ->
                                new PagedResponseBase<>(
                                        res.getRequest(),
                                        res.getStatusCode(),
                                        res.getHeaders(),
                                        res.getValue().getItems(),
                                        res.getValue().getNextLink(),
                                        res.getDeserializedHeaders()));
    }

    /**
     * Gets a list of key-value snapshots.
     *
     * @param name A filter for the name of the returned snapshots.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param status Used to filter returned snapshots by their status property.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-value snapshots along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PagedResponse<ConfigurationSettingSnapshot>> getSnapshotsSinglePageAsync(
            String name, String after, List<SnapshotFields> select, List<SnapshotStatus> status, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        String statusConverted =
                (status == null)
                        ? null
                        : status.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return service.getSnapshots(
                        this.getEndpoint(),
                        name,
                        this.getSyncToken(),
                        this.getApiVersion(),
                        after,
                        selectConverted,
                        statusConverted,
                        accept,
                        context)
                .map(
                        res ->
                                new PagedResponseBase<>(
                                        res.getRequest(),
                                        res.getStatusCode(),
                                        res.getHeaders(),
                                        res.getValue().getItems(),
                                        res.getValue().getNextLink(),
                                        res.getDeserializedHeaders()));
    }

    /**
     * Gets a list of key-value snapshots.
     *
     * @param name A filter for the name of the returned snapshots.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param status Used to filter returned snapshots by their status property.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-value snapshots as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<ConfigurationSettingSnapshot> getSnapshotsAsync(
            String name, String after, List<SnapshotFields> select, List<SnapshotStatus> status) {
        return new PagedFlux<>(
                () -> getSnapshotsSinglePageAsync(name, after, select, status),
                nextLink -> getSnapshotsNextSinglePageAsync(nextLink));
    }

    /**
     * Gets a list of key-value snapshots.
     *
     * @param name A filter for the name of the returned snapshots.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param status Used to filter returned snapshots by their status property.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-value snapshots as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<ConfigurationSettingSnapshot> getSnapshotsAsync(
            String name, String after, List<SnapshotFields> select, List<SnapshotStatus> status, Context context) {
        return new PagedFlux<>(
                () -> getSnapshotsSinglePageAsync(name, after, select, status, context),
                nextLink -> getSnapshotsNextSinglePageAsync(nextLink, context));
    }

    /**
     * Gets a list of key-value snapshots.
     *
     * @param name A filter for the name of the returned snapshots.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param status Used to filter returned snapshots by their status property.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-value snapshots along with {@link PagedResponse}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PagedResponse<ConfigurationSettingSnapshot> getSnapshotsSinglePage(
            String name, String after, List<SnapshotFields> select, List<SnapshotStatus> status) {
        final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        String statusConverted =
                (status == null)
                        ? null
                        : status.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        ResponseBase<GetSnapshotsHeaders, SnapshotListResult> res =
                service.getSnapshotsSync(
                        this.getEndpoint(),
                        name,
                        this.getSyncToken(),
                        this.getApiVersion(),
                        after,
                        selectConverted,
                        statusConverted,
                        accept,
                        Context.NONE);
        return new PagedResponseBase<>(
                res.getRequest(),
                res.getStatusCode(),
                res.getHeaders(),
                res.getValue().getItems(),
                res.getValue().getNextLink(),
                res.getDeserializedHeaders());
    }

    /**
     * Gets a list of key-value snapshots.
     *
     * @param name A filter for the name of the returned snapshots.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param status Used to filter returned snapshots by their status property.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-value snapshots along with {@link PagedResponse}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PagedResponse<ConfigurationSettingSnapshot> getSnapshotsSinglePage(
            String name, String after, List<SnapshotFields> select, List<SnapshotStatus> status, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        String statusConverted =
                (status == null)
                        ? null
                        : status.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        ResponseBase<GetSnapshotsHeaders, SnapshotListResult> res =
                service.getSnapshotsSync(
                        this.getEndpoint(),
                        name,
                        this.getSyncToken(),
                        this.getApiVersion(),
                        after,
                        selectConverted,
                        statusConverted,
                        accept,
                        context);
        return new PagedResponseBase<>(
                res.getRequest(),
                res.getStatusCode(),
                res.getHeaders(),
                res.getValue().getItems(),
                res.getValue().getNextLink(),
                res.getDeserializedHeaders());
    }

    /**
     * Gets a list of key-value snapshots.
     *
     * @param name A filter for the name of the returned snapshots.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param status Used to filter returned snapshots by their status property.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-value snapshots as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<ConfigurationSettingSnapshot> getSnapshots(
            String name, String after, List<SnapshotFields> select, List<SnapshotStatus> status) {
        return new PagedIterable<>(
                () -> getSnapshotsSinglePage(name, after, select, status, Context.NONE),
                nextLink -> getSnapshotsNextSinglePage(nextLink));
    }

    /**
     * Gets a list of key-value snapshots.
     *
     * @param name A filter for the name of the returned snapshots.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param status Used to filter returned snapshots by their status property.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-value snapshots as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<ConfigurationSettingSnapshot> getSnapshots(
            String name, String after, List<SnapshotFields> select, List<SnapshotStatus> status, Context context) {
        return new PagedIterable<>(
                () -> getSnapshotsSinglePage(name, after, select, status, context),
                nextLink -> getSnapshotsNextSinglePage(nextLink, context));
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<CheckSnapshotsHeaders, Void>> checkSnapshotsWithResponseAsync(String after) {
        return FluxUtil.withContext(
                context ->
                        service.checkSnapshots(
                                this.getEndpoint(), this.getSyncToken(), this.getApiVersion(), after, context));
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<CheckSnapshotsHeaders, Void>> checkSnapshotsWithResponseAsync(
            String after, Context context) {
        return service.checkSnapshots(this.getEndpoint(), this.getSyncToken(), this.getApiVersion(), after, context);
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> checkSnapshotsAsync(String after) {
        return checkSnapshotsWithResponseAsync(after).flatMap(ignored -> Mono.empty());
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> checkSnapshotsAsync(String after, Context context) {
        return checkSnapshotsWithResponseAsync(after, context).flatMap(ignored -> Mono.empty());
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ResponseBase<CheckSnapshotsHeaders, Void> checkSnapshotsWithResponse(String after, Context context) {
        return service.checkSnapshotsSync(
                this.getEndpoint(), this.getSyncToken(), this.getApiVersion(), after, context);
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void checkSnapshots(String after) {
        checkSnapshotsWithResponse(after, Context.NONE);
    }

    /**
     * Gets a single key-value snapshot.
     *
     * @param name The name of the key-value snapshot to retrieve.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a single key-value snapshot along with {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<GetSnapshotHeaders, ConfigurationSettingSnapshot>> getSnapshotWithResponseAsync(
            String name, String ifMatch, String ifNoneMatch, List<SnapshotFields> select) {
        final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return FluxUtil.withContext(
                context ->
                        service.getSnapshot(
                                this.getEndpoint(),
                                this.getSyncToken(),
                                this.getApiVersion(),
                                name,
                                ifMatch,
                                ifNoneMatch,
                                selectConverted,
                                accept,
                                context));
    }

    /**
     * Gets a single key-value snapshot.
     *
     * @param name The name of the key-value snapshot to retrieve.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a single key-value snapshot along with {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<GetSnapshotHeaders, ConfigurationSettingSnapshot>> getSnapshotWithResponseAsync(
            String name, String ifMatch, String ifNoneMatch, List<SnapshotFields> select, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return service.getSnapshot(
                this.getEndpoint(),
                this.getSyncToken(),
                this.getApiVersion(),
                name,
                ifMatch,
                ifNoneMatch,
                selectConverted,
                accept,
                context);
    }

    /**
     * Gets a single key-value snapshot.
     *
     * @param name The name of the key-value snapshot to retrieve.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a single key-value snapshot on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ConfigurationSettingSnapshot> getSnapshotAsync(
            String name, String ifMatch, String ifNoneMatch, List<SnapshotFields> select) {
        return getSnapshotWithResponseAsync(name, ifMatch, ifNoneMatch, select)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Gets a single key-value snapshot.
     *
     * @param name The name of the key-value snapshot to retrieve.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a single key-value snapshot on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ConfigurationSettingSnapshot> getSnapshotAsync(
            String name, String ifMatch, String ifNoneMatch, List<SnapshotFields> select, Context context) {
        return getSnapshotWithResponseAsync(name, ifMatch, ifNoneMatch, select, context)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Gets a single key-value snapshot.
     *
     * @param name The name of the key-value snapshot to retrieve.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a single key-value snapshot along with {@link ResponseBase}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ResponseBase<GetSnapshotHeaders, ConfigurationSettingSnapshot> getSnapshotWithResponse(
            String name, String ifMatch, String ifNoneMatch, List<SnapshotFields> select, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return service.getSnapshotSync(
                this.getEndpoint(),
                this.getSyncToken(),
                this.getApiVersion(),
                name,
                ifMatch,
                ifNoneMatch,
                selectConverted,
                accept,
                context);
    }

    /**
     * Gets a single key-value snapshot.
     *
     * @param name The name of the key-value snapshot to retrieve.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a single key-value snapshot.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ConfigurationSettingSnapshot getSnapshot(
            String name, String ifMatch, String ifNoneMatch, List<SnapshotFields> select) {
        return getSnapshotWithResponse(name, ifMatch, ifNoneMatch, select, Context.NONE).getValue();
    }

    /**
     * Creates a key-value snapshot.
     *
     * @param name The name of the key-value snapshot to create.
     * @param entity The key-value snapshot to create.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<CreateSnapshotHeaders, ConfigurationSettingSnapshot>> createSnapshotWithResponseAsync(
            String name, ConfigurationSettingSnapshot entity) {
        final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json";
        return FluxUtil.withContext(
                context ->
                        service.createSnapshot(
                                this.getEndpoint(),
                                name,
                                this.getSyncToken(),
                                this.getApiVersion(),
                                entity,
                                accept,
                                context));
    }

    /**
     * Creates a key-value snapshot.
     *
     * @param name The name of the key-value snapshot to create.
     * @param entity The key-value snapshot to create.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<CreateSnapshotHeaders, ConfigurationSettingSnapshot>> createSnapshotWithResponseAsync(
            String name, ConfigurationSettingSnapshot entity, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json";
        return service.createSnapshot(
                this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), entity, accept, context);
    }

    /**
     * Creates a key-value snapshot.
     *
     * @param name The name of the key-value snapshot to create.
     * @param entity The key-value snapshot to create.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ConfigurationSettingSnapshot> createSnapshotAsync(String name, ConfigurationSettingSnapshot entity) {
        return createSnapshotWithResponseAsync(name, entity).flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Creates a key-value snapshot.
     *
     * @param name The name of the key-value snapshot to create.
     * @param entity The key-value snapshot to create.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ConfigurationSettingSnapshot> createSnapshotAsync(
            String name, ConfigurationSettingSnapshot entity, Context context) {
        return createSnapshotWithResponseAsync(name, entity, context).flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Creates a key-value snapshot.
     *
     * @param name The name of the key-value snapshot to create.
     * @param entity The key-value snapshot to create.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link ResponseBase}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ResponseBase<CreateSnapshotHeaders, ConfigurationSettingSnapshot> createSnapshotWithResponse(
            String name, ConfigurationSettingSnapshot entity, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json";
        return service.createSnapshotSync(
                this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), entity, accept, context);
    }

    /**
     * Creates a key-value snapshot.
     *
     * @param name The name of the key-value snapshot to create.
     * @param entity The key-value snapshot to create.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ConfigurationSettingSnapshot createSnapshot(String name, ConfigurationSettingSnapshot entity) {
        return createSnapshotWithResponse(name, entity, Context.NONE).getValue();
    }

    /**
     * Updates the state of a key-value snapshot.
     *
     * @param name The name of the key-value snapshot to update.
     * @param entity The parameters used to update the snapshot.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<UpdateSnapshotHeaders, ConfigurationSettingSnapshot>> updateSnapshotWithResponseAsync(
            String name, SnapshotUpdateParameters entity, String ifMatch, String ifNoneMatch) {
        final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json";
        return FluxUtil.withContext(
                context ->
                        service.updateSnapshot(
                                this.getEndpoint(),
                                name,
                                this.getSyncToken(),
                                this.getApiVersion(),
                                ifMatch,
                                ifNoneMatch,
                                entity,
                                accept,
                                context));
    }

    /**
     * Updates the state of a key-value snapshot.
     *
     * @param name The name of the key-value snapshot to update.
     * @param entity The parameters used to update the snapshot.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<UpdateSnapshotHeaders, ConfigurationSettingSnapshot>> updateSnapshotWithResponseAsync(
            String name, SnapshotUpdateParameters entity, String ifMatch, String ifNoneMatch, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json";
        return service.updateSnapshot(
                this.getEndpoint(),
                name,
                this.getSyncToken(),
                this.getApiVersion(),
                ifMatch,
                ifNoneMatch,
                entity,
                accept,
                context);
    }

    /**
     * Updates the state of a key-value snapshot.
     *
     * @param name The name of the key-value snapshot to update.
     * @param entity The parameters used to update the snapshot.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ConfigurationSettingSnapshot> updateSnapshotAsync(
            String name, SnapshotUpdateParameters entity, String ifMatch, String ifNoneMatch) {
        return updateSnapshotWithResponseAsync(name, entity, ifMatch, ifNoneMatch)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Updates the state of a key-value snapshot.
     *
     * @param name The name of the key-value snapshot to update.
     * @param entity The parameters used to update the snapshot.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ConfigurationSettingSnapshot> updateSnapshotAsync(
            String name, SnapshotUpdateParameters entity, String ifMatch, String ifNoneMatch, Context context) {
        return updateSnapshotWithResponseAsync(name, entity, ifMatch, ifNoneMatch, context)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Updates the state of a key-value snapshot.
     *
     * @param name The name of the key-value snapshot to update.
     * @param entity The parameters used to update the snapshot.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link ResponseBase}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ResponseBase<UpdateSnapshotHeaders, ConfigurationSettingSnapshot> updateSnapshotWithResponse(
            String name, SnapshotUpdateParameters entity, String ifMatch, String ifNoneMatch, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json";
        return service.updateSnapshotSync(
                this.getEndpoint(),
                name,
                this.getSyncToken(),
                this.getApiVersion(),
                ifMatch,
                ifNoneMatch,
                entity,
                accept,
                context);
    }

    /**
     * Updates the state of a key-value snapshot.
     *
     * @param name The name of the key-value snapshot to update.
     * @param entity The parameters used to update the snapshot.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ConfigurationSettingSnapshot updateSnapshot(
            String name, SnapshotUpdateParameters entity, String ifMatch, String ifNoneMatch) {
        return updateSnapshotWithResponse(name, entity, ifMatch, ifNoneMatch, Context.NONE).getValue();
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param name The name of the key-value snapshot to check.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<CheckSnapshotHeaders, Void>> checkSnapshotWithResponseAsync(
            String name, String ifMatch, String ifNoneMatch) {
        return FluxUtil.withContext(
                context ->
                        service.checkSnapshot(
                                this.getEndpoint(),
                                name,
                                this.getSyncToken(),
                                this.getApiVersion(),
                                ifMatch,
                                ifNoneMatch,
                                context));
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param name The name of the key-value snapshot to check.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<CheckSnapshotHeaders, Void>> checkSnapshotWithResponseAsync(
            String name, String ifMatch, String ifNoneMatch, Context context) {
        return service.checkSnapshot(
                this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), ifMatch, ifNoneMatch, context);
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param name The name of the key-value snapshot to check.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> checkSnapshotAsync(String name, String ifMatch, String ifNoneMatch) {
        return checkSnapshotWithResponseAsync(name, ifMatch, ifNoneMatch).flatMap(ignored -> Mono.empty());
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param name The name of the key-value snapshot to check.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> checkSnapshotAsync(String name, String ifMatch, String ifNoneMatch, Context context) {
        return checkSnapshotWithResponseAsync(name, ifMatch, ifNoneMatch, context).flatMap(ignored -> Mono.empty());
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param name The name of the key-value snapshot to check.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ResponseBase<CheckSnapshotHeaders, Void> checkSnapshotWithResponse(
            String name, String ifMatch, String ifNoneMatch, Context context) {
        return service.checkSnapshotSync(
                this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), ifMatch, ifNoneMatch, context);
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param name The name of the key-value snapshot to check.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void checkSnapshot(String name, String ifMatch, String ifNoneMatch) {
        checkSnapshotWithResponse(name, ifMatch, ifNoneMatch, Context.NONE);
    }

    /**
     * Gets a list of labels.
     *
     * @param name A filter for the name of the returned labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of labels along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PagedResponse<Label>> getLabelsSinglePageAsync(
            String name, String after, String acceptDatetime, List<LabelFields> select) {
        final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return FluxUtil.withContext(
                        context ->
                                service.getLabels(
                                        this.getEndpoint(),
                                        name,
                                        this.getSyncToken(),
                                        this.getApiVersion(),
                                        after,
                                        acceptDatetime,
                                        selectConverted,
                                        accept,
                                        context))
                .map(
                        res ->
                                new PagedResponseBase<>(
                                        res.getRequest(),
                                        res.getStatusCode(),
                                        res.getHeaders(),
                                        res.getValue().getItems(),
                                        res.getValue().getNextLink(),
                                        res.getDeserializedHeaders()));
    }

    /**
     * Gets a list of labels.
     *
     * @param name A filter for the name of the returned labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of labels along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PagedResponse<Label>> getLabelsSinglePageAsync(
            String name, String after, String acceptDatetime, List<LabelFields> select, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return service.getLabels(
                        this.getEndpoint(),
                        name,
                        this.getSyncToken(),
                        this.getApiVersion(),
                        after,
                        acceptDatetime,
                        selectConverted,
                        accept,
                        context)
                .map(
                        res ->
                                new PagedResponseBase<>(
                                        res.getRequest(),
                                        res.getStatusCode(),
                                        res.getHeaders(),
                                        res.getValue().getItems(),
                                        res.getValue().getNextLink(),
                                        res.getDeserializedHeaders()));
    }

    /**
     * Gets a list of labels.
     *
     * @param name A filter for the name of the returned labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of labels as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<Label> getLabelsAsync(String name, String after, String acceptDatetime, List<LabelFields> select) {
        return new PagedFlux<>(
                () -> getLabelsSinglePageAsync(name, after, acceptDatetime, select),
                nextLink -> getLabelsNextSinglePageAsync(nextLink, acceptDatetime));
    }

    /**
     * Gets a list of labels.
     *
     * @param name A filter for the name of the returned labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of labels as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<Label> getLabelsAsync(
            String name, String after, String acceptDatetime, List<LabelFields> select, Context context) {
        return new PagedFlux<>(
                () -> getLabelsSinglePageAsync(name, after, acceptDatetime, select, context),
                nextLink -> getLabelsNextSinglePageAsync(nextLink, acceptDatetime, context));
    }

    /**
     * Gets a list of labels.
     *
     * @param name A filter for the name of the returned labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of labels along with {@link PagedResponse}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PagedResponse<Label> getLabelsSinglePage(
            String name, String after, String acceptDatetime, List<LabelFields> select) {
        final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        ResponseBase<GetLabelsHeaders, LabelListResult> res =
                service.getLabelsSync(
                        this.getEndpoint(),
                        name,
                        this.getSyncToken(),
                        this.getApiVersion(),
                        after,
                        acceptDatetime,
                        selectConverted,
                        accept,
                        Context.NONE);
        return new PagedResponseBase<>(
                res.getRequest(),
                res.getStatusCode(),
                res.getHeaders(),
                res.getValue().getItems(),
                res.getValue().getNextLink(),
                res.getDeserializedHeaders());
    }

    /**
     * Gets a list of labels.
     *
     * @param name A filter for the name of the returned labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of labels along with {@link PagedResponse}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PagedResponse<Label> getLabelsSinglePage(
            String name, String after, String acceptDatetime, List<LabelFields> select, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        ResponseBase<GetLabelsHeaders, LabelListResult> res =
                service.getLabelsSync(
                        this.getEndpoint(),
                        name,
                        this.getSyncToken(),
                        this.getApiVersion(),
                        after,
                        acceptDatetime,
                        selectConverted,
                        accept,
                        context);
        return new PagedResponseBase<>(
                res.getRequest(),
                res.getStatusCode(),
                res.getHeaders(),
                res.getValue().getItems(),
                res.getValue().getNextLink(),
                res.getDeserializedHeaders());
    }

    /**
     * Gets a list of labels.
     *
     * @param name A filter for the name of the returned labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of labels as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<Label> getLabels(String name, String after, String acceptDatetime, List<LabelFields> select) {
        return new PagedIterable<>(
                () -> getLabelsSinglePage(name, after, acceptDatetime, select, Context.NONE),
                nextLink -> getLabelsNextSinglePage(nextLink, acceptDatetime));
    }

    /**
     * Gets a list of labels.
     *
     * @param name A filter for the name of the returned labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of labels as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<Label> getLabels(
            String name, String after, String acceptDatetime, List<LabelFields> select, Context context) {
        return new PagedIterable<>(
                () -> getLabelsSinglePage(name, after, acceptDatetime, select, context),
                nextLink -> getLabelsNextSinglePage(nextLink, acceptDatetime, context));
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param name A filter for the name of the returned labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<CheckLabelsHeaders, Void>> checkLabelsWithResponseAsync(
            String name, String after, String acceptDatetime, List<LabelFields> select) {
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return FluxUtil.withContext(
                context ->
                        service.checkLabels(
                                this.getEndpoint(),
                                name,
                                this.getSyncToken(),
                                this.getApiVersion(),
                                after,
                                acceptDatetime,
                                selectConverted,
                                context));
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param name A filter for the name of the returned labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<CheckLabelsHeaders, Void>> checkLabelsWithResponseAsync(
            String name, String after, String acceptDatetime, List<LabelFields> select, Context context) {
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return service.checkLabels(
                this.getEndpoint(),
                name,
                this.getSyncToken(),
                this.getApiVersion(),
                after,
                acceptDatetime,
                selectConverted,
                context);
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param name A filter for the name of the returned labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> checkLabelsAsync(String name, String after, String acceptDatetime, List<LabelFields> select) {
        return checkLabelsWithResponseAsync(name, after, acceptDatetime, select).flatMap(ignored -> Mono.empty());
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param name A filter for the name of the returned labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> checkLabelsAsync(
            String name, String after, String acceptDatetime, List<LabelFields> select, Context context) {
        return checkLabelsWithResponseAsync(name, after, acceptDatetime, select, context)
                .flatMap(ignored -> Mono.empty());
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param name A filter for the name of the returned labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ResponseBase<CheckLabelsHeaders, Void> checkLabelsWithResponse(
            String name, String after, String acceptDatetime, List<LabelFields> select, Context context) {
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return service.checkLabelsSync(
                this.getEndpoint(),
                name,
                this.getSyncToken(),
                this.getApiVersion(),
                after,
                acceptDatetime,
                selectConverted,
                context);
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param name A filter for the name of the returned labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void checkLabels(String name, String after, String acceptDatetime, List<LabelFields> select) {
        checkLabelsWithResponse(name, after, acceptDatetime, select, Context.NONE);
    }

    /**
     * Locks a key-value.
     *
     * @param key The key of the key-value to lock.
     * @param label The label, if any, of the key-value to lock.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<PutLockHeaders, KeyValue>> putLockWithResponseAsync(
            String key, String label, String ifMatch, String ifNoneMatch) {
        final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json";
        return FluxUtil.withContext(
                context ->
                        service.putLock(
                                this.getEndpoint(),
                                key,
                                label,
                                this.getSyncToken(),
                                this.getApiVersion(),
                                ifMatch,
                                ifNoneMatch,
                                accept,
                                context));
    }

    /**
     * Locks a key-value.
     *
     * @param key The key of the key-value to lock.
     * @param label The label, if any, of the key-value to lock.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<PutLockHeaders, KeyValue>> putLockWithResponseAsync(
            String key, String label, String ifMatch, String ifNoneMatch, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json";
        return service.putLock(
                this.getEndpoint(),
                key,
                label,
                this.getSyncToken(),
                this.getApiVersion(),
                ifMatch,
                ifNoneMatch,
                accept,
                context);
    }

    /**
     * Locks a key-value.
     *
     * @param key The key of the key-value to lock.
     * @param label The label, if any, of the key-value to lock.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<KeyValue> putLockAsync(String key, String label, String ifMatch, String ifNoneMatch) {
        return putLockWithResponseAsync(key, label, ifMatch, ifNoneMatch)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Locks a key-value.
     *
     * @param key The key of the key-value to lock.
     * @param label The label, if any, of the key-value to lock.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<KeyValue> putLockAsync(String key, String label, String ifMatch, String ifNoneMatch, Context context) {
        return putLockWithResponseAsync(key, label, ifMatch, ifNoneMatch, context)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Locks a key-value.
     *
     * @param key The key of the key-value to lock.
     * @param label The label, if any, of the key-value to lock.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link ResponseBase}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ResponseBase<PutLockHeaders, KeyValue> putLockWithResponse(
            String key, String label, String ifMatch, String ifNoneMatch, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json";
        return service.putLockSync(
                this.getEndpoint(),
                key,
                label,
                this.getSyncToken(),
                this.getApiVersion(),
                ifMatch,
                ifNoneMatch,
                accept,
                context);
    }

    /**
     * Locks a key-value.
     *
     * @param key The key of the key-value to lock.
     * @param label The label, if any, of the key-value to lock.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public KeyValue putLock(String key, String label, String ifMatch, String ifNoneMatch) {
        return putLockWithResponse(key, label, ifMatch, ifNoneMatch, Context.NONE).getValue();
    }

    /**
     * Unlocks a key-value.
     *
     * @param key The key of the key-value to unlock.
     * @param label The label, if any, of the key-value to unlock.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<DeleteLockHeaders, KeyValue>> deleteLockWithResponseAsync(
            String key, String label, String ifMatch, String ifNoneMatch) {
        final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json";
        return FluxUtil.withContext(
                context ->
                        service.deleteLock(
                                this.getEndpoint(),
                                key,
                                label,
                                this.getSyncToken(),
                                this.getApiVersion(),
                                ifMatch,
                                ifNoneMatch,
                                accept,
                                context));
    }

    /**
     * Unlocks a key-value.
     *
     * @param key The key of the key-value to unlock.
     * @param label The label, if any, of the key-value to unlock.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<DeleteLockHeaders, KeyValue>> deleteLockWithResponseAsync(
            String key, String label, String ifMatch, String ifNoneMatch, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json";
        return service.deleteLock(
                this.getEndpoint(),
                key,
                label,
                this.getSyncToken(),
                this.getApiVersion(),
                ifMatch,
                ifNoneMatch,
                accept,
                context);
    }

    /**
     * Unlocks a key-value.
     *
     * @param key The key of the key-value to unlock.
     * @param label The label, if any, of the key-value to unlock.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<KeyValue> deleteLockAsync(String key, String label, String ifMatch, String ifNoneMatch) {
        return deleteLockWithResponseAsync(key, label, ifMatch, ifNoneMatch)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Unlocks a key-value.
     *
     * @param key The key of the key-value to unlock.
     * @param label The label, if any, of the key-value to unlock.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<KeyValue> deleteLockAsync(
            String key, String label, String ifMatch, String ifNoneMatch, Context context) {
        return deleteLockWithResponseAsync(key, label, ifMatch, ifNoneMatch, context)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Unlocks a key-value.
     *
     * @param key The key of the key-value to unlock.
     * @param label The label, if any, of the key-value to unlock.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link ResponseBase}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ResponseBase<DeleteLockHeaders, KeyValue> deleteLockWithResponse(
            String key, String label, String ifMatch, String ifNoneMatch, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json";
        return service.deleteLockSync(
                this.getEndpoint(),
                key,
                label,
                this.getSyncToken(),
                this.getApiVersion(),
                ifMatch,
                ifNoneMatch,
                accept,
                context);
    }

    /**
     * Unlocks a key-value.
     *
     * @param key The key of the key-value to unlock.
     * @param label The label, if any, of the key-value to unlock.
     * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided.
     * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value
     *     provided.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public KeyValue deleteLock(String key, String label, String ifMatch, String ifNoneMatch) {
        return deleteLockWithResponse(key, label, ifMatch, ifNoneMatch, Context.NONE).getValue();
    }

    /**
     * Gets a list of key-value revisions.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-value revisions along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PagedResponse<KeyValue>> getRevisionsSinglePageAsync(
            String key, String label, String after, String acceptDatetime, List<SettingFields> select) {
        final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return FluxUtil.withContext(
                        context ->
                                service.getRevisions(
                                        this.getEndpoint(),
                                        key,
                                        label,
                                        this.getSyncToken(),
                                        this.getApiVersion(),
                                        after,
                                        acceptDatetime,
                                        selectConverted,
                                        accept,
                                        context))
                .map(
                        res ->
                                new PagedResponseBase<>(
                                        res.getRequest(),
                                        res.getStatusCode(),
                                        res.getHeaders(),
                                        res.getValue().getItems(),
                                        res.getValue().getNextLink(),
                                        res.getDeserializedHeaders()));
    }

    /**
     * Gets a list of key-value revisions.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-value revisions along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PagedResponse<KeyValue>> getRevisionsSinglePageAsync(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            Context context) {
        final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return service.getRevisions(
                        this.getEndpoint(),
                        key,
                        label,
                        this.getSyncToken(),
                        this.getApiVersion(),
                        after,
                        acceptDatetime,
                        selectConverted,
                        accept,
                        context)
                .map(
                        res ->
                                new PagedResponseBase<>(
                                        res.getRequest(),
                                        res.getStatusCode(),
                                        res.getHeaders(),
                                        res.getValue().getItems(),
                                        res.getValue().getNextLink(),
                                        res.getDeserializedHeaders()));
    }

    /**
     * Gets a list of key-value revisions.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-value revisions as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<KeyValue> getRevisionsAsync(
            String key, String label, String after, String acceptDatetime, List<SettingFields> select) {
        return new PagedFlux<>(
                () -> getRevisionsSinglePageAsync(key, label, after, acceptDatetime, select),
                nextLink -> getRevisionsNextSinglePageAsync(nextLink, acceptDatetime));
    }

    /**
     * Gets a list of key-value revisions.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-value revisions as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<KeyValue> getRevisionsAsync(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            Context context) {
        return new PagedFlux<>(
                () -> getRevisionsSinglePageAsync(key, label, after, acceptDatetime, select, context),
                nextLink -> getRevisionsNextSinglePageAsync(nextLink, acceptDatetime, context));
    }

    /**
     * Gets a list of key-value revisions.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-value revisions along with {@link PagedResponse}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PagedResponse<KeyValue> getRevisionsSinglePage(
            String key, String label, String after, String acceptDatetime, List<SettingFields> select) {
        final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        ResponseBase<GetRevisionsHeaders, KeyValueListResult> res =
                service.getRevisionsSync(
                        this.getEndpoint(),
                        key,
                        label,
                        this.getSyncToken(),
                        this.getApiVersion(),
                        after,
                        acceptDatetime,
                        selectConverted,
                        accept,
                        Context.NONE);
        return new PagedResponseBase<>(
                res.getRequest(),
                res.getStatusCode(),
                res.getHeaders(),
                res.getValue().getItems(),
                res.getValue().getNextLink(),
                res.getDeserializedHeaders());
    }

    /**
     * Gets a list of key-value revisions.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-value revisions along with {@link PagedResponse}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PagedResponse<KeyValue> getRevisionsSinglePage(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            Context context) {
        final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json";
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        ResponseBase<GetRevisionsHeaders, KeyValueListResult> res =
                service.getRevisionsSync(
                        this.getEndpoint(),
                        key,
                        label,
                        this.getSyncToken(),
                        this.getApiVersion(),
                        after,
                        acceptDatetime,
                        selectConverted,
                        accept,
                        context);
        return new PagedResponseBase<>(
                res.getRequest(),
                res.getStatusCode(),
                res.getHeaders(),
                res.getValue().getItems(),
                res.getValue().getNextLink(),
                res.getDeserializedHeaders());
    }

    /**
     * Gets a list of key-value revisions.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-value revisions as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<KeyValue> getRevisions(
            String key, String label, String after, String acceptDatetime, List<SettingFields> select) {
        return new PagedIterable<>(
                () -> getRevisionsSinglePage(key, label, after, acceptDatetime, select, Context.NONE),
                nextLink -> getRevisionsNextSinglePage(nextLink, acceptDatetime));
    }

    /**
     * Gets a list of key-value revisions.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of key-value revisions as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<KeyValue> getRevisions(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            Context context) {
        return new PagedIterable<>(
                () -> getRevisionsSinglePage(key, label, after, acceptDatetime, select, context),
                nextLink -> getRevisionsNextSinglePage(nextLink, acceptDatetime, context));
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<CheckRevisionsHeaders, Void>> checkRevisionsWithResponseAsync(
            String key, String label, String after, String acceptDatetime, List<SettingFields> select) {
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return FluxUtil.withContext(
                context ->
                        service.checkRevisions(
                                this.getEndpoint(),
                                key,
                                label,
                                this.getSyncToken(),
                                this.getApiVersion(),
                                after,
                                acceptDatetime,
                                selectConverted,
                                context));
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<ResponseBase<CheckRevisionsHeaders, Void>> checkRevisionsWithResponseAsync(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            Context context) {
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return service.checkRevisions(
                this.getEndpoint(),
                key,
                label,
                this.getSyncToken(),
                this.getApiVersion(),
                after,
                acceptDatetime,
                selectConverted,
                context);
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> checkRevisionsAsync(
            String key, String label, String after, String acceptDatetime, List<SettingFields> select) {
        return checkRevisionsWithResponseAsync(key, label, after, acceptDatetime, select)
                .flatMap(ignored -> Mono.empty());
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> checkRevisionsAsync(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            Context context) {
        return checkRevisionsWithResponseAsync(key, label, after, acceptDatetime, select, context)
                .flatMap(ignored -> Mono.empty());
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link ResponseBase}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ResponseBase<CheckRevisionsHeaders, Void> checkRevisionsWithResponse(
            String key,
            String label,
            String after,
            String acceptDatetime,
            List<SettingFields> select,
            Context context) {
        String selectConverted =
                (select == null)
                        ? null
                        : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return service.checkRevisionsSync(
                this.getEndpoint(),
                key,
                label,
                this.getSyncToken(),
                this.getApiVersion(),
                after,
                acceptDatetime,
                selectConverted,
                context);
    }

    /**
     * Requests the headers and status of the given resource.
     *
     * @param key A filter used to match keys.
     * @param label A filter used to match labels.
     * @param after Instructs the server to return elements that appear after the element referred to by the specified
     *     token.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param select Used to select what fields are present in the returned resource(s).
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void checkRevisions(
            String key, String label, String after, String acceptDatetime, List<SettingFields> select) {
        checkRevisionsWithResponse(key, label, after, acceptDatetime, select, Context.NONE);
    }

    /**
     * Gets the state of a long running operation.
     *
     * @param snapshot Snapshot identifier for the long running operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the state of a long running operation along with {@link Response} on successful completion of {@link
     *     Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<OperationDetails>> getOperationDetailsWithResponseAsync(String snapshot) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.getOperationDetails(
                                this.getEndpoint(), this.getApiVersion(), snapshot, accept, context));
    }

    /**
     * Gets the state of a long running operation.
     *
     * @param snapshot Snapshot identifier for the long running operation.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the state of a long running operation along with {@link Response} on successful completion of {@link
     *     Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<OperationDetails>> getOperationDetailsWithResponseAsync(String snapshot, Context context) {
        final String accept = "application/json";
        return service.getOperationDetails(this.getEndpoint(), this.getApiVersion(), snapshot, accept, context);
    }

    /**
     * Gets the state of a long running operation.
     *
     * @param snapshot Snapshot identifier for the long running operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the state of a long running operation on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<OperationDetails> getOperationDetailsAsync(String snapshot) {
        return getOperationDetailsWithResponseAsync(snapshot).flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Gets the state of a long running operation.
     *
     * @param snapshot Snapshot identifier for the long running operation.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the state of a long running operation on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<OperationDetails> getOperationDetailsAsync(String snapshot, Context context) {
        return getOperationDetailsWithResponseAsync(snapshot, context).flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Gets the state of a long running operation.
     *
     * @param snapshot Snapshot identifier for the long running operation.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the state of a long running operation along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<OperationDetails> getOperationDetailsWithResponse(String snapshot, Context context) {
        final String accept = "application/json";
        return service.getOperationDetailsSync(this.getEndpoint(), this.getApiVersion(), snapshot, accept, context);
    }

    /**
     * Gets the state of a long running operation.
     *
     * @param snapshot Snapshot identifier for the long running operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the state of a long running operation.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public OperationDetails getOperationDetails(String snapshot) {
        return getOperationDetailsWithResponse(snapshot, Context.NONE).getValue();
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result of a list request along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PagedResponse<Key>> getKeysNextSinglePageAsync(String nextLink, String acceptDatetime) {
        final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json";
        return FluxUtil.withContext(
                        context ->
                                service.getKeysNext(
                                        nextLink,
                                        this.getEndpoint(),
                                        this.getSyncToken(),
                                        acceptDatetime,
                                        accept,
                                        context))
                .map(
                        res ->
                                new PagedResponseBase<>(
                                        res.getRequest(),
                                        res.getStatusCode(),
                                        res.getHeaders(),
                                        res.getValue().getItems(),
                                        res.getValue().getNextLink(),
                                        res.getDeserializedHeaders()));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result of a list request along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PagedResponse<Key>> getKeysNextSinglePageAsync(
            String nextLink, String acceptDatetime, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json";
        return service.getKeysNext(nextLink, this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, context)
                .map(
                        res ->
                                new PagedResponseBase<>(
                                        res.getRequest(),
                                        res.getStatusCode(),
                                        res.getHeaders(),
                                        res.getValue().getItems(),
                                        res.getValue().getNextLink(),
                                        res.getDeserializedHeaders()));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result of a list request along with {@link PagedResponse}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PagedResponse<Key> getKeysNextSinglePage(String nextLink, String acceptDatetime) {
        final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json";
        ResponseBase<GetKeysNextHeaders, KeyListResult> res =
                service.getKeysNextSync(
                        nextLink, this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, Context.NONE);
        return new PagedResponseBase<>(
                res.getRequest(),
                res.getStatusCode(),
                res.getHeaders(),
                res.getValue().getItems(),
                res.getValue().getNextLink(),
                res.getDeserializedHeaders());
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result of a list request along with {@link PagedResponse}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PagedResponse<Key> getKeysNextSinglePage(String nextLink, String acceptDatetime, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json";
        ResponseBase<GetKeysNextHeaders, KeyListResult> res =
                service.getKeysNextSync(
                        nextLink, this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, context);
        return new PagedResponseBase<>(
                res.getRequest(),
                res.getStatusCode(),
                res.getHeaders(),
                res.getValue().getItems(),
                res.getValue().getNextLink(),
                res.getDeserializedHeaders());
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result of a list request along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PagedResponse<KeyValue>> getKeyValuesNextSinglePageAsync(String nextLink, String acceptDatetime) {
        final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json";
        return FluxUtil.withContext(
                        context ->
                                service.getKeyValuesNext(
                                        nextLink,
                                        this.getEndpoint(),
                                        this.getSyncToken(),
                                        acceptDatetime,
                                        accept,
                                        context))
                .map(
                        res ->
                                new PagedResponseBase<>(
                                        res.getRequest(),
                                        res.getStatusCode(),
                                        res.getHeaders(),
                                        res.getValue().getItems(),
                                        res.getValue().getNextLink(),
                                        res.getDeserializedHeaders()));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result of a list request along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PagedResponse<KeyValue>> getKeyValuesNextSinglePageAsync(
            String nextLink, String acceptDatetime, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json";
        return service.getKeyValuesNext(
                        nextLink, this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, context)
                .map(
                        res ->
                                new PagedResponseBase<>(
                                        res.getRequest(),
                                        res.getStatusCode(),
                                        res.getHeaders(),
                                        res.getValue().getItems(),
                                        res.getValue().getNextLink(),
                                        res.getDeserializedHeaders()));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result of a list request along with {@link PagedResponse}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PagedResponse<KeyValue> getKeyValuesNextSinglePage(String nextLink, String acceptDatetime) {
        final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json";
        ResponseBase<GetKeyValuesNextHeaders, KeyValueListResult> res =
                service.getKeyValuesNextSync(
                        nextLink, this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, Context.NONE);
        return new PagedResponseBase<>(
                res.getRequest(),
                res.getStatusCode(),
                res.getHeaders(),
                res.getValue().getItems(),
                res.getValue().getNextLink(),
                res.getDeserializedHeaders());
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result of a list request along with {@link PagedResponse}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PagedResponse<KeyValue> getKeyValuesNextSinglePage(String nextLink, String acceptDatetime, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json";
        ResponseBase<GetKeyValuesNextHeaders, KeyValueListResult> res =
                service.getKeyValuesNextSync(
                        nextLink, this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, context);
        return new PagedResponseBase<>(
                res.getRequest(),
                res.getStatusCode(),
                res.getHeaders(),
                res.getValue().getItems(),
                res.getValue().getNextLink(),
                res.getDeserializedHeaders());
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result of a snapshot list request along with {@link PagedResponse} on successful completion of {@link
     *     Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PagedResponse<ConfigurationSettingSnapshot>> getSnapshotsNextSinglePageAsync(String nextLink) {
        final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json";
        return FluxUtil.withContext(
                        context ->
                                service.getSnapshotsNext(
                                        nextLink, this.getEndpoint(), this.getSyncToken(), accept, context))
                .map(
                        res ->
                                new PagedResponseBase<>(
                                        res.getRequest(),
                                        res.getStatusCode(),
                                        res.getHeaders(),
                                        res.getValue().getItems(),
                                        res.getValue().getNextLink(),
                                        res.getDeserializedHeaders()));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result of a snapshot list request along with {@link PagedResponse} on successful completion of {@link
     *     Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PagedResponse<ConfigurationSettingSnapshot>> getSnapshotsNextSinglePageAsync(
            String nextLink, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json";
        return service.getSnapshotsNext(nextLink, this.getEndpoint(), this.getSyncToken(), accept, context)
                .map(
                        res ->
                                new PagedResponseBase<>(
                                        res.getRequest(),
                                        res.getStatusCode(),
                                        res.getHeaders(),
                                        res.getValue().getItems(),
                                        res.getValue().getNextLink(),
                                        res.getDeserializedHeaders()));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result of a snapshot list request along with {@link PagedResponse}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PagedResponse<ConfigurationSettingSnapshot> getSnapshotsNextSinglePage(String nextLink) {
        final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json";
        ResponseBase<GetSnapshotsNextHeaders, SnapshotListResult> res =
                service.getSnapshotsNextSync(nextLink, this.getEndpoint(), this.getSyncToken(), accept, Context.NONE);
        return new PagedResponseBase<>(
                res.getRequest(),
                res.getStatusCode(),
                res.getHeaders(),
                res.getValue().getItems(),
                res.getValue().getNextLink(),
                res.getDeserializedHeaders());
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result of a snapshot list request along with {@link PagedResponse}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PagedResponse<ConfigurationSettingSnapshot> getSnapshotsNextSinglePage(String nextLink, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json";
        ResponseBase<GetSnapshotsNextHeaders, SnapshotListResult> res =
                service.getSnapshotsNextSync(nextLink, this.getEndpoint(), this.getSyncToken(), accept, context);
        return new PagedResponseBase<>(
                res.getRequest(),
                res.getStatusCode(),
                res.getHeaders(),
                res.getValue().getItems(),
                res.getValue().getNextLink(),
                res.getDeserializedHeaders());
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result of a list request along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PagedResponse<Label>> getLabelsNextSinglePageAsync(String nextLink, String acceptDatetime) {
        final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json";
        return FluxUtil.withContext(
                        context ->
                                service.getLabelsNext(
                                        nextLink,
                                        this.getEndpoint(),
                                        this.getSyncToken(),
                                        acceptDatetime,
                                        accept,
                                        context))
                .map(
                        res ->
                                new PagedResponseBase<>(
                                        res.getRequest(),
                                        res.getStatusCode(),
                                        res.getHeaders(),
                                        res.getValue().getItems(),
                                        res.getValue().getNextLink(),
                                        res.getDeserializedHeaders()));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result of a list request along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PagedResponse<Label>> getLabelsNextSinglePageAsync(
            String nextLink, String acceptDatetime, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json";
        return service.getLabelsNext(nextLink, this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, context)
                .map(
                        res ->
                                new PagedResponseBase<>(
                                        res.getRequest(),
                                        res.getStatusCode(),
                                        res.getHeaders(),
                                        res.getValue().getItems(),
                                        res.getValue().getNextLink(),
                                        res.getDeserializedHeaders()));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result of a list request along with {@link PagedResponse}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PagedResponse<Label> getLabelsNextSinglePage(String nextLink, String acceptDatetime) {
        final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json";
        ResponseBase<GetLabelsNextHeaders, LabelListResult> res =
                service.getLabelsNextSync(
                        nextLink, this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, Context.NONE);
        return new PagedResponseBase<>(
                res.getRequest(),
                res.getStatusCode(),
                res.getHeaders(),
                res.getValue().getItems(),
                res.getValue().getNextLink(),
                res.getDeserializedHeaders());
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result of a list request along with {@link PagedResponse}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PagedResponse<Label> getLabelsNextSinglePage(String nextLink, String acceptDatetime, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json";
        ResponseBase<GetLabelsNextHeaders, LabelListResult> res =
                service.getLabelsNextSync(
                        nextLink, this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, context);
        return new PagedResponseBase<>(
                res.getRequest(),
                res.getStatusCode(),
                res.getHeaders(),
                res.getValue().getItems(),
                res.getValue().getNextLink(),
                res.getDeserializedHeaders());
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result of a list request along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PagedResponse<KeyValue>> getRevisionsNextSinglePageAsync(String nextLink, String acceptDatetime) {
        final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json";
        return FluxUtil.withContext(
                        context ->
                                service.getRevisionsNext(
                                        nextLink,
                                        this.getEndpoint(),
                                        this.getSyncToken(),
                                        acceptDatetime,
                                        accept,
                                        context))
                .map(
                        res ->
                                new PagedResponseBase<>(
                                        res.getRequest(),
                                        res.getStatusCode(),
                                        res.getHeaders(),
                                        res.getValue().getItems(),
                                        res.getValue().getNextLink(),
                                        res.getDeserializedHeaders()));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result of a list request along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PagedResponse<KeyValue>> getRevisionsNextSinglePageAsync(
            String nextLink, String acceptDatetime, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json";
        return service.getRevisionsNext(
                        nextLink, this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, context)
                .map(
                        res ->
                                new PagedResponseBase<>(
                                        res.getRequest(),
                                        res.getStatusCode(),
                                        res.getHeaders(),
                                        res.getValue().getItems(),
                                        res.getValue().getNextLink(),
                                        res.getDeserializedHeaders()));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result of a list request along with {@link PagedResponse}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PagedResponse<KeyValue> getRevisionsNextSinglePage(String nextLink, String acceptDatetime) {
        final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json";
        ResponseBase<GetRevisionsNextHeaders, KeyValueListResult> res =
                service.getRevisionsNextSync(
                        nextLink, this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, Context.NONE);
        return new PagedResponseBase<>(
                res.getRequest(),
                res.getStatusCode(),
                res.getHeaders(),
                res.getValue().getItems(),
                res.getValue().getNextLink(),
                res.getDeserializedHeaders());
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the result of a list request along with {@link PagedResponse}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PagedResponse<KeyValue> getRevisionsNextSinglePage(String nextLink, String acceptDatetime, Context context) {
        final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json";
        ResponseBase<GetRevisionsNextHeaders, KeyValueListResult> res =
                service.getRevisionsNextSync(
                        nextLink, this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, context);
        return new PagedResponseBase<>(
                res.getRequest(),
                res.getStatusCode(),
                res.getHeaders(),
                res.getValue().getItems(),
                res.getValue().getNextLink(),
                res.getDeserializedHeaders());
    }
}
