diff --git a/sdk/maps/azure-maps-timezone/CHANGELOG.md b/sdk/maps/azure-maps-timezone/CHANGELOG.md new file mode 100644 index 000000000000..856ce157d02a --- /dev/null +++ b/sdk/maps/azure-maps-timezone/CHANGELOG.md @@ -0,0 +1,13 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +- Azure AzureMapsTimeZoneService client library for Java. This package contains Microsoft Azure AzureMapsTimeZoneService client library. + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/maps/azure-maps-timezone/README.md b/sdk/maps/azure-maps-timezone/README.md new file mode 100644 index 000000000000..05806d60bef0 --- /dev/null +++ b/sdk/maps/azure-maps-timezone/README.md @@ -0,0 +1,63 @@ +# Azure AzureMapsTimeZoneService client library for Java + +Azure AzureMapsTimeZoneService client library for Java. + +This package contains Microsoft Azure AzureMapsTimeZoneService client library. + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] +- [Product documentation][product_documentation] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure:azure-maps-timezone;current}) +```xml + + com.azure + azure-maps-timezone + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Authentication + +[Azure Identity][azure_identity] package provides the default implementation for authenticating the client. + +## Key concepts + +## Examples + +```java com.azure.maps.timezone.readme +``` + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[product_documentation]: https://azure.microsoft.com/services/ +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity diff --git a/sdk/maps/azure-maps-timezone/pom.xml b/sdk/maps/azure-maps-timezone/pom.xml new file mode 100644 index 000000000000..0600f0bcb878 --- /dev/null +++ b/sdk/maps/azure-maps-timezone/pom.xml @@ -0,0 +1,73 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure + azure-maps-timezone + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for AzureMapsTimeZoneService Management + This package contains Microsoft Azure AzureMapsTimeZoneService client library. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.25.0 + + + com.azure + azure-core-http-netty + 1.11.7 + + + org.junit.jupiter + junit-jupiter-engine + 5.8.2 + test + + + com.azure + azure-core-test + 1.7.8 + test + + + com.azure + azure-identity + 1.4.4 + test + + + diff --git a/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/AzureMapsTimeZoneServiceAsyncClient.java b/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/AzureMapsTimeZoneServiceAsyncClient.java new file mode 100644 index 000000000000..6e2a8c9a160e --- /dev/null +++ b/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/AzureMapsTimeZoneServiceAsyncClient.java @@ -0,0 +1,414 @@ +// 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; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.maps.timezone.implementation.TimezonesImpl; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the asynchronous AzureMapsTimeZoneServiceClient type. */ +@ServiceClient(builder = AzureMapsTimeZoneServiceClientBuilder.class, isAsync = true) +public final class AzureMapsTimeZoneServiceAsyncClient { + @Generated private final TimezonesImpl serviceClient; + + /** + * Initializes an instance of Timezones client. + * + * @param serviceClient the service client implementation. + */ + @Generated + AzureMapsTimeZoneServiceAsyncClient(TimezonesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * __Time Zone by Id__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API returns current, historical, and future time zone information for the specified IANA time zone ID. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
optionsStringNoAlternatively, use alias "o". Options available for types of information returned in the result.
timeStampStringNoAlternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the machine time serving the request.
transitionsFromStringNoAlternatively, use alias "tf". The start date from which daylight savings time (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
transitionsYearsStringNoAlternatively, use alias "ty". The number of years from "transitionsFrom" for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
queryStringYesThe IANA time zone ID.
+ * + *

Header Parameters + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
Accept-LanguageStringNoSpecifies 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     version: String
+     *     referenceUtcTimestamp: String
+     *     timeZones: [
+     *         {
+     *             id: String
+     *             aliases: [
+     *                 String
+     *             ]
+     *             countries: [
+     *                 {
+     *                     name: String
+     *                     code: String
+     *                 }
+     *             ]
+     *             names: {
+     *                 iso6391LanguageCode: String
+     *                 generic: String
+     *                 standard: String
+     *                 daylight: String
+     *             }
+     *             referenceTime: {
+     *                 tag: String
+     *                 standardOffset: String
+     *                 daylightSavings: String
+     *                 wallTime: String
+     *                 posixTzValidYear: Integer
+     *                 posixTz: String
+     *                 sunrise: String
+     *                 sunset: String
+     *             }
+     *             representativePoint: {
+     *                 latitude: Float
+     *                 longitude: Float
+     *             }
+     *             timeTransitions: [
+     *                 {
+     *                     tag: String
+     *                     standardOffset: String
+     *                     daylightSavings: String
+     *                     utcStart: String
+     *                     utcEnd: String
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @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}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTimezoneByIdWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getTimezoneByIdWithResponseAsync(format, requestOptions); + } + + /** + * __Time Zone by Coordinates__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
optionsStringNoAlternatively, use alias "o". Options available for types of information returned in the result.
timeStampStringNoAlternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the machine time serving the request.
transitionsFromStringNoAlternatively, use alias "tf". The start date from which daylight savings time (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
transitionsYearsStringNoAlternatively, use alias "ty". The number of years from "transitionsFrom" for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
queryStringYesCoordinates 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.
+ * + *

Header Parameters + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
Accept-LanguageStringNoSpecifies 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     version: String
+     *     referenceUtcTimestamp: String
+     *     timeZones: [
+     *         {
+     *             id: String
+     *             aliases: [
+     *                 String
+     *             ]
+     *             countries: [
+     *                 {
+     *                     name: String
+     *                     code: String
+     *                 }
+     *             ]
+     *             names: {
+     *                 iso6391LanguageCode: String
+     *                 generic: String
+     *                 standard: String
+     *                 daylight: String
+     *             }
+     *             referenceTime: {
+     *                 tag: String
+     *                 standardOffset: String
+     *                 daylightSavings: String
+     *                 wallTime: String
+     *                 posixTzValidYear: Integer
+     *                 posixTz: String
+     *                 sunrise: String
+     *                 sunset: String
+     *             }
+     *             representativePoint: {
+     *                 latitude: Float
+     *                 longitude: Float
+     *             }
+     *             timeTransitions: [
+     *                 {
+     *                     tag: String
+     *                     standardOffset: String
+     *                     daylightSavings: String
+     *                     utcStart: String
+     *                     utcEnd: String
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @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}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTimezoneByCoordinatesWithResponse( + String format, RequestOptions requestOptions) { + return this.serviceClient.getTimezoneByCoordinatesWithResponseAsync(format, requestOptions); + } + + /** + * __Windows Time Zones__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API returns a full list of Windows Time Zone IDs. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * [
+     *     {
+     *         windowsId: String
+     *         territory: String
+     *         ianaIds: [
+     *             String
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Timezone Enum Windows call along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWindowsTimezoneIdsWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getWindowsTimezoneIdsWithResponseAsync(format, requestOptions); + } + + /** + * __IANA Time Zones__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * [
+     *     {
+     *         id: String
+     *         isAlias: Boolean
+     *         aliasOf: String
+     *         hasZone1970Location: Boolean
+     *     }
+     * ]
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Timezone Enum IANA call along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getIanaTimezoneIdsWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getIanaTimezoneIdsWithResponseAsync(format, requestOptions); + } + + /** + * __Time Zone IANA Version__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API returns the current IANA version number as Metadata. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     version: String
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Timezone IANA Version call along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getIanaVersionWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getIanaVersionWithResponseAsync(format, requestOptions); + } + + /** + * __Windows to IANA Time Zone__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
queryStringYesThe Windows time zone ID.
territoryStringNoWindows Time Zone territory code.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * [
+     *     {
+     *         id: String
+     *         isAlias: Boolean
+     *         aliasOf: String
+     *         hasZone1970Location: Boolean
+     *     }
+     * ]
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Timezone Windows To IANA call along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> convertWindowsTimezoneToIanaWithResponse( + String format, RequestOptions requestOptions) { + return this.serviceClient.convertWindowsTimezoneToIanaWithResponseAsync(format, requestOptions); + } +} diff --git a/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/AzureMapsTimeZoneServiceClient.java b/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/AzureMapsTimeZoneServiceClient.java new file mode 100644 index 000000000000..f80b9712e9cd --- /dev/null +++ b/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/AzureMapsTimeZoneServiceClient.java @@ -0,0 +1,407 @@ +// 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; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.maps.timezone.implementation.TimezonesImpl; + +/** Initializes a new instance of the synchronous AzureMapsTimeZoneServiceClient type. */ +@ServiceClient(builder = AzureMapsTimeZoneServiceClientBuilder.class) +public final class AzureMapsTimeZoneServiceClient { + @Generated private final TimezonesImpl serviceClient; + + /** + * Initializes an instance of Timezones client. + * + * @param serviceClient the service client implementation. + */ + @Generated + AzureMapsTimeZoneServiceClient(TimezonesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * __Time Zone by Id__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API returns current, historical, and future time zone information for the specified IANA time zone ID. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
optionsStringNoAlternatively, use alias "o". Options available for types of information returned in the result.
timeStampStringNoAlternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the machine time serving the request.
transitionsFromStringNoAlternatively, use alias "tf". The start date from which daylight savings time (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
transitionsYearsStringNoAlternatively, use alias "ty". The number of years from "transitionsFrom" for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
queryStringYesThe IANA time zone ID.
+ * + *

Header Parameters + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
Accept-LanguageStringNoSpecifies 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     version: String
+     *     referenceUtcTimestamp: String
+     *     timeZones: [
+     *         {
+     *             id: String
+     *             aliases: [
+     *                 String
+     *             ]
+     *             countries: [
+     *                 {
+     *                     name: String
+     *                     code: String
+     *                 }
+     *             ]
+     *             names: {
+     *                 iso6391LanguageCode: String
+     *                 generic: String
+     *                 standard: String
+     *                 daylight: String
+     *             }
+     *             referenceTime: {
+     *                 tag: String
+     *                 standardOffset: String
+     *                 daylightSavings: String
+     *                 wallTime: String
+     *                 posixTzValidYear: Integer
+     *                 posixTz: String
+     *                 sunrise: String
+     *                 sunset: String
+     *             }
+     *             representativePoint: {
+     *                 latitude: Float
+     *                 longitude: Float
+     *             }
+     *             timeTransitions: [
+     *                 {
+     *                     tag: String
+     *                     standardOffset: String
+     *                     daylightSavings: String
+     *                     utcStart: String
+     *                     utcEnd: String
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Timezone By ID call or By Coordinates call along with {@link + * Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTimezoneByIdWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getTimezoneByIdWithResponse(format, requestOptions); + } + + /** + * __Time Zone by Coordinates__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
optionsStringNoAlternatively, use alias "o". Options available for types of information returned in the result.
timeStampStringNoAlternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the machine time serving the request.
transitionsFromStringNoAlternatively, use alias "tf". The start date from which daylight savings time (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
transitionsYearsStringNoAlternatively, use alias "ty". The number of years from "transitionsFrom" for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
queryStringYesCoordinates 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.
+ * + *

Header Parameters + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
Accept-LanguageStringNoSpecifies 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     version: String
+     *     referenceUtcTimestamp: String
+     *     timeZones: [
+     *         {
+     *             id: String
+     *             aliases: [
+     *                 String
+     *             ]
+     *             countries: [
+     *                 {
+     *                     name: String
+     *                     code: String
+     *                 }
+     *             ]
+     *             names: {
+     *                 iso6391LanguageCode: String
+     *                 generic: String
+     *                 standard: String
+     *                 daylight: String
+     *             }
+     *             referenceTime: {
+     *                 tag: String
+     *                 standardOffset: String
+     *                 daylightSavings: String
+     *                 wallTime: String
+     *                 posixTzValidYear: Integer
+     *                 posixTz: String
+     *                 sunrise: String
+     *                 sunset: String
+     *             }
+     *             representativePoint: {
+     *                 latitude: Float
+     *                 longitude: Float
+     *             }
+     *             timeTransitions: [
+     *                 {
+     *                     tag: String
+     *                     standardOffset: String
+     *                     daylightSavings: String
+     *                     utcStart: String
+     *                     utcEnd: String
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Timezone By ID call or By Coordinates call along with {@link + * Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTimezoneByCoordinatesWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getTimezoneByCoordinatesWithResponse(format, requestOptions); + } + + /** + * __Windows Time Zones__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API returns a full list of Windows Time Zone IDs. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * [
+     *     {
+     *         windowsId: String
+     *         territory: String
+     *         ianaIds: [
+     *             String
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Timezone Enum Windows call along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWindowsTimezoneIdsWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getWindowsTimezoneIdsWithResponse(format, requestOptions); + } + + /** + * __IANA Time Zones__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * [
+     *     {
+     *         id: String
+     *         isAlias: Boolean
+     *         aliasOf: String
+     *         hasZone1970Location: Boolean
+     *     }
+     * ]
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Timezone Enum IANA call along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getIanaTimezoneIdsWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getIanaTimezoneIdsWithResponse(format, requestOptions); + } + + /** + * __Time Zone IANA Version__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API returns the current IANA version number as Metadata. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     version: String
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Timezone IANA Version call along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getIanaVersionWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.getIanaVersionWithResponse(format, requestOptions); + } + + /** + * __Windows to IANA Time Zone__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
queryStringYesThe Windows time zone ID.
territoryStringNoWindows Time Zone territory code.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * [
+     *     {
+     *         id: String
+     *         isAlias: Boolean
+     *         aliasOf: String
+     *         hasZone1970Location: Boolean
+     *     }
+     * ]
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Timezone Windows To IANA call along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response convertWindowsTimezoneToIanaWithResponse(String format, RequestOptions requestOptions) { + return this.serviceClient.convertWindowsTimezoneToIanaWithResponse(format, requestOptions); + } +} diff --git a/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/AzureMapsTimeZoneServiceClientBuilder.java b/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/AzureMapsTimeZoneServiceClientBuilder.java new file mode 100644 index 000000000000..2487361eda20 --- /dev/null +++ b/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/AzureMapsTimeZoneServiceClientBuilder.java @@ -0,0 +1,334 @@ +// 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; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.maps.timezone.implementation.AzureMapsTimeZoneServiceClientImpl; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** A builder for creating a new instance of the AzureMapsTimeZoneServiceClient type. */ +@ServiceClientBuilder( + serviceClients = {AzureMapsTimeZoneServiceClient.class, AzureMapsTimeZoneServiceAsyncClient.class}) +public final class AzureMapsTimeZoneServiceClientBuilder { + @Generated private static final String SDK_NAME = "name"; + + @Generated private static final String SDK_VERSION = "version"; + + @Generated private static final String[] DEFAULT_SCOPES = new String[] {"https://atlas.microsoft.com/.default"}; + + @Generated private final Map properties = CoreUtils.getProperties("azure-maps-timezone.properties"); + + /** Create an instance of the AzureMapsTimeZoneServiceClientBuilder. */ + @Generated + public AzureMapsTimeZoneServiceClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * Specifies which account is intended for usage in conjunction with the + * Azure AD security model. It represents a unique ID for the Azure Maps + * account and can be retrieved from the Azure Maps management plane + * Account API. To use Azure AD security in Azure Maps see the following + * [articles](https://aka.ms/amauthdetails) for guidance. + */ + @Generated private String clientId; + + /** + * Sets Specifies which account is intended for usage in conjunction with the Azure AD security model. It represents + * a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To + * use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance. + * + * @param clientId the clientId value. + * @return the AzureMapsTimeZoneServiceClientBuilder. + */ + @Generated + public AzureMapsTimeZoneServiceClientBuilder clientId(String clientId) { + this.clientId = clientId; + return this; + } + + /* + * server parameter + */ + @Generated private String host; + + /** + * Sets server parameter. + * + * @param host the host value. + * @return the AzureMapsTimeZoneServiceClientBuilder. + */ + @Generated + public AzureMapsTimeZoneServiceClientBuilder host(String host) { + this.host = host; + return this; + } + + /* + * Service version + */ + @Generated private AzureMapsTimeZoneServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the AzureMapsTimeZoneServiceClientBuilder. + */ + @Generated + public AzureMapsTimeZoneServiceClientBuilder serviceVersion(AzureMapsTimeZoneServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + @Generated private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the AzureMapsTimeZoneServiceClientBuilder. + */ + @Generated + public AzureMapsTimeZoneServiceClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated private HttpClient httpClient; + + /** + * Sets The HTTP client used to send the request. + * + * @param httpClient the httpClient value. + * @return the AzureMapsTimeZoneServiceClientBuilder. + */ + @Generated + public AzureMapsTimeZoneServiceClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The configuration store that is used during construction of the service + * client. + */ + @Generated private Configuration configuration; + + /** + * Sets The configuration store that is used during construction of the service client. + * + * @param configuration the configuration value. + * @return the AzureMapsTimeZoneServiceClientBuilder. + */ + @Generated + public AzureMapsTimeZoneServiceClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated private TokenCredential tokenCredential; + + /** + * Sets The TokenCredential used for authentication. + * + * @param tokenCredential the tokenCredential value. + * @return the AzureMapsTimeZoneServiceClientBuilder. + */ + @Generated + public AzureMapsTimeZoneServiceClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated private HttpLogOptions httpLogOptions; + + /** + * Sets The logging configuration for HTTP requests and responses. + * + * @param httpLogOptions the httpLogOptions value. + * @return the AzureMapsTimeZoneServiceClientBuilder. + */ + @Generated + public AzureMapsTimeZoneServiceClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if + * applicable. + */ + @Generated private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the AzureMapsTimeZoneServiceClientBuilder. + */ + @Generated + public AzureMapsTimeZoneServiceClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /* + * The list of Http pipeline policies to add. + */ + @Generated private final List pipelinePolicies; + + /* + * The client options such as application ID and custom headers to set on a + * request. + */ + @Generated private ClientOptions clientOptions; + + /** + * Sets The client options such as application ID and custom headers to set on a request. + * + * @param clientOptions the clientOptions value. + * @return the AzureMapsTimeZoneServiceClientBuilder. + */ + @Generated + public AzureMapsTimeZoneServiceClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /** + * Adds a custom Http pipeline policy. + * + * @param customPolicy The custom Http pipeline policy to add. + * @return the AzureMapsTimeZoneServiceClientBuilder. + */ + @Generated + public AzureMapsTimeZoneServiceClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + pipelinePolicies.add(customPolicy); + return this; + } + + /** + * Builds an instance of AzureMapsTimeZoneServiceClientImpl with the provided parameters. + * + * @return an instance of AzureMapsTimeZoneServiceClientImpl. + */ + @Generated + private AzureMapsTimeZoneServiceClientImpl buildInnerClient() { + if (host == null) { + this.host = "https://atlas.microsoft.com"; + } + if (serviceVersion == null) { + this.serviceVersion = AzureMapsTimeZoneServiceVersion.getLatest(); + } + if (pipeline == null) { + this.pipeline = createHttpPipeline(); + } + AzureMapsTimeZoneServiceClientImpl client = + new AzureMapsTimeZoneServiceClientImpl( + pipeline, JacksonAdapter.createDefaultSerializerAdapter(), clientId, host, serviceVersion); + return client; + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration = + (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + if (httpLogOptions == null) { + httpLogOptions = new HttpLogOptions(); + } + if (clientOptions == null) { + clientOptions = new ClientOptions(); + } + List policies = new ArrayList<>(); + String clientName = properties.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + HttpHeaders headers = new HttpHeaders(); + clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); + if (headers.getSize() > 0) { + policies.add(new AddHeadersPolicy(headers)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy == null ? new RetryPolicy() : retryPolicy); + policies.add(new CookiePolicy()); + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(clientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of AzureMapsTimeZoneServiceAsyncClient async client. + * + * @return an instance of AzureMapsTimeZoneServiceAsyncClient. + */ + @Generated + public AzureMapsTimeZoneServiceAsyncClient buildAsyncClient() { + return new AzureMapsTimeZoneServiceAsyncClient(buildInnerClient().getTimezones()); + } + + /** + * Builds an instance of AzureMapsTimeZoneServiceClient sync client. + * + * @return an instance of AzureMapsTimeZoneServiceClient. + */ + @Generated + public AzureMapsTimeZoneServiceClient buildClient() { + return new AzureMapsTimeZoneServiceClient(buildInnerClient().getTimezones()); + } +} diff --git a/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/AzureMapsTimeZoneServiceVersion.java b/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/AzureMapsTimeZoneServiceVersion.java new file mode 100644 index 000000000000..0993a01ec477 --- /dev/null +++ b/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/AzureMapsTimeZoneServiceVersion.java @@ -0,0 +1,33 @@ +// 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; + +import com.azure.core.util.ServiceVersion; + +/** Service version of AzureMapsTimeZoneServiceClient. */ +public enum AzureMapsTimeZoneServiceVersion implements ServiceVersion { + /** Enum value 1.0. */ + V1_0("1.0"); + + private final String version; + + AzureMapsTimeZoneServiceVersion(String version) { + this.version = version; + } + + @Override + public String getVersion() { + return this.version; + } + + /** + * Gets the latest service version supported by this client library. + * + * @return The latest {@link AzureMapsTimeZoneServiceVersion}. + */ + public static AzureMapsTimeZoneServiceVersion getLatest() { + return V1_0; + } +} diff --git a/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/implementation/AzureMapsTimeZoneServiceClientImpl.java b/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/implementation/AzureMapsTimeZoneServiceClientImpl.java new file mode 100644 index 000000000000..38a283771700 --- /dev/null +++ b/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/implementation/AzureMapsTimeZoneServiceClientImpl.java @@ -0,0 +1,159 @@ +// 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.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.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.maps.timezone.AzureMapsTimeZoneServiceVersion; + +/** Initializes a new instance of the AzureMapsTimeZoneServiceClient type. */ +public final class AzureMapsTimeZoneServiceClientImpl { + /** + * Specifies which account is intended for usage in conjunction with the Azure AD security model. It represents a + * unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To + * use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance. + */ + private final String clientId; + + /** + * Gets Specifies which account is intended for usage in conjunction with the Azure AD security model. It represents + * a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To + * use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance. + * + * @return the clientId value. + */ + public String getClientId() { + return this.clientId; + } + + /** server parameter. */ + private final String host; + + /** + * Gets server parameter. + * + * @return the host value. + */ + public String getHost() { + return this.host; + } + + /** Service version. */ + private final AzureMapsTimeZoneServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public AzureMapsTimeZoneServiceVersion getServiceVersion() { + return this.serviceVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The TimezonesImpl object to access its operations. */ + private final TimezonesImpl timezones; + + /** + * Gets the TimezonesImpl object to access its operations. + * + * @return the TimezonesImpl object. + */ + public TimezonesImpl getTimezones() { + return this.timezones; + } + + /** + * Initializes an instance of AzureMapsTimeZoneServiceClient client. + * + * @param clientId Specifies which account is intended for usage in conjunction with the Azure AD security model. It + * represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane + * Account API. To use Azure AD security in Azure Maps see the following + * [articles](https://aka.ms/amauthdetails) for guidance. + * @param host server parameter. + * @param serviceVersion Service version. + */ + public AzureMapsTimeZoneServiceClientImpl( + String clientId, String host, AzureMapsTimeZoneServiceVersion serviceVersion) { + this( + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(), + JacksonAdapter.createDefaultSerializerAdapter(), + clientId, + host, + serviceVersion); + } + + /** + * Initializes an instance of AzureMapsTimeZoneServiceClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param clientId Specifies which account is intended for usage in conjunction with the Azure AD security model. It + * represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane + * Account API. To use Azure AD security in Azure Maps see the following + * [articles](https://aka.ms/amauthdetails) for guidance. + * @param host server parameter. + * @param serviceVersion Service version. + */ + public AzureMapsTimeZoneServiceClientImpl( + HttpPipeline httpPipeline, String clientId, String host, AzureMapsTimeZoneServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), clientId, host, serviceVersion); + } + + /** + * Initializes an instance of AzureMapsTimeZoneServiceClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param clientId Specifies which account is intended for usage in conjunction with the Azure AD security model. It + * represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane + * Account API. To use Azure AD security in Azure Maps see the following + * [articles](https://aka.ms/amauthdetails) for guidance. + * @param host server parameter. + * @param serviceVersion Service version. + */ + public AzureMapsTimeZoneServiceClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + String clientId, + String host, + AzureMapsTimeZoneServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.clientId = clientId; + this.host = host; + this.serviceVersion = serviceVersion; + this.timezones = new TimezonesImpl(this); + } +} diff --git a/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/implementation/TimezonesImpl.java b/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/implementation/TimezonesImpl.java new file mode 100644 index 000000000000..ea10e4d3a0cc --- /dev/null +++ b/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/implementation/TimezonesImpl.java @@ -0,0 +1,1287 @@ +// 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.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.exception.HttpResponseException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import 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 AzureMapsTimeZoneServiceClientImpl client; + + /** + * Initializes an instance of TimezonesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TimezonesImpl(AzureMapsTimeZoneServiceClientImpl client) { + this.service = + RestProxy.create(TimezonesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureMapsTimeZoneServiceTimezones to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureMapsTimeZoneSer") + private interface TimezonesService { + @Get("/timezone/byId/{format}") + @ExpectedResponses({200}) + Mono> getTimezoneById( + @HostParam("$host") String host, + @QueryParam("api-version") String apiVersion, + @PathParam("format") String format, + RequestOptions requestOptions, + Context context); + + @Get("/timezone/byCoordinates/{format}") + @ExpectedResponses({200}) + Mono> getTimezoneByCoordinates( + @HostParam("$host") String host, + @QueryParam("api-version") String apiVersion, + @PathParam("format") String format, + RequestOptions requestOptions, + Context context); + + @Get("/timezone/enumWindows/{format}") + @ExpectedResponses({200}) + Mono> getWindowsTimezoneIds( + @HostParam("$host") String host, + @QueryParam("api-version") String apiVersion, + @PathParam("format") String format, + RequestOptions requestOptions, + Context context); + + @Get("/timezone/enumIana/{format}") + @ExpectedResponses({200}) + Mono> getIanaTimezoneIds( + @HostParam("$host") String host, + @QueryParam("api-version") String apiVersion, + @PathParam("format") String format, + RequestOptions requestOptions, + Context context); + + @Get("/timezone/ianaVersion/{format}") + @ExpectedResponses({200}) + Mono> getIanaVersion( + @HostParam("$host") String host, + @QueryParam("api-version") String apiVersion, + @PathParam("format") String format, + RequestOptions requestOptions, + Context context); + + @Get("/timezone/windowsToIana/{format}") + @ExpectedResponses({200}) + Mono> convertWindowsTimezoneToIana( + @HostParam("$host") String host, + @QueryParam("api-version") String apiVersion, + @PathParam("format") String format, + RequestOptions requestOptions, + Context context); + } + + /** + * __Time Zone by Id__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API returns current, historical, and future time zone information for the specified IANA time zone ID. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
optionsStringNoAlternatively, use alias "o". Options available for types of information returned in the result.
timeStampStringNoAlternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the machine time serving the request.
transitionsFromStringNoAlternatively, use alias "tf". The start date from which daylight savings time (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
transitionsYearsStringNoAlternatively, use alias "ty". The number of years from "transitionsFrom" for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
queryStringYesThe IANA time zone ID.
+ * + *

Header Parameters + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
Accept-LanguageStringNoSpecifies 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     version: String
+     *     referenceUtcTimestamp: String
+     *     timeZones: [
+     *         {
+     *             id: String
+     *             aliases: [
+     *                 String
+     *             ]
+     *             countries: [
+     *                 {
+     *                     name: String
+     *                     code: String
+     *                 }
+     *             ]
+     *             names: {
+     *                 iso6391LanguageCode: String
+     *                 generic: String
+     *                 standard: String
+     *                 daylight: String
+     *             }
+     *             referenceTime: {
+     *                 tag: String
+     *                 standardOffset: String
+     *                 daylightSavings: String
+     *                 wallTime: String
+     *                 posixTzValidYear: Integer
+     *                 posixTz: String
+     *                 sunrise: String
+     *                 sunset: String
+     *             }
+     *             representativePoint: {
+     *                 latitude: Float
+     *                 longitude: Float
+     *             }
+     *             timeTransitions: [
+     *                 {
+     *                     tag: String
+     *                     standardOffset: String
+     *                     daylightSavings: String
+     *                     utcStart: String
+     *                     utcEnd: String
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @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> getTimezoneByIdWithResponseAsync(String format, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.getTimezoneById( + this.client.getHost(), + this.client.getServiceVersion().getVersion(), + format, + requestOptions, + context)); + } + + /** + * __Time Zone by Id__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API returns current, historical, and future time zone information for the specified IANA time zone ID. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
optionsStringNoAlternatively, use alias "o". Options available for types of information returned in the result.
timeStampStringNoAlternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the machine time serving the request.
transitionsFromStringNoAlternatively, use alias "tf". The start date from which daylight savings time (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
transitionsYearsStringNoAlternatively, use alias "ty". The number of years from "transitionsFrom" for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
queryStringYesThe IANA time zone ID.
+ * + *

Header Parameters + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
Accept-LanguageStringNoSpecifies 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     version: String
+     *     referenceUtcTimestamp: String
+     *     timeZones: [
+     *         {
+     *             id: String
+     *             aliases: [
+     *                 String
+     *             ]
+     *             countries: [
+     *                 {
+     *                     name: String
+     *                     code: String
+     *                 }
+     *             ]
+     *             names: {
+     *                 iso6391LanguageCode: String
+     *                 generic: String
+     *                 standard: String
+     *                 daylight: String
+     *             }
+     *             referenceTime: {
+     *                 tag: String
+     *                 standardOffset: String
+     *                 daylightSavings: String
+     *                 wallTime: String
+     *                 posixTzValidYear: Integer
+     *                 posixTz: String
+     *                 sunrise: String
+     *                 sunset: String
+     *             }
+     *             representativePoint: {
+     *                 latitude: Float
+     *                 longitude: Float
+     *             }
+     *             timeTransitions: [
+     *                 {
+     *                     tag: String
+     *                     standardOffset: String
+     *                     daylightSavings: String
+     *                     utcStart: String
+     *                     utcEnd: String
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @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> getTimezoneByIdWithResponseAsync( + String format, RequestOptions requestOptions, Context context) { + return service.getTimezoneById( + this.client.getHost(), this.client.getServiceVersion().getVersion(), format, requestOptions, context); + } + + /** + * __Time Zone by Id__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API returns current, historical, and future time zone information for the specified IANA time zone ID. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
optionsStringNoAlternatively, use alias "o". Options available for types of information returned in the result.
timeStampStringNoAlternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the machine time serving the request.
transitionsFromStringNoAlternatively, use alias "tf". The start date from which daylight savings time (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
transitionsYearsStringNoAlternatively, use alias "ty". The number of years from "transitionsFrom" for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
queryStringYesThe IANA time zone ID.
+ * + *

Header Parameters + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
Accept-LanguageStringNoSpecifies 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     version: String
+     *     referenceUtcTimestamp: String
+     *     timeZones: [
+     *         {
+     *             id: String
+     *             aliases: [
+     *                 String
+     *             ]
+     *             countries: [
+     *                 {
+     *                     name: String
+     *                     code: String
+     *                 }
+     *             ]
+     *             names: {
+     *                 iso6391LanguageCode: String
+     *                 generic: String
+     *                 standard: String
+     *                 daylight: String
+     *             }
+     *             referenceTime: {
+     *                 tag: String
+     *                 standardOffset: String
+     *                 daylightSavings: String
+     *                 wallTime: String
+     *                 posixTzValidYear: Integer
+     *                 posixTz: String
+     *                 sunrise: String
+     *                 sunset: String
+     *             }
+     *             representativePoint: {
+     *                 latitude: Float
+     *                 longitude: Float
+     *             }
+     *             timeTransitions: [
+     *                 {
+     *                     tag: String
+     *                     standardOffset: String
+     *                     daylightSavings: String
+     *                     utcStart: String
+     *                     utcEnd: String
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @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 getTimezoneByIdWithResponse(String format, RequestOptions requestOptions) { + return getTimezoneByIdWithResponseAsync(format, requestOptions).block(); + } + + /** + * __Time Zone by Coordinates__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
optionsStringNoAlternatively, use alias "o". Options available for types of information returned in the result.
timeStampStringNoAlternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the machine time serving the request.
transitionsFromStringNoAlternatively, use alias "tf". The start date from which daylight savings time (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
transitionsYearsStringNoAlternatively, use alias "ty". The number of years from "transitionsFrom" for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
queryStringYesCoordinates 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.
+ * + *

Header Parameters + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
Accept-LanguageStringNoSpecifies 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     version: String
+     *     referenceUtcTimestamp: String
+     *     timeZones: [
+     *         {
+     *             id: String
+     *             aliases: [
+     *                 String
+     *             ]
+     *             countries: [
+     *                 {
+     *                     name: String
+     *                     code: String
+     *                 }
+     *             ]
+     *             names: {
+     *                 iso6391LanguageCode: String
+     *                 generic: String
+     *                 standard: String
+     *                 daylight: String
+     *             }
+     *             referenceTime: {
+     *                 tag: String
+     *                 standardOffset: String
+     *                 daylightSavings: String
+     *                 wallTime: String
+     *                 posixTzValidYear: Integer
+     *                 posixTz: String
+     *                 sunrise: String
+     *                 sunset: String
+     *             }
+     *             representativePoint: {
+     *                 latitude: Float
+     *                 longitude: Float
+     *             }
+     *             timeTransitions: [
+     *                 {
+     *                     tag: String
+     *                     standardOffset: String
+     *                     daylightSavings: String
+     *                     utcStart: String
+     *                     utcEnd: String
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @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> getTimezoneByCoordinatesWithResponseAsync( + String format, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.getTimezoneByCoordinates( + this.client.getHost(), + this.client.getServiceVersion().getVersion(), + format, + requestOptions, + context)); + } + + /** + * __Time Zone by Coordinates__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
optionsStringNoAlternatively, use alias "o". Options available for types of information returned in the result.
timeStampStringNoAlternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the machine time serving the request.
transitionsFromStringNoAlternatively, use alias "tf". The start date from which daylight savings time (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
transitionsYearsStringNoAlternatively, use alias "ty". The number of years from "transitionsFrom" for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
queryStringYesCoordinates 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.
+ * + *

Header Parameters + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
Accept-LanguageStringNoSpecifies 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     version: String
+     *     referenceUtcTimestamp: String
+     *     timeZones: [
+     *         {
+     *             id: String
+     *             aliases: [
+     *                 String
+     *             ]
+     *             countries: [
+     *                 {
+     *                     name: String
+     *                     code: String
+     *                 }
+     *             ]
+     *             names: {
+     *                 iso6391LanguageCode: String
+     *                 generic: String
+     *                 standard: String
+     *                 daylight: String
+     *             }
+     *             referenceTime: {
+     *                 tag: String
+     *                 standardOffset: String
+     *                 daylightSavings: String
+     *                 wallTime: String
+     *                 posixTzValidYear: Integer
+     *                 posixTz: String
+     *                 sunrise: String
+     *                 sunset: String
+     *             }
+     *             representativePoint: {
+     *                 latitude: Float
+     *                 longitude: Float
+     *             }
+     *             timeTransitions: [
+     *                 {
+     *                     tag: String
+     *                     standardOffset: String
+     *                     daylightSavings: String
+     *                     utcStart: String
+     *                     utcEnd: String
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @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> getTimezoneByCoordinatesWithResponseAsync( + String format, RequestOptions requestOptions, Context context) { + return service.getTimezoneByCoordinates( + this.client.getHost(), this.client.getServiceVersion().getVersion(), format, requestOptions, context); + } + + /** + * __Time Zone by Coordinates__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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. + * + *

Query Parameters + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
optionsStringNoAlternatively, use alias "o". Options available for types of information returned in the result.
timeStampStringNoAlternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the machine time serving the request.
transitionsFromStringNoAlternatively, use alias "tf". The start date from which daylight savings time (DST) transitions are requested, only applies when "options" = all or "options" = transitions.
transitionsYearsStringNoAlternatively, use alias "ty". The number of years from "transitionsFrom" for which DST transitions are requested, only applies when "options" = all or "options" = transitions.
queryStringYesCoordinates 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.
+ * + *

Header Parameters + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
Accept-LanguageStringNoSpecifies 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     version: String
+     *     referenceUtcTimestamp: String
+     *     timeZones: [
+     *         {
+     *             id: String
+     *             aliases: [
+     *                 String
+     *             ]
+     *             countries: [
+     *                 {
+     *                     name: String
+     *                     code: String
+     *                 }
+     *             ]
+     *             names: {
+     *                 iso6391LanguageCode: String
+     *                 generic: String
+     *                 standard: String
+     *                 daylight: String
+     *             }
+     *             referenceTime: {
+     *                 tag: String
+     *                 standardOffset: String
+     *                 daylightSavings: String
+     *                 wallTime: String
+     *                 posixTzValidYear: Integer
+     *                 posixTz: String
+     *                 sunrise: String
+     *                 sunset: String
+     *             }
+     *             representativePoint: {
+     *                 latitude: Float
+     *                 longitude: Float
+     *             }
+     *             timeTransitions: [
+     *                 {
+     *                     tag: String
+     *                     standardOffset: String
+     *                     daylightSavings: String
+     *                     utcStart: String
+     *                     utcEnd: String
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @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 getTimezoneByCoordinatesWithResponse(String format, RequestOptions requestOptions) { + return getTimezoneByCoordinatesWithResponseAsync(format, requestOptions).block(); + } + + /** + * __Windows Time Zones__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API returns a full list of Windows Time Zone IDs. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * [
+     *     {
+     *         windowsId: String
+     *         territory: String
+     *         ianaIds: [
+     *             String
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @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> getWindowsTimezoneIdsWithResponseAsync( + String format, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.getWindowsTimezoneIds( + this.client.getHost(), + this.client.getServiceVersion().getVersion(), + format, + requestOptions, + context)); + } + + /** + * __Windows Time Zones__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API returns a full list of Windows Time Zone IDs. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * [
+     *     {
+     *         windowsId: String
+     *         territory: String
+     *         ianaIds: [
+     *             String
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @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> getWindowsTimezoneIdsWithResponseAsync( + String format, RequestOptions requestOptions, Context context) { + return service.getWindowsTimezoneIds( + this.client.getHost(), this.client.getServiceVersion().getVersion(), format, requestOptions, context); + } + + /** + * __Windows Time Zones__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API returns a full list of Windows Time Zone IDs. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * [
+     *     {
+     *         windowsId: String
+     *         territory: String
+     *         ianaIds: [
+     *             String
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Timezone Enum Windows call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWindowsTimezoneIdsWithResponse(String format, RequestOptions requestOptions) { + return getWindowsTimezoneIdsWithResponseAsync(format, requestOptions).block(); + } + + /** + * __IANA Time Zones__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * [
+     *     {
+     *         id: String
+     *         isAlias: Boolean
+     *         aliasOf: String
+     *         hasZone1970Location: Boolean
+     *     }
+     * ]
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @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> getIanaTimezoneIdsWithResponseAsync( + String format, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.getIanaTimezoneIds( + this.client.getHost(), + this.client.getServiceVersion().getVersion(), + format, + requestOptions, + context)); + } + + /** + * __IANA Time Zones__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * [
+     *     {
+     *         id: String
+     *         isAlias: Boolean
+     *         aliasOf: String
+     *         hasZone1970Location: Boolean
+     *     }
+     * ]
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @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> getIanaTimezoneIdsWithResponseAsync( + String format, RequestOptions requestOptions, Context context) { + return service.getIanaTimezoneIds( + this.client.getHost(), this.client.getServiceVersion().getVersion(), format, requestOptions, context); + } + + /** + * __IANA Time Zones__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * [
+     *     {
+     *         id: String
+     *         isAlias: Boolean
+     *         aliasOf: String
+     *         hasZone1970Location: Boolean
+     *     }
+     * ]
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Timezone Enum IANA call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getIanaTimezoneIdsWithResponse(String format, RequestOptions requestOptions) { + return getIanaTimezoneIdsWithResponseAsync(format, requestOptions).block(); + } + + /** + * __Time Zone IANA Version__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API returns the current IANA version number as Metadata. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     version: String
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @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> getIanaVersionWithResponseAsync(String format, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.getIanaVersion( + this.client.getHost(), + this.client.getServiceVersion().getVersion(), + format, + requestOptions, + context)); + } + + /** + * __Time Zone IANA Version__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API returns the current IANA version number as Metadata. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     version: String
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @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> getIanaVersionWithResponseAsync( + String format, RequestOptions requestOptions, Context context) { + return service.getIanaVersion( + this.client.getHost(), this.client.getServiceVersion().getVersion(), format, requestOptions, context); + } + + /** + * __Time Zone IANA Version__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

This API returns the current IANA version number as Metadata. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     version: String
+     * }
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Timezone IANA Version call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getIanaVersionWithResponse(String format, RequestOptions requestOptions) { + return getIanaVersionWithResponseAsync(format, requestOptions).block(); + } + + /** + * __Windows to IANA Time Zone__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
queryStringYesThe Windows time zone ID.
territoryStringNoWindows Time Zone territory code.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * [
+     *     {
+     *         id: String
+     *         isAlias: Boolean
+     *         aliasOf: String
+     *         hasZone1970Location: Boolean
+     *     }
+     * ]
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @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> convertWindowsTimezoneToIanaWithResponseAsync( + String format, RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> + service.convertWindowsTimezoneToIana( + this.client.getHost(), + this.client.getServiceVersion().getVersion(), + format, + requestOptions, + context)); + } + + /** + * __Windows to IANA Time Zone__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
queryStringYesThe Windows time zone ID.
territoryStringNoWindows Time Zone territory code.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * [
+     *     {
+     *         id: String
+     *         isAlias: Boolean
+     *         aliasOf: String
+     *         hasZone1970Location: Boolean
+     *     }
+     * ]
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @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> convertWindowsTimezoneToIanaWithResponseAsync( + String format, RequestOptions requestOptions, Context context) { + return service.convertWindowsTimezoneToIana( + this.client.getHost(), this.client.getServiceVersion().getVersion(), format, requestOptions, context); + } + + /** + * __Windows to IANA Time Zone__ + * + *

**Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier). + * + *

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. + * + *

Query Parameters + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
api-versionStringYesApi Version
queryStringYesThe Windows time zone ID.
territoryStringNoWindows Time Zone territory code.
+ * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-client-idStringNoSpecifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following [articles](https://aka.ms/amauthdetails) for guidance.
+ * + *

Response Body Schema + * + *

{@code
+     * [
+     *     {
+     *         id: String
+     *         isAlias: Boolean
+     *         aliasOf: String
+     *         hasZone1970Location: Boolean
+     *     }
+     * ]
+     * }
+ * + * @param format Desired format of the response. Only `json` format is supported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @return this object is returned from a successful Timezone Windows To IANA call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response convertWindowsTimezoneToIanaWithResponse(String format, RequestOptions requestOptions) { + return convertWindowsTimezoneToIanaWithResponseAsync(format, requestOptions).block(); + } +} diff --git a/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/package-info.java b/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/package-info.java new file mode 100644 index 000000000000..b1ead28a7cb4 --- /dev/null +++ b/sdk/maps/azure-maps-timezone/src/main/java/com/azure/maps/timezone/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for AzureMapsTimeZoneService. Azure Maps Time Zone REST APIs. */ +package com.azure.maps.timezone; diff --git a/sdk/maps/azure-maps-timezone/src/main/java/module-info.java b/sdk/maps/azure-maps-timezone/src/main/java/module-info.java new file mode 100644 index 000000000000..0fc3b9e5b3ed --- /dev/null +++ b/sdk/maps/azure-maps-timezone/src/main/java/module-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.maps.timezone { + requires transitive com.azure.core; + + exports com.azure.maps.timezone; +} diff --git a/sdk/maps/azure-maps-timezone/src/main/resources/azure-maps-timezone.properties b/sdk/maps/azure-maps-timezone/src/main/resources/azure-maps-timezone.properties new file mode 100644 index 000000000000..ca812989b4f2 --- /dev/null +++ b/sdk/maps/azure-maps-timezone/src/main/resources/azure-maps-timezone.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/ReadmeSamples.java b/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/ReadmeSamples.java new file mode 100644 index 000000000000..51e758a83199 --- /dev/null +++ b/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/ReadmeSamples.java @@ -0,0 +1,12 @@ +// 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; + +public final class ReadmeSamples { + public void readmeSamples() { + // BEGIN: com.azure.maps.timezone.readme + // END: com.azure.maps.timezone.readme + } +} diff --git a/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/generated/SuccessfullyRetrieveCorrespondingTimezoneIana.java b/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/generated/SuccessfullyRetrieveCorrespondingTimezoneIana.java new file mode 100644 index 000000000000..0e8d15053c8b --- /dev/null +++ b/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/generated/SuccessfullyRetrieveCorrespondingTimezoneIana.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.timezone.AzureMapsTimeZoneServiceClient; +import com.azure.maps.timezone.AzureMapsTimeZoneServiceClientBuilder; + +public class SuccessfullyRetrieveCorrespondingTimezoneIana { + public static void main(String[] args) { + AzureMapsTimeZoneServiceClient client = + new AzureMapsTimeZoneServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .host("https://atlas.microsoft.com") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam("query", "pacific standard time"); + Response response = client.convertWindowsTimezoneToIanaWithResponse("json", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/generated/SuccessfullyRetrieveIanaTimezoneIds.java b/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/generated/SuccessfullyRetrieveIanaTimezoneIds.java new file mode 100644 index 000000000000..ad91d74ea4de --- /dev/null +++ b/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/generated/SuccessfullyRetrieveIanaTimezoneIds.java @@ -0,0 +1,24 @@ +// 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.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.timezone.AzureMapsTimeZoneServiceClient; +import com.azure.maps.timezone.AzureMapsTimeZoneServiceClientBuilder; + +public class SuccessfullyRetrieveIanaTimezoneIds { + public static void main(String[] args) { + AzureMapsTimeZoneServiceClient client = + new AzureMapsTimeZoneServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .host("https://atlas.microsoft.com") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + Response response = client.getIanaTimezoneIdsWithResponse("json", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/generated/SuccessfullyRetrieveIanaVersionMetadata.java b/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/generated/SuccessfullyRetrieveIanaVersionMetadata.java new file mode 100644 index 000000000000..4ee66ba26655 --- /dev/null +++ b/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/generated/SuccessfullyRetrieveIanaVersionMetadata.java @@ -0,0 +1,24 @@ +// 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.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.timezone.AzureMapsTimeZoneServiceClient; +import com.azure.maps.timezone.AzureMapsTimeZoneServiceClientBuilder; + +public class SuccessfullyRetrieveIanaVersionMetadata { + public static void main(String[] args) { + AzureMapsTimeZoneServiceClient client = + new AzureMapsTimeZoneServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .host("https://atlas.microsoft.com") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + Response response = client.getIanaVersionWithResponse("json", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/generated/SuccessfullyRetrieveTimezoneByCoordinates.java b/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/generated/SuccessfullyRetrieveTimezoneByCoordinates.java new file mode 100644 index 000000000000..ad525b32b093 --- /dev/null +++ b/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/generated/SuccessfullyRetrieveTimezoneByCoordinates.java @@ -0,0 +1,26 @@ +// 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.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.timezone.AzureMapsTimeZoneServiceClient; +import com.azure.maps.timezone.AzureMapsTimeZoneServiceClientBuilder; + +public class SuccessfullyRetrieveTimezoneByCoordinates { + public static void main(String[] args) { + AzureMapsTimeZoneServiceClient client = + new AzureMapsTimeZoneServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .host("https://atlas.microsoft.com") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam("options", "all"); + requestOptions.addQueryParam("query", "47,-122"); + Response response = client.getTimezoneByCoordinatesWithResponse("json", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/generated/SuccessfullyRetrieveTimezoneByID.java b/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/generated/SuccessfullyRetrieveTimezoneByID.java new file mode 100644 index 000000000000..3b1356d4b4af --- /dev/null +++ b/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/generated/SuccessfullyRetrieveTimezoneByID.java @@ -0,0 +1,26 @@ +// 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.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.timezone.AzureMapsTimeZoneServiceClient; +import com.azure.maps.timezone.AzureMapsTimeZoneServiceClientBuilder; + +public class SuccessfullyRetrieveTimezoneByID { + public static void main(String[] args) { + AzureMapsTimeZoneServiceClient client = + new AzureMapsTimeZoneServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .host("https://atlas.microsoft.com") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + requestOptions.addQueryParam("options", "all"); + requestOptions.addQueryParam("query", "Asia/Bahrain"); + Response response = client.getTimezoneByIdWithResponse("json", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/generated/SuccessfullyRetrieveWindowsTimezoneIds.java b/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/generated/SuccessfullyRetrieveWindowsTimezoneIds.java new file mode 100644 index 000000000000..069502c3d823 --- /dev/null +++ b/sdk/maps/azure-maps-timezone/src/samples/java/com/azure/maps/timezone/generated/SuccessfullyRetrieveWindowsTimezoneIds.java @@ -0,0 +1,24 @@ +// 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.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.maps.timezone.AzureMapsTimeZoneServiceClient; +import com.azure.maps.timezone.AzureMapsTimeZoneServiceClientBuilder; + +public class SuccessfullyRetrieveWindowsTimezoneIds { + public static void main(String[] args) { + AzureMapsTimeZoneServiceClient client = + new AzureMapsTimeZoneServiceClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .host("https://atlas.microsoft.com") + .buildClient(); + RequestOptions requestOptions = new RequestOptions(); + Response response = client.getWindowsTimezoneIdsWithResponse("json", requestOptions); + } +} diff --git a/sdk/maps/azure-maps-timezone/src/test/java/com/azure/maps/timezone/ClientTests.java b/sdk/maps/azure-maps-timezone/src/test/java/com/azure/maps/timezone/ClientTests.java new file mode 100644 index 000000000000..bb0c045019af --- /dev/null +++ b/sdk/maps/azure-maps-timezone/src/test/java/com/azure/maps/timezone/ClientTests.java @@ -0,0 +1,50 @@ +// 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; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestBase; +import com.azure.core.test.TestMode; +import com.azure.core.test.annotation.DoNotRecord; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ClientTests extends TestBase { + private AzureMapsTimeZoneServiceClient azureMapsTimeZoneServiceClient; + + @BeforeEach + public void setup() { + AzureMapsTimeZoneServiceClientBuilder azureMapsTimeZoneServiceClientbuilder = + new AzureMapsTimeZoneServiceClientBuilder() + .host(Configuration.getGlobalConfiguration().get("HOST", "https://atlas.microsoft.com")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + azureMapsTimeZoneServiceClientbuilder + .httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + azureMapsTimeZoneServiceClientbuilder + .addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + azureMapsTimeZoneServiceClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + azureMapsTimeZoneServiceClient = azureMapsTimeZoneServiceClientbuilder.buildClient(); + } + + @Test + @DoNotRecord(skipInPlayback = true) + public void testClient() { + // use the builder to create client + } +} diff --git a/sdk/maps/azure-maps-timezone/swagger/README_SPEC.md b/sdk/maps/azure-maps-timezone/swagger/README_SPEC.md new file mode 100644 index 000000000000..f96b08d4c810 --- /dev/null +++ b/sdk/maps/azure-maps-timezone/swagger/README_SPEC.md @@ -0,0 +1,25 @@ +## Generate autorest code + +```yaml +input-files: +- /home/vsts/work/1/s/azure-rest-api-specs/specification/maps/data-plane/Timezone/preview/1.0/timezone.json +output-folder: ../ +java: true +regenerate-pom: false +partial-update: true +generate-sync-async-clients: true +generate-client-as-impl: true +generate-client-interfaces: false +generate-builder-per-client: true +add-context-parameter: true +artifact-id: azure-maps-timezone +low-level-client: true +sync-methods: all +generate-samples: true +license-header: MICROSOFT_MIT_SMALL +namespace: com.azure.maps.timezone +context-client-method-parameter: true +azure-arm: false +service-versions: +- '1.0' +```