Skip to content

Commit

Permalink
Features/maps/timezonenameupdate (#31394)
Browse files Browse the repository at this point in the history
* TimeZone Java SDK
  • Loading branch information
khmic5 authored Oct 14, 2022
1 parent bc904cc commit c543505
Show file tree
Hide file tree
Showing 71 changed files with 636 additions and 597 deletions.
2 changes: 1 addition & 1 deletion sdk/maps/azure-maps-timezone/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 1.0.0-beta.1 (2022-10-01)
## 1.0.0-beta.1 (2022-10-11)

- Azure Maps SDK Timezone client library for Java. This package contains the Azure Maps SDK Timezone library. Package tag 1.0.0-beta.1. For documentation on how to use this package, please see [Microsoft Azure SDK for Timezone SDK](https://docs.microsoft.com/rest/api/maps/timezone).

6 changes: 3 additions & 3 deletions sdk/maps/azure-maps-timezone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ With above configuration, `azure` client can be authenticated by following code:
DefaultAzureCredential tokenCredential = new DefaultAzureCredentialBuilder().build();

// Creates a client
TimezoneClient client = new TimezoneClientBuilder()
TimeZoneClient client = new TimeZoneClientBuilder()
.credential(tokenCredential)
.timezoneClientId(System.getenv("MAPS_CLIENT_ID"))
.buildClient();
Expand All @@ -72,14 +72,14 @@ See [API design][design] for general introduction on design and key concepts on
## Examples
Get Timezone By Id
```java com.azure.maps.timezone.sync.get_timezone_by_id
TimezoneIdOptions options = new TimezoneIdOptions("Asia/Bahrain").setOptions(TimezoneOptions.ALL);
TimeZoneIdOptions options = new TimeZoneIdOptions("Asia/Bahrain").setOptions(TimeZoneOptions.ALL);
client.getTimezoneById(options);
```

Get Timezone By Coordinates
```java com.azure.maps.timezone.sync.get_timezone_by_coordinates
GeoPosition cd = new GeoPosition(-122, 47.0);
TimezoneCoordinateOptions op = new TimezoneCoordinateOptions(cd).setTimezoneOptions(TimezoneOptions.ALL);
TimeZoneCoordinateOptions op = new TimeZoneCoordinateOptions(cd).setTimezoneOptions(TimeZoneOptions.ALL);
client.getTimezoneByCoordinates(op);
```

Expand Down
35 changes: 35 additions & 0 deletions sdk/maps/azure-maps-timezone/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.

trigger:
branches:
include:
- main
- hotfix/*
- release/*
paths:
include:
- sdk/maps/azure-maps-timezone/
exclude:
- sdk/maps/azure-maps-timezone/pom.xml
pr:
branches:
include:
- main
- feature/*
- hotfix/*
- release/*
paths:
include:
- sdk/maps/azure-maps-timezone/

exclude:
- sdk/maps/azure-maps-timezone/pom.xml

extends:
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
ServiceDirectory: maps
Artifacts:
- name: azure-maps-timezone
groupId: com.azure
safeName: azuremapstimezone
Original file line number Diff line number Diff line change
Expand Up @@ -14,49 +14,49 @@
import com.azure.maps.timezone.implementation.helper.Utility;
import com.azure.maps.timezone.implementation.models.ErrorResponseException;
import com.azure.maps.timezone.models.IanaId;
import com.azure.maps.timezone.models.TimezoneCoordinateOptions;
import com.azure.maps.timezone.models.TimezoneIdOptions;
import com.azure.maps.timezone.models.TimeZoneCoordinateOptions;
import com.azure.maps.timezone.models.TimeZoneIdOptions;
import com.azure.maps.timezone.implementation.models.JsonFormat;
import com.azure.maps.timezone.models.TimezoneIanaVersionResult;
import com.azure.maps.timezone.models.TimezoneResult;
import com.azure.maps.timezone.models.TimezoneWindows;
import com.azure.maps.timezone.models.TimeZoneIanaVersionResult;
import com.azure.maps.timezone.models.TimeZoneResult;
import com.azure.maps.timezone.models.TimeZoneWindows;
import java.util.List;
import reactor.core.publisher.Mono;

/** Initializes a new instance of the asynchronous TimezoneClient type.
/** Initializes a new instance of the asynchronous TimeZoneClient type.
* Creating an async client using a {@link com.azure.core.credential.AzureKeyCredential}:
* <!-- src_embed com.azure.maps.timezone.async.builder.key.instantiation -->
* <pre>
* &#47;&#47; Authenticates using subscription key
* AzureKeyCredential keyCredential = new AzureKeyCredential&#40;System.getenv&#40;&quot;SUBSCRIPTION_KEY&quot;&#41;&#41;;
*
* &#47;&#47; Creates a client
* TimezoneAsyncClient asyncClient = new TimezoneClientBuilder&#40;&#41;
* TimeZoneAsyncClient asyncClient = new TimeZoneClientBuilder&#40;&#41;
* .credential&#40;keyCredential&#41;
* .timezoneClientId&#40;System.getenv&#40;&quot;MAPS_CLIENT_ID&quot;&#41;&#41;
* .buildAsyncClient&#40;&#41;;
*
* </pre>
* <!-- end com.azure.maps.timezone.async.builder.key.instantiation -->
*/
@ServiceClient(builder = TimezoneClientBuilder.class, isAsync = true)
public final class TimezoneAsyncClient {
@ServiceClient(builder = TimeZoneClientBuilder.class, isAsync = true)
public final class TimeZoneAsyncClient {
private final TimezonesImpl serviceClient;

/**
* Initializes an instance of TimezoneClient client.
* Initializes an instance of TimeZoneClient client.
*
* @param serviceClient the service client implementation.
*/
TimezoneAsyncClient(TimezonesImpl serviceClient) {
TimeZoneAsyncClient(TimezonesImpl serviceClient) {
this.serviceClient = serviceClient;
}

/**
* __Time Zone by Id__
* <!-- src_embed com.azure.maps.timezone.async.get_timezone_by_id -->
* <pre>
* TimezoneIdOptions options2 = new TimezoneIdOptions&#40;&quot;Asia&#47;Bahrain&quot;&#41;.setOptions&#40;TimezoneOptions.ALL&#41;;
* TimeZoneIdOptions options2 = new TimeZoneIdOptions&#40;&quot;Asia&#47;Bahrain&quot;&#41;.setOptions&#40;TimeZoneOptions.ALL&#41;;
* asyncClient.getTimezoneById&#40;options2&#41;;
* </pre>
* <!-- end om.azure.maps.timezone.async.get_timezone_by_id -->
Expand All @@ -72,8 +72,8 @@ public final class TimezoneAsyncClient {
* @return this object is returned from a successful Timezone By ID call or By Coordinates call.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<TimezoneResult> getTimezoneById(TimezoneIdOptions options) {
Mono<Response<TimezoneResult>> result = this.getTimezoneByIdWithResponse(options);
public Mono<TimeZoneResult> getTimezoneById(TimeZoneIdOptions options) {
Mono<Response<TimeZoneResult>> result = this.getTimezoneByIdWithResponse(options);
return result.flatMap(response -> {
return Mono.just(response.getValue());
});
Expand All @@ -83,7 +83,7 @@ public Mono<TimezoneResult> getTimezoneById(TimezoneIdOptions options) {
* __Time Zone by Id__
* <!-- src_embed com.azure.maps.timezone.async.get_timezone_by_id -->
* <pre>
* TimezoneIdOptions options2 = new TimezoneIdOptions&#40;&quot;Asia&#47;Bahrain&quot;&#41;.setOptions&#40;TimezoneOptions.ALL&#41;;
* TimeZoneIdOptions options2 = new TimeZoneIdOptions&#40;&quot;Asia&#47;Bahrain&quot;&#41;.setOptions&#40;TimeZoneOptions.ALL&#41;;
* asyncClient.getTimezoneById&#40;options2&#41;;
* </pre>
* <!-- end om.azure.maps.timezone.async.get_timezone_by_id -->
Expand All @@ -99,15 +99,15 @@ public Mono<TimezoneResult> getTimezoneById(TimezoneIdOptions options) {
* @return this object is returned from a successful Timezone By ID call or By Coordinates call.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<TimezoneResult>> getTimezoneByIdWithResponse(TimezoneIdOptions options) {
public Mono<Response<TimeZoneResult>> getTimezoneByIdWithResponse(TimeZoneIdOptions options) {
return this.getTimezoneByIdWithResponse(options, null);
}

/**
* __Time Zone by Id__
* <!-- src_embed com.azure.maps.timezone.async.get_timezone_by_id -->
* <pre>
* TimezoneIdOptions options2 = new TimezoneIdOptions&#40;&quot;Asia&#47;Bahrain&quot;&#41;.setOptions&#40;TimezoneOptions.ALL&#41;;
* TimeZoneIdOptions options2 = new TimeZoneIdOptions&#40;&quot;Asia&#47;Bahrain&quot;&#41;.setOptions&#40;TimeZoneOptions.ALL&#41;;
* asyncClient.getTimezoneById&#40;options2&#41;;
* </pre>
* <!-- end om.azure.maps.timezone.async.get_timezone_by_id -->
Expand All @@ -123,7 +123,7 @@ public Mono<Response<TimezoneResult>> getTimezoneByIdWithResponse(TimezoneIdOpti
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return this object is returned from a successful Timezone By ID call or By Coordinates call.
*/
Mono<Response<TimezoneResult>> getTimezoneByIdWithResponse(TimezoneIdOptions options, Context context) {
Mono<Response<TimeZoneResult>> getTimezoneByIdWithResponse(TimeZoneIdOptions options, Context context) {
return this.serviceClient.getTimezoneByIDWithResponseAsync(
JsonFormat.JSON,
options.getTimezoneId(),
Expand All @@ -146,7 +146,7 @@ Mono<Response<TimezoneResult>> getTimezoneByIdWithResponse(TimezoneIdOptions opt
* <!-- src_embed com.azure.maps.timezone.async.get_timezone_by_coordinates -->
* <pre>
* GeoPosition c2 = new GeoPosition&#40;-122, 47.0&#41;;
* TimezoneCoordinateOptions op2 = new TimezoneCoordinateOptions&#40;c2&#41;.setTimezoneOptions&#40;TimezoneOptions.ALL&#41;;
* TimeZoneCoordinateOptions op2 = new TimeZoneCoordinateOptions&#40;c2&#41;.setTimezoneOptions&#40;TimeZoneOptions.ALL&#41;;
* asyncClient.getTimezoneByCoordinates&#40;op2&#41;;
* </pre>
* <!-- end com.azure.maps.timezone.async.get_timezone_by_coordinates -->
Expand All @@ -163,8 +163,8 @@ Mono<Response<TimezoneResult>> getTimezoneByIdWithResponse(TimezoneIdOptions opt
* @return this object is returned from a successful Timezone By ID call or By Coordinates call.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<TimezoneResult> getTimezoneByCoordinates(TimezoneCoordinateOptions options) {
Mono<Response<TimezoneResult>> result = this.getTimezoneByCoordinatesWithResponse(options);
public Mono<TimeZoneResult> getTimezoneByCoordinates(TimeZoneCoordinateOptions options) {
Mono<Response<TimeZoneResult>> result = this.getTimezoneByCoordinatesWithResponse(options);
return result.flatMap(response -> {
return Mono.just(response.getValue());
});
Expand All @@ -175,7 +175,7 @@ public Mono<TimezoneResult> getTimezoneByCoordinates(TimezoneCoordinateOptions o
* <!-- src_embed com.azure.maps.timezone.async.get_timezone_by_coordinates -->
* <pre>
* GeoPosition c2 = new GeoPosition&#40;-122, 47.0&#41;;
* TimezoneCoordinateOptions op2 = new TimezoneCoordinateOptions&#40;c2&#41;.setTimezoneOptions&#40;TimezoneOptions.ALL&#41;;
* TimeZoneCoordinateOptions op2 = new TimeZoneCoordinateOptions&#40;c2&#41;.setTimezoneOptions&#40;TimeZoneOptions.ALL&#41;;
* asyncClient.getTimezoneByCoordinates&#40;op2&#41;;
* </pre>
* <!-- end com.azure.maps.timezone.async.get_timezone_by_coordinates -->
Expand All @@ -192,7 +192,7 @@ public Mono<TimezoneResult> getTimezoneByCoordinates(TimezoneCoordinateOptions o
* @return this object is returned from a successful Timezone By ID call or By Coordinates call.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<TimezoneResult>> getTimezoneByCoordinatesWithResponse(TimezoneCoordinateOptions options) {
public Mono<Response<TimeZoneResult>> getTimezoneByCoordinatesWithResponse(TimeZoneCoordinateOptions options) {
return this.getTimezoneByCoordinatesWithResponse(options, null);
}

Expand All @@ -201,7 +201,7 @@ public Mono<Response<TimezoneResult>> getTimezoneByCoordinatesWithResponse(Timez
* <!-- src_embed com.azure.maps.timezone.async.get_timezone_by_coordinates -->
* <pre>
* GeoPosition c2 = new GeoPosition&#40;-122, 47.0&#41;;
* TimezoneCoordinateOptions op2 = new TimezoneCoordinateOptions&#40;c2&#41;.setTimezoneOptions&#40;TimezoneOptions.ALL&#41;;
* TimeZoneCoordinateOptions op2 = new TimeZoneCoordinateOptions&#40;c2&#41;.setTimezoneOptions&#40;TimeZoneOptions.ALL&#41;;
* asyncClient.getTimezoneByCoordinates&#40;op2&#41;;
* </pre>
* <!-- end com.azure.maps.timezone.async.get_timezone_by_coordinates -->
Expand All @@ -218,7 +218,7 @@ public Mono<Response<TimezoneResult>> getTimezoneByCoordinatesWithResponse(Timez
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return this object is returned from a successful Timezone By ID call or By Coordinates call.
*/
Mono<Response<TimezoneResult>> getTimezoneByCoordinatesWithResponse(TimezoneCoordinateOptions options, Context context) {
Mono<Response<TimeZoneResult>> getTimezoneByCoordinatesWithResponse(TimeZoneCoordinateOptions options, Context context) {
return this.serviceClient.getTimezoneByCoordinatesWithResponseAsync(
JsonFormat.JSON,
Utility.toCoordinateList(options.getPosition()),
Expand Down Expand Up @@ -254,8 +254,8 @@ Mono<Response<TimezoneResult>> getTimezoneByCoordinatesWithResponse(TimezoneCoor
* @return this object is returned from a successful Timezone Enum Windows call.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<List<TimezoneWindows>> getWindowsTimezoneIds() {
Mono<Response<List<TimezoneWindows>>> result = this.getWindowsTimezoneIdsWithResponse();
public Mono<List<TimeZoneWindows>> getWindowsTimezoneIds() {
Mono<Response<List<TimeZoneWindows>>> result = this.getWindowsTimezoneIdsWithResponse();
return result.flatMap(response -> {
return Mono.just(response.getValue());
});
Expand All @@ -279,7 +279,7 @@ public Mono<List<TimezoneWindows>> getWindowsTimezoneIds() {
* @return this object is returned from a successful Timezone Enum Windows call.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<List<TimezoneWindows>>> getWindowsTimezoneIdsWithResponse() {
public Mono<Response<List<TimeZoneWindows>>> getWindowsTimezoneIdsWithResponse() {
return this.getWindowsTimezoneIdsWithResponse(null);
}

Expand All @@ -301,7 +301,7 @@ public Mono<Response<List<TimezoneWindows>>> getWindowsTimezoneIdsWithResponse()
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return this object is returned from a successful Timezone Enum Windows call.
*/
Mono<Response<List<TimezoneWindows>>> getWindowsTimezoneIdsWithResponse(Context context) {
Mono<Response<List<TimeZoneWindows>>> getWindowsTimezoneIdsWithResponse(Context context) {
return this.serviceClient.getWindowsTimezoneIdsWithResponseAsync(JsonFormat.JSON, context).onErrorMap(throwable -> {
if (!(throwable instanceof ErrorResponseException)) {
return throwable;
Expand Down Expand Up @@ -407,8 +407,8 @@ Mono<Response<List<IanaId>>> getIanaTimezoneIdsWithResponse(Context context) {
* @return this object is returned from a successful Timezone IANA Version call.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<TimezoneIanaVersionResult> getIanaVersion() {
Mono<Response<TimezoneIanaVersionResult>> result = this.getIanaVersionWithResponse();
public Mono<TimeZoneIanaVersionResult> getIanaVersion() {
Mono<Response<TimeZoneIanaVersionResult>> result = this.getIanaVersionWithResponse();
return result.flatMap(response -> {
return Mono.just(response.getValue());
});
Expand All @@ -432,7 +432,7 @@ public Mono<TimezoneIanaVersionResult> getIanaVersion() {
* @return this object is returned from a successful Timezone IANA Version call.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<TimezoneIanaVersionResult>> getIanaVersionWithResponse() {
public Mono<Response<TimeZoneIanaVersionResult>> getIanaVersionWithResponse() {
return this.getIanaVersionWithResponse(null);
}

Expand All @@ -454,7 +454,7 @@ public Mono<Response<TimezoneIanaVersionResult>> getIanaVersionWithResponse() {
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return this object is returned from a successful Timezone IANA Version call.
*/
Mono<Response<TimezoneIanaVersionResult>> getIanaVersionWithResponse(Context context) {
Mono<Response<TimeZoneIanaVersionResult>> getIanaVersionWithResponse(Context context) {
return this.serviceClient.getIanaVersionWithResponseAsync(JsonFormat.JSON, context).onErrorMap(throwable -> {
if (!(throwable instanceof ErrorResponseException)) {
return throwable;
Expand Down
Loading

0 comments on commit c543505

Please sign in to comment.