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

package com.azure.maps.timezone.implementation;

import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.PathParam;
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.http.rest.Response;
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.CollectionFormat;
import com.azure.core.util.serializer.JacksonAdapter;
import com.azure.maps.timezone.implementation.models.ErrorResponseException;
import com.azure.maps.timezone.implementation.models.JsonFormat;
import com.azure.maps.timezone.models.IanaId;
import com.azure.maps.timezone.models.TimeZoneIanaVersionResult;
import com.azure.maps.timezone.models.TimeZoneOptions;
import com.azure.maps.timezone.models.TimeZoneResult;
import com.azure.maps.timezone.models.TimeZoneWindows;
import java.time.OffsetDateTime;
import java.util.List;
import reactor.core.publisher.Mono;

/** An instance of this class provides access to all the operations defined in Timezones. */
public final class TimezonesImpl {
    /** The proxy service used to perform REST calls. */
    private final TimezonesService service;

    /** The service client containing this operation class. */
    private final TimezoneClientImpl client;

    /**
     * Initializes an instance of TimezonesImpl.
     *
     * @param client the instance of the service client containing this operation class.
     */
    TimezonesImpl(TimezoneClientImpl client) {
        this.service =
                RestProxy.create(TimezonesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
        this.client = client;
    }

    /**
     * The interface defining all the services for TimezoneClientTimezones to be used by the proxy service to perform
     * REST calls.
     */
    @Host("{$host}")
    @ServiceInterface(name = "TimezoneClientTimezo")
    private interface TimezonesService {
        @Get("/timezone/byId/{format}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ErrorResponseException.class)
        Mono<Response<TimeZoneResult>> getTimezoneByID(
                @HostParam("$host") String host,
                @HeaderParam("x-ms-client-id") String clientId,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("Accept-Language") String acceptLanguage,
                @QueryParam("options") TimeZoneOptions options,
                @QueryParam("timeStamp") OffsetDateTime timeStamp,
                @QueryParam("transitionsFrom") OffsetDateTime daylightSavingsTimeFrom,
                @QueryParam("transitionsYears") Integer daylightSavingsTimeLastingYears,
                @PathParam("format") JsonFormat format,
                @QueryParam("query") String timezoneId,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("/timezone/byCoordinates/{format}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ErrorResponseException.class)
        Mono<Response<TimeZoneResult>> getTimezoneByCoordinates(
                @HostParam("$host") String host,
                @HeaderParam("x-ms-client-id") String clientId,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("Accept-Language") String acceptLanguage,
                @QueryParam("options") TimeZoneOptions options,
                @QueryParam("timeStamp") OffsetDateTime timeStamp,
                @QueryParam("transitionsFrom") OffsetDateTime daylightSavingsTimeFrom,
                @QueryParam("transitionsYears") Integer daylightSavingsTimeLastingYears,
                @PathParam("format") JsonFormat format,
                @QueryParam("query") String coordinates,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("/timezone/enumWindows/{format}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ErrorResponseException.class)
        Mono<Response<List<TimeZoneWindows>>> getWindowsTimezoneIds(
                @HostParam("$host") String host,
                @HeaderParam("x-ms-client-id") String clientId,
                @QueryParam("api-version") String apiVersion,
                @PathParam("format") JsonFormat format,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("/timezone/enumIana/{format}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ErrorResponseException.class)
        Mono<Response<List<IanaId>>> getIanaTimezoneIds(
                @HostParam("$host") String host,
                @HeaderParam("x-ms-client-id") String clientId,
                @QueryParam("api-version") String apiVersion,
                @PathParam("format") JsonFormat format,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("/timezone/ianaVersion/{format}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ErrorResponseException.class)
        Mono<Response<TimeZoneIanaVersionResult>> getIanaVersion(
                @HostParam("$host") String host,
                @HeaderParam("x-ms-client-id") String clientId,
                @QueryParam("api-version") String apiVersion,
                @PathParam("format") JsonFormat format,
                @HeaderParam("Accept") String accept,
                Context context);

        @Get("/timezone/windowsToIana/{format}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ErrorResponseException.class)
        Mono<Response<List<IanaId>>> convertWindowsTimezoneToIana(
                @HostParam("$host") String host,
                @HeaderParam("x-ms-client-id") String clientId,
                @QueryParam("api-version") String apiVersion,
                @PathParam("format") JsonFormat format,
                @QueryParam("query") String windowsTimezoneId,
                @QueryParam("territory") String windowsTerritoryCode,
                @HeaderParam("Accept") String accept,
                Context context);
    }

    /**
     * __Time Zone by Id__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns current, historical, and future time zone information for the specified IANA time zone ID.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param timezoneId The IANA time zone ID.
     * @param acceptLanguage Specifies the language code in which the timezone names should be returned. If no language
     *     code is provided, the response will be in "EN". Please refer to [Supported
     *     Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) for details.
     * @param options Alternatively, use alias "o". Options available for types of information returned in the result.
     * @param timeStamp Alternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the
     *     machine time serving the request.
     * @param daylightSavingsTimeFrom Alternatively, use alias "tf". The start date from which daylight savings time
     *     (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
     * @param daylightSavingsTimeLastingYears Alternatively, use alias "ty". The number of years from "transitionsFrom"
     *     for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone By ID call or By Coordinates call along with {@link
     *     Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<TimeZoneResult>> getTimezoneByIDWithResponseAsync(
            JsonFormat format,
            String timezoneId,
            String acceptLanguage,
            TimeZoneOptions options,
            OffsetDateTime timeStamp,
            OffsetDateTime daylightSavingsTimeFrom,
            Integer daylightSavingsTimeLastingYears) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.getTimezoneByID(
                                this.client.getHost(),
                                this.client.getClientId(),
                                this.client.getApiVersion(),
                                acceptLanguage,
                                options,
                                timeStamp,
                                daylightSavingsTimeFrom,
                                daylightSavingsTimeLastingYears,
                                format,
                                timezoneId,
                                accept,
                                context));
    }

    /**
     * __Time Zone by Id__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns current, historical, and future time zone information for the specified IANA time zone ID.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param timezoneId The IANA time zone ID.
     * @param acceptLanguage Specifies the language code in which the timezone names should be returned. If no language
     *     code is provided, the response will be in "EN". Please refer to [Supported
     *     Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) for details.
     * @param options Alternatively, use alias "o". Options available for types of information returned in the result.
     * @param timeStamp Alternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the
     *     machine time serving the request.
     * @param daylightSavingsTimeFrom Alternatively, use alias "tf". The start date from which daylight savings time
     *     (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
     * @param daylightSavingsTimeLastingYears Alternatively, use alias "ty". The number of years from "transitionsFrom"
     *     for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone By ID call or By Coordinates call along with {@link
     *     Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<TimeZoneResult>> getTimezoneByIDWithResponseAsync(
            JsonFormat format,
            String timezoneId,
            String acceptLanguage,
            TimeZoneOptions options,
            OffsetDateTime timeStamp,
            OffsetDateTime daylightSavingsTimeFrom,
            Integer daylightSavingsTimeLastingYears,
            Context context) {
        final String accept = "application/json";
        return service.getTimezoneByID(
                this.client.getHost(),
                this.client.getClientId(),
                this.client.getApiVersion(),
                acceptLanguage,
                options,
                timeStamp,
                daylightSavingsTimeFrom,
                daylightSavingsTimeLastingYears,
                format,
                timezoneId,
                accept,
                context);
    }

    /**
     * __Time Zone by Id__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns current, historical, and future time zone information for the specified IANA time zone ID.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param timezoneId The IANA time zone ID.
     * @param acceptLanguage Specifies the language code in which the timezone names should be returned. If no language
     *     code is provided, the response will be in "EN". Please refer to [Supported
     *     Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) for details.
     * @param options Alternatively, use alias "o". Options available for types of information returned in the result.
     * @param timeStamp Alternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the
     *     machine time serving the request.
     * @param daylightSavingsTimeFrom Alternatively, use alias "tf". The start date from which daylight savings time
     *     (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
     * @param daylightSavingsTimeLastingYears Alternatively, use alias "ty". The number of years from "transitionsFrom"
     *     for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone By ID call or By Coordinates call on successful
     *     completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<TimeZoneResult> getTimezoneByIDAsync(
            JsonFormat format,
            String timezoneId,
            String acceptLanguage,
            TimeZoneOptions options,
            OffsetDateTime timeStamp,
            OffsetDateTime daylightSavingsTimeFrom,
            Integer daylightSavingsTimeLastingYears) {
        return getTimezoneByIDWithResponseAsync(
                        format,
                        timezoneId,
                        acceptLanguage,
                        options,
                        timeStamp,
                        daylightSavingsTimeFrom,
                        daylightSavingsTimeLastingYears)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * __Time Zone by Id__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns current, historical, and future time zone information for the specified IANA time zone ID.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param timezoneId The IANA time zone ID.
     * @param acceptLanguage Specifies the language code in which the timezone names should be returned. If no language
     *     code is provided, the response will be in "EN". Please refer to [Supported
     *     Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) for details.
     * @param options Alternatively, use alias "o". Options available for types of information returned in the result.
     * @param timeStamp Alternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the
     *     machine time serving the request.
     * @param daylightSavingsTimeFrom Alternatively, use alias "tf". The start date from which daylight savings time
     *     (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
     * @param daylightSavingsTimeLastingYears Alternatively, use alias "ty". The number of years from "transitionsFrom"
     *     for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone By ID call or By Coordinates call on successful
     *     completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<TimeZoneResult> getTimezoneByIDAsync(
            JsonFormat format,
            String timezoneId,
            String acceptLanguage,
            TimeZoneOptions options,
            OffsetDateTime timeStamp,
            OffsetDateTime daylightSavingsTimeFrom,
            Integer daylightSavingsTimeLastingYears,
            Context context) {
        return getTimezoneByIDWithResponseAsync(
                        format,
                        timezoneId,
                        acceptLanguage,
                        options,
                        timeStamp,
                        daylightSavingsTimeFrom,
                        daylightSavingsTimeLastingYears,
                        context)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * __Time Zone by Id__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns current, historical, and future time zone information for the specified IANA time zone ID.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param timezoneId The IANA time zone ID.
     * @param acceptLanguage Specifies the language code in which the timezone names should be returned. If no language
     *     code is provided, the response will be in "EN". Please refer to [Supported
     *     Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) for details.
     * @param options Alternatively, use alias "o". Options available for types of information returned in the result.
     * @param timeStamp Alternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the
     *     machine time serving the request.
     * @param daylightSavingsTimeFrom Alternatively, use alias "tf". The start date from which daylight savings time
     *     (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
     * @param daylightSavingsTimeLastingYears Alternatively, use alias "ty". The number of years from "transitionsFrom"
     *     for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone By ID call or By Coordinates call along with {@link
     *     Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<TimeZoneResult> getTimezoneByIDWithResponse(
            JsonFormat format,
            String timezoneId,
            String acceptLanguage,
            TimeZoneOptions options,
            OffsetDateTime timeStamp,
            OffsetDateTime daylightSavingsTimeFrom,
            Integer daylightSavingsTimeLastingYears,
            Context context) {
        return getTimezoneByIDWithResponseAsync(
                        format,
                        timezoneId,
                        acceptLanguage,
                        options,
                        timeStamp,
                        daylightSavingsTimeFrom,
                        daylightSavingsTimeLastingYears,
                        context)
                .block();
    }

    /**
     * __Time Zone by Id__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns current, historical, and future time zone information for the specified IANA time zone ID.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param timezoneId The IANA time zone ID.
     * @param acceptLanguage Specifies the language code in which the timezone names should be returned. If no language
     *     code is provided, the response will be in "EN". Please refer to [Supported
     *     Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) for details.
     * @param options Alternatively, use alias "o". Options available for types of information returned in the result.
     * @param timeStamp Alternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the
     *     machine time serving the request.
     * @param daylightSavingsTimeFrom Alternatively, use alias "tf". The start date from which daylight savings time
     *     (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
     * @param daylightSavingsTimeLastingYears Alternatively, use alias "ty". The number of years from "transitionsFrom"
     *     for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone By ID call or By Coordinates call.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public TimeZoneResult getTimezoneByID(
            JsonFormat format,
            String timezoneId,
            String acceptLanguage,
            TimeZoneOptions options,
            OffsetDateTime timeStamp,
            OffsetDateTime daylightSavingsTimeFrom,
            Integer daylightSavingsTimeLastingYears) {
        return getTimezoneByIDWithResponse(
                        format,
                        timezoneId,
                        acceptLanguage,
                        options,
                        timeStamp,
                        daylightSavingsTimeFrom,
                        daylightSavingsTimeLastingYears,
                        Context.NONE)
                .getValue();
    }

    /**
     * __Time Zone by Coordinates__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns current, historical, and future time zone information for a specified latitude-longitude
     * pair. In addition, the API provides sunset and sunrise times for a given location.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param coordinates Coordinates of the point for which time zone information is requested. This parameter is a
     *     list of coordinates, containing a pair of coordinate(lat, long). When this endpoint is called directly,
     *     coordinates are passed in as a single string containing coordinates, separated by commas.
     * @param acceptLanguage Specifies the language code in which the timezone names should be returned. If no language
     *     code is provided, the response will be in "EN". Please refer to [Supported
     *     Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) for details.
     * @param options Alternatively, use alias "o". Options available for types of information returned in the result.
     * @param timeStamp Alternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the
     *     machine time serving the request.
     * @param daylightSavingsTimeFrom Alternatively, use alias "tf". The start date from which daylight savings time
     *     (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
     * @param daylightSavingsTimeLastingYears Alternatively, use alias "ty". The number of years from "transitionsFrom"
     *     for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone By ID call or By Coordinates call along with {@link
     *     Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<TimeZoneResult>> getTimezoneByCoordinatesWithResponseAsync(
            JsonFormat format,
            List<Double> coordinates,
            String acceptLanguage,
            TimeZoneOptions options,
            OffsetDateTime timeStamp,
            OffsetDateTime daylightSavingsTimeFrom,
            Integer daylightSavingsTimeLastingYears) {
        final String accept = "application/json";
        String coordinatesConverted =
                JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(coordinates, CollectionFormat.CSV);
        return FluxUtil.withContext(
                context ->
                        service.getTimezoneByCoordinates(
                                this.client.getHost(),
                                this.client.getClientId(),
                                this.client.getApiVersion(),
                                acceptLanguage,
                                options,
                                timeStamp,
                                daylightSavingsTimeFrom,
                                daylightSavingsTimeLastingYears,
                                format,
                                coordinatesConverted,
                                accept,
                                context));
    }

    /**
     * __Time Zone by Coordinates__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns current, historical, and future time zone information for a specified latitude-longitude
     * pair. In addition, the API provides sunset and sunrise times for a given location.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param coordinates Coordinates of the point for which time zone information is requested. This parameter is a
     *     list of coordinates, containing a pair of coordinate(lat, long). When this endpoint is called directly,
     *     coordinates are passed in as a single string containing coordinates, separated by commas.
     * @param acceptLanguage Specifies the language code in which the timezone names should be returned. If no language
     *     code is provided, the response will be in "EN". Please refer to [Supported
     *     Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) for details.
     * @param options Alternatively, use alias "o". Options available for types of information returned in the result.
     * @param timeStamp Alternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the
     *     machine time serving the request.
     * @param daylightSavingsTimeFrom Alternatively, use alias "tf". The start date from which daylight savings time
     *     (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
     * @param daylightSavingsTimeLastingYears Alternatively, use alias "ty". The number of years from "transitionsFrom"
     *     for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone By ID call or By Coordinates call along with {@link
     *     Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<TimeZoneResult>> getTimezoneByCoordinatesWithResponseAsync(
            JsonFormat format,
            List<Double> coordinates,
            String acceptLanguage,
            TimeZoneOptions options,
            OffsetDateTime timeStamp,
            OffsetDateTime daylightSavingsTimeFrom,
            Integer daylightSavingsTimeLastingYears,
            Context context) {
        final String accept = "application/json";
        String coordinatesConverted =
                JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(coordinates, CollectionFormat.CSV);
        return service.getTimezoneByCoordinates(
                this.client.getHost(),
                this.client.getClientId(),
                this.client.getApiVersion(),
                acceptLanguage,
                options,
                timeStamp,
                daylightSavingsTimeFrom,
                daylightSavingsTimeLastingYears,
                format,
                coordinatesConverted,
                accept,
                context);
    }

    /**
     * __Time Zone by Coordinates__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns current, historical, and future time zone information for a specified latitude-longitude
     * pair. In addition, the API provides sunset and sunrise times for a given location.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param coordinates Coordinates of the point for which time zone information is requested. This parameter is a
     *     list of coordinates, containing a pair of coordinate(lat, long). When this endpoint is called directly,
     *     coordinates are passed in as a single string containing coordinates, separated by commas.
     * @param acceptLanguage Specifies the language code in which the timezone names should be returned. If no language
     *     code is provided, the response will be in "EN". Please refer to [Supported
     *     Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) for details.
     * @param options Alternatively, use alias "o". Options available for types of information returned in the result.
     * @param timeStamp Alternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the
     *     machine time serving the request.
     * @param daylightSavingsTimeFrom Alternatively, use alias "tf". The start date from which daylight savings time
     *     (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
     * @param daylightSavingsTimeLastingYears Alternatively, use alias "ty". The number of years from "transitionsFrom"
     *     for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone By ID call or By Coordinates call on successful
     *     completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<TimeZoneResult> getTimezoneByCoordinatesAsync(
            JsonFormat format,
            List<Double> coordinates,
            String acceptLanguage,
            TimeZoneOptions options,
            OffsetDateTime timeStamp,
            OffsetDateTime daylightSavingsTimeFrom,
            Integer daylightSavingsTimeLastingYears) {
        return getTimezoneByCoordinatesWithResponseAsync(
                        format,
                        coordinates,
                        acceptLanguage,
                        options,
                        timeStamp,
                        daylightSavingsTimeFrom,
                        daylightSavingsTimeLastingYears)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * __Time Zone by Coordinates__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns current, historical, and future time zone information for a specified latitude-longitude
     * pair. In addition, the API provides sunset and sunrise times for a given location.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param coordinates Coordinates of the point for which time zone information is requested. This parameter is a
     *     list of coordinates, containing a pair of coordinate(lat, long). When this endpoint is called directly,
     *     coordinates are passed in as a single string containing coordinates, separated by commas.
     * @param acceptLanguage Specifies the language code in which the timezone names should be returned. If no language
     *     code is provided, the response will be in "EN". Please refer to [Supported
     *     Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) for details.
     * @param options Alternatively, use alias "o". Options available for types of information returned in the result.
     * @param timeStamp Alternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the
     *     machine time serving the request.
     * @param daylightSavingsTimeFrom Alternatively, use alias "tf". The start date from which daylight savings time
     *     (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
     * @param daylightSavingsTimeLastingYears Alternatively, use alias "ty". The number of years from "transitionsFrom"
     *     for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone By ID call or By Coordinates call on successful
     *     completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<TimeZoneResult> getTimezoneByCoordinatesAsync(
            JsonFormat format,
            List<Double> coordinates,
            String acceptLanguage,
            TimeZoneOptions options,
            OffsetDateTime timeStamp,
            OffsetDateTime daylightSavingsTimeFrom,
            Integer daylightSavingsTimeLastingYears,
            Context context) {
        return getTimezoneByCoordinatesWithResponseAsync(
                        format,
                        coordinates,
                        acceptLanguage,
                        options,
                        timeStamp,
                        daylightSavingsTimeFrom,
                        daylightSavingsTimeLastingYears,
                        context)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * __Time Zone by Coordinates__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns current, historical, and future time zone information for a specified latitude-longitude
     * pair. In addition, the API provides sunset and sunrise times for a given location.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param coordinates Coordinates of the point for which time zone information is requested. This parameter is a
     *     list of coordinates, containing a pair of coordinate(lat, long). When this endpoint is called directly,
     *     coordinates are passed in as a single string containing coordinates, separated by commas.
     * @param acceptLanguage Specifies the language code in which the timezone names should be returned. If no language
     *     code is provided, the response will be in "EN". Please refer to [Supported
     *     Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) for details.
     * @param options Alternatively, use alias "o". Options available for types of information returned in the result.
     * @param timeStamp Alternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the
     *     machine time serving the request.
     * @param daylightSavingsTimeFrom Alternatively, use alias "tf". The start date from which daylight savings time
     *     (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
     * @param daylightSavingsTimeLastingYears Alternatively, use alias "ty". The number of years from "transitionsFrom"
     *     for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone By ID call or By Coordinates call along with {@link
     *     Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<TimeZoneResult> getTimezoneByCoordinatesWithResponse(
            JsonFormat format,
            List<Double> coordinates,
            String acceptLanguage,
            TimeZoneOptions options,
            OffsetDateTime timeStamp,
            OffsetDateTime daylightSavingsTimeFrom,
            Integer daylightSavingsTimeLastingYears,
            Context context) {
        return getTimezoneByCoordinatesWithResponseAsync(
                        format,
                        coordinates,
                        acceptLanguage,
                        options,
                        timeStamp,
                        daylightSavingsTimeFrom,
                        daylightSavingsTimeLastingYears,
                        context)
                .block();
    }

    /**
     * __Time Zone by Coordinates__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns current, historical, and future time zone information for a specified latitude-longitude
     * pair. In addition, the API provides sunset and sunrise times for a given location.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param coordinates Coordinates of the point for which time zone information is requested. This parameter is a
     *     list of coordinates, containing a pair of coordinate(lat, long). When this endpoint is called directly,
     *     coordinates are passed in as a single string containing coordinates, separated by commas.
     * @param acceptLanguage Specifies the language code in which the timezone names should be returned. If no language
     *     code is provided, the response will be in "EN". Please refer to [Supported
     *     Languages](https://docs.microsoft.com/en-us/azure/azure-maps/supported-languages) for details.
     * @param options Alternatively, use alias "o". Options available for types of information returned in the result.
     * @param timeStamp Alternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the
     *     machine time serving the request.
     * @param daylightSavingsTimeFrom Alternatively, use alias "tf". The start date from which daylight savings time
     *     (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
     * @param daylightSavingsTimeLastingYears Alternatively, use alias "ty". The number of years from "transitionsFrom"
     *     for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone By ID call or By Coordinates call.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public TimeZoneResult getTimezoneByCoordinates(
            JsonFormat format,
            List<Double> coordinates,
            String acceptLanguage,
            TimeZoneOptions options,
            OffsetDateTime timeStamp,
            OffsetDateTime daylightSavingsTimeFrom,
            Integer daylightSavingsTimeLastingYears) {
        return getTimezoneByCoordinatesWithResponse(
                        format,
                        coordinates,
                        acceptLanguage,
                        options,
                        timeStamp,
                        daylightSavingsTimeFrom,
                        daylightSavingsTimeLastingYears,
                        Context.NONE)
                .getValue();
    }

    /**
     * __Windows Time Zones__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns a full list of Windows Time Zone IDs.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone Enum Windows call along with {@link Response} on
     *     successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<List<TimeZoneWindows>>> getWindowsTimezoneIdsWithResponseAsync(JsonFormat format) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.getWindowsTimezoneIds(
                                this.client.getHost(),
                                this.client.getClientId(),
                                this.client.getApiVersion(),
                                format,
                                accept,
                                context));
    }

    /**
     * __Windows Time Zones__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns a full list of Windows Time Zone IDs.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone Enum Windows call along with {@link Response} on
     *     successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<List<TimeZoneWindows>>> getWindowsTimezoneIdsWithResponseAsync(
            JsonFormat format, Context context) {
        final String accept = "application/json";
        return service.getWindowsTimezoneIds(
                this.client.getHost(), this.client.getClientId(), this.client.getApiVersion(), format, accept, context);
    }

    /**
     * __Windows Time Zones__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns a full list of Windows Time Zone IDs.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone Enum Windows call on successful completion of {@link
     *     Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<List<TimeZoneWindows>> getWindowsTimezoneIdsAsync(JsonFormat format) {
        return getWindowsTimezoneIdsWithResponseAsync(format).flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * __Windows Time Zones__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns a full list of Windows Time Zone IDs.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone Enum Windows call on successful completion of {@link
     *     Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<List<TimeZoneWindows>> getWindowsTimezoneIdsAsync(JsonFormat format, Context context) {
        return getWindowsTimezoneIdsWithResponseAsync(format, context).flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * __Windows Time Zones__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns a full list of Windows Time Zone IDs.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone Enum Windows call along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<List<TimeZoneWindows>> getWindowsTimezoneIdsWithResponse(JsonFormat format, Context context) {
        return getWindowsTimezoneIdsWithResponseAsync(format, context).block();
    }

    /**
     * __Windows Time Zones__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns a full list of Windows Time Zone IDs.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone Enum Windows call.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public List<TimeZoneWindows> getWindowsTimezoneIds(JsonFormat format) {
        return getWindowsTimezoneIdsWithResponse(format, Context.NONE).getValue();
    }

    /**
     * __IANA Time Zones__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns a full list of IANA time zone IDs. Updates to the IANA service will be reflected in the
     * system within one day.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone Enum IANA call along with {@link Response} on
     *     successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<List<IanaId>>> getIanaTimezoneIdsWithResponseAsync(JsonFormat format) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.getIanaTimezoneIds(
                                this.client.getHost(),
                                this.client.getClientId(),
                                this.client.getApiVersion(),
                                format,
                                accept,
                                context));
    }

    /**
     * __IANA Time Zones__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns a full list of IANA time zone IDs. Updates to the IANA service will be reflected in the
     * system within one day.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone Enum IANA call along with {@link Response} on
     *     successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<List<IanaId>>> getIanaTimezoneIdsWithResponseAsync(JsonFormat format, Context context) {
        final String accept = "application/json";
        return service.getIanaTimezoneIds(
                this.client.getHost(), this.client.getClientId(), this.client.getApiVersion(), format, accept, context);
    }

    /**
     * __IANA Time Zones__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns a full list of IANA time zone IDs. Updates to the IANA service will be reflected in the
     * system within one day.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone Enum IANA call on successful completion of {@link
     *     Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<List<IanaId>> getIanaTimezoneIdsAsync(JsonFormat format) {
        return getIanaTimezoneIdsWithResponseAsync(format).flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * __IANA Time Zones__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns a full list of IANA time zone IDs. Updates to the IANA service will be reflected in the
     * system within one day.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone Enum IANA call on successful completion of {@link
     *     Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<List<IanaId>> getIanaTimezoneIdsAsync(JsonFormat format, Context context) {
        return getIanaTimezoneIdsWithResponseAsync(format, context).flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * __IANA Time Zones__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns a full list of IANA time zone IDs. Updates to the IANA service will be reflected in the
     * system within one day.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone Enum IANA call along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<List<IanaId>> getIanaTimezoneIdsWithResponse(JsonFormat format, Context context) {
        return getIanaTimezoneIdsWithResponseAsync(format, context).block();
    }

    /**
     * __IANA Time Zones__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns a full list of IANA time zone IDs. Updates to the IANA service will be reflected in the
     * system within one day.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone Enum IANA call.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public List<IanaId> getIanaTimezoneIds(JsonFormat format) {
        return getIanaTimezoneIdsWithResponse(format, Context.NONE).getValue();
    }

    /**
     * __Time Zone IANA Version__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns the current IANA version number as Metadata.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone IANA Version call along with {@link Response} on
     *     successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<TimeZoneIanaVersionResult>> getIanaVersionWithResponseAsync(JsonFormat format) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.getIanaVersion(
                                this.client.getHost(),
                                this.client.getClientId(),
                                this.client.getApiVersion(),
                                format,
                                accept,
                                context));
    }

    /**
     * __Time Zone IANA Version__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns the current IANA version number as Metadata.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone IANA Version call along with {@link Response} on
     *     successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<TimeZoneIanaVersionResult>> getIanaVersionWithResponseAsync(
            JsonFormat format, Context context) {
        final String accept = "application/json";
        return service.getIanaVersion(
                this.client.getHost(), this.client.getClientId(), this.client.getApiVersion(), format, accept, context);
    }

    /**
     * __Time Zone IANA Version__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns the current IANA version number as Metadata.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone IANA Version call on successful completion of {@link
     *     Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<TimeZoneIanaVersionResult> getIanaVersionAsync(JsonFormat format) {
        return getIanaVersionWithResponseAsync(format).flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * __Time Zone IANA Version__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns the current IANA version number as Metadata.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone IANA Version call on successful completion of {@link
     *     Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<TimeZoneIanaVersionResult> getIanaVersionAsync(JsonFormat format, Context context) {
        return getIanaVersionWithResponseAsync(format, context).flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * __Time Zone IANA Version__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns the current IANA version number as Metadata.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone IANA Version call along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<TimeZoneIanaVersionResult> getIanaVersionWithResponse(JsonFormat format, Context context) {
        return getIanaVersionWithResponseAsync(format, context).block();
    }

    /**
     * __Time Zone IANA Version__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns the current IANA version number as Metadata.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone IANA Version call.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public TimeZoneIanaVersionResult getIanaVersion(JsonFormat format) {
        return getIanaVersionWithResponse(format, Context.NONE).getValue();
    }

    /**
     * __Windows to IANA Time Zone__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns a corresponding IANA ID, given a valid Windows Time Zone ID. Multiple IANA IDs may be
     * returned for a single Windows ID. It is possible to narrow these results by adding an optional territory
     * parameter.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param windowsTimezoneId The Windows time zone ID.
     * @param windowsTerritoryCode Windows Time Zone territory code.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone Windows To IANA call along with {@link Response} on
     *     successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<List<IanaId>>> convertWindowsTimezoneToIanaWithResponseAsync(
            JsonFormat format, String windowsTimezoneId, String windowsTerritoryCode) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.convertWindowsTimezoneToIana(
                                this.client.getHost(),
                                this.client.getClientId(),
                                this.client.getApiVersion(),
                                format,
                                windowsTimezoneId,
                                windowsTerritoryCode,
                                accept,
                                context));
    }

    /**
     * __Windows to IANA Time Zone__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns a corresponding IANA ID, given a valid Windows Time Zone ID. Multiple IANA IDs may be
     * returned for a single Windows ID. It is possible to narrow these results by adding an optional territory
     * parameter.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param windowsTimezoneId The Windows time zone ID.
     * @param windowsTerritoryCode Windows Time Zone territory code.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone Windows To IANA call along with {@link Response} on
     *     successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<List<IanaId>>> convertWindowsTimezoneToIanaWithResponseAsync(
            JsonFormat format, String windowsTimezoneId, String windowsTerritoryCode, Context context) {
        final String accept = "application/json";
        return service.convertWindowsTimezoneToIana(
                this.client.getHost(),
                this.client.getClientId(),
                this.client.getApiVersion(),
                format,
                windowsTimezoneId,
                windowsTerritoryCode,
                accept,
                context);
    }

    /**
     * __Windows to IANA Time Zone__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns a corresponding IANA ID, given a valid Windows Time Zone ID. Multiple IANA IDs may be
     * returned for a single Windows ID. It is possible to narrow these results by adding an optional territory
     * parameter.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param windowsTimezoneId The Windows time zone ID.
     * @param windowsTerritoryCode Windows Time Zone territory code.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone Windows To IANA call on successful completion of
     *     {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<List<IanaId>> convertWindowsTimezoneToIanaAsync(
            JsonFormat format, String windowsTimezoneId, String windowsTerritoryCode) {
        return convertWindowsTimezoneToIanaWithResponseAsync(format, windowsTimezoneId, windowsTerritoryCode)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * __Windows to IANA Time Zone__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns a corresponding IANA ID, given a valid Windows Time Zone ID. Multiple IANA IDs may be
     * returned for a single Windows ID. It is possible to narrow these results by adding an optional territory
     * parameter.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param windowsTimezoneId The Windows time zone ID.
     * @param windowsTerritoryCode Windows Time Zone territory code.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone Windows To IANA call on successful completion of
     *     {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<List<IanaId>> convertWindowsTimezoneToIanaAsync(
            JsonFormat format, String windowsTimezoneId, String windowsTerritoryCode, Context context) {
        return convertWindowsTimezoneToIanaWithResponseAsync(format, windowsTimezoneId, windowsTerritoryCode, context)
                .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * __Windows to IANA Time Zone__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns a corresponding IANA ID, given a valid Windows Time Zone ID. Multiple IANA IDs may be
     * returned for a single Windows ID. It is possible to narrow these results by adding an optional territory
     * parameter.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param windowsTimezoneId The Windows time zone ID.
     * @param windowsTerritoryCode Windows Time Zone territory code.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone Windows To IANA call along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<List<IanaId>> convertWindowsTimezoneToIanaWithResponse(
            JsonFormat format, String windowsTimezoneId, String windowsTerritoryCode, Context context) {
        return convertWindowsTimezoneToIanaWithResponseAsync(format, windowsTimezoneId, windowsTerritoryCode, context)
                .block();
    }

    /**
     * __Windows to IANA Time Zone__
     *
     * <p>**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
     *
     * <p>This API returns a corresponding IANA ID, given a valid Windows Time Zone ID. Multiple IANA IDs may be
     * returned for a single Windows ID. It is possible to narrow these results by adding an optional territory
     * parameter.
     *
     * @param format Desired format of the response. Only `json` format is supported.
     * @param windowsTimezoneId The Windows time zone ID.
     * @param windowsTerritoryCode Windows Time Zone territory code.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return this object is returned from a successful Timezone Windows To IANA call.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public List<IanaId> convertWindowsTimezoneToIana(
            JsonFormat format, String windowsTimezoneId, String windowsTerritoryCode) {
        return convertWindowsTimezoneToIanaWithResponse(format, windowsTimezoneId, windowsTerritoryCode, Context.NONE)
                .getValue();
    }
}
