diff --git a/iotcentral/resource-manager/v2017_07_01_privatepreview/pom.xml b/iotcentral/resource-manager/v2017_07_01_privatepreview/pom.xml index 6e349a466fd6b..660ec60b31805 100644 --- a/iotcentral/resource-manager/v2017_07_01_privatepreview/pom.xml +++ b/iotcentral/resource-manager/v2017_07_01_privatepreview/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 1.0.0 + 0.0.3-beta ../../../pom.xml azure-mgmt-iotcentral @@ -19,7 +19,7 @@ jar Microsoft Azure SDK for IoTCentral Management This package contains Microsoft IoTCentral Management SDK. - https://github.com/Azure/azure-libraries-for-java + https://github.com/Azure/azure-sdk-for-java The MIT License (MIT) @@ -28,8 +28,8 @@ - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git HEAD diff --git a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/App.java b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/App.java index f14a7be9ced65..4695571735d18 100644 --- a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/App.java +++ b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/App.java @@ -77,36 +77,44 @@ interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup, Resource.UpdateWithTags, Update */ interface UpdateStages { /** - * The stage of the app {0} allowing to specify DisplayName. + * The stage of the app update allowing to specify DisplayName. */ interface WithDisplayName { /** * Specifies displayName. + * @param displayName The display name of the application + * @return the next update stage */ Update withDisplayName(String displayName); } /** - * The stage of the app {0} allowing to specify Subdomain. + * The stage of the app update allowing to specify Subdomain. */ interface WithSubdomain { /** * Specifies subdomain. + * @param subdomain The subdomain of the application + * @return the next update stage */ Update withSubdomain(String subdomain); } /** - * The stage of the app {0} allowing to specify Template. + * The stage of the app update allowing to specify Template. */ interface WithTemplate { /** * Specifies template. + * @param template The ID of the application template, which is a blueprint that defines the characteristics and behaviors of an application. Optional; if not specified, defaults to a blank blueprint and allows the application to be defined from scratch + * @return the next update stage */ Update withTemplate(String template); } diff --git a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/IotCentralClientImpl.java b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/IotCentralClientImpl.java index 1abd0722bf63e..a4b60888a031b 100644 --- a/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/IotCentralClientImpl.java +++ b/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/IotCentralClientImpl.java @@ -63,11 +63,11 @@ public String apiVersion() { return this.apiVersion; } - /** Gets or sets the preferred language for the response. */ + /** The preferred language for the response. */ private String acceptLanguage; /** - * Gets Gets or sets the preferred language for the response. + * Gets The preferred language for the response. * * @return the acceptLanguage value. */ @@ -76,7 +76,7 @@ public String acceptLanguage() { } /** - * Sets Gets or sets the preferred language for the response. + * Sets The preferred language for the response. * * @param acceptLanguage the acceptLanguage value. * @return the service client itself @@ -86,11 +86,11 @@ public IotCentralClientImpl withAcceptLanguage(String acceptLanguage) { return this; } - /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ private int longRunningOperationRetryTimeout; /** - * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. * * @return the longRunningOperationRetryTimeout value. */ @@ -99,7 +99,7 @@ public int longRunningOperationRetryTimeout() { } /** - * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. * * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. * @return the service client itself @@ -109,11 +109,11 @@ public IotCentralClientImpl withLongRunningOperationRetryTimeout(int longRunning return this; } - /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ private boolean generateClientRequestId; /** - * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * * @return the generateClientRequestId value. */ @@ -122,7 +122,7 @@ public boolean generateClientRequestId() { } /** - * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * * @param generateClientRequestId the generateClientRequestId value. * @return the service client itself @@ -205,6 +205,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "IotCentralClient", "2017-07-01-privatepreview"); + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "IotCentralClient", "2017-07-01-privatepreview"); } } diff --git a/iotcentral/resource-manager/v2018_09_01/pom.xml b/iotcentral/resource-manager/v2018_09_01/pom.xml index df7f0323b95e3..1b9dce2d1bde6 100644 --- a/iotcentral/resource-manager/v2018_09_01/pom.xml +++ b/iotcentral/resource-manager/v2018_09_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 1.0.0 + 0.0.3-beta ../../../pom.xml azure-mgmt-iotcentral @@ -19,7 +19,7 @@ jar Microsoft Azure SDK for IoTCentral Management This package contains Microsoft IoTCentral Management SDK. - https://github.com/Azure/azure-libraries-for-java + https://github.com/Azure/azure-sdk-for-java The MIT License (MIT) @@ -28,8 +28,8 @@ - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git HEAD diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/App.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/App.java index f51ff4e27af1a..b36a7d0b2866e 100644 --- a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/App.java +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/App.java @@ -77,36 +77,44 @@ interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup, Resource.UpdateWithTags, Update */ interface UpdateStages { /** - * The stage of the app {0} allowing to specify DisplayName. + * The stage of the app update allowing to specify DisplayName. */ interface WithDisplayName { /** * Specifies displayName. + * @param displayName The display name of the application + * @return the next update stage */ Update withDisplayName(String displayName); } /** - * The stage of the app {0} allowing to specify Subdomain. + * The stage of the app update allowing to specify Subdomain. */ interface WithSubdomain { /** * Specifies subdomain. + * @param subdomain The subdomain of the application + * @return the next update stage */ Update withSubdomain(String subdomain); } /** - * The stage of the app {0} allowing to specify Template. + * The stage of the app update allowing to specify Template. */ interface WithTemplate { /** * Specifies template. + * @param template The ID of the application template, which is a blueprint that defines the characteristics and behaviors of an application. Optional; if not specified, defaults to a blank blueprint and allows the application to be defined from scratch + * @return the next update stage */ Update withTemplate(String template); } diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppTemplate.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppTemplate.java new file mode 100644 index 0000000000000..274c36c81fecc --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppTemplate.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.iotcentral.v2018_09_01.implementation.IoTCentralManager; +import com.microsoft.azure.management.iotcentral.v2018_09_01.implementation.AppTemplateInner; + +/** + * Type representing AppTemplate. + */ +public interface AppTemplate extends HasInner, HasManager { + /** + * @return the appTemplateName value. + */ + String appTemplateName(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the manifestId value. + */ + String manifestId(); + + /** + * @return the manifestVersion value. + */ + String manifestVersion(); + + /** + * @return the order value. + */ + Double order(); + + /** + * @return the title value. + */ + String title(); + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppTemplateProperties.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppTemplateProperties.java new file mode 100644 index 0000000000000..70fe95b06d3d6 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppTemplateProperties.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IoT Central Application Template extra properties. + */ +public class AppTemplateProperties { + /** + * The ID of the template. + */ + @JsonProperty(value = "manifestId", access = JsonProperty.Access.WRITE_ONLY) + private String manifestId; + + /** + * The version of the template. + */ + @JsonProperty(value = "manifestVersion", access = JsonProperty.Access.WRITE_ONLY) + private String manifestVersion; + + /** + * The name of the template. + */ + @JsonProperty(value = "appTemplateName", access = JsonProperty.Access.WRITE_ONLY) + private String appTemplateName; + + /** + * The title of the template. + */ + @JsonProperty(value = "title", access = JsonProperty.Access.WRITE_ONLY) + private String title; + + /** + * The order of the template in the templates list. + */ + @JsonProperty(value = "order", access = JsonProperty.Access.WRITE_ONLY) + private Double order; + + /** + * The description of the template. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the ID of the template. + * + * @return the manifestId value + */ + public String manifestId() { + return this.manifestId; + } + + /** + * Get the version of the template. + * + * @return the manifestVersion value + */ + public String manifestVersion() { + return this.manifestVersion; + } + + /** + * Get the name of the template. + * + * @return the appTemplateName value + */ + public String appTemplateName() { + return this.appTemplateName; + } + + /** + * Get the title of the template. + * + * @return the title value + */ + public String title() { + return this.title; + } + + /** + * Get the order of the template in the templates list. + * + * @return the order value + */ + public Double order() { + return this.order; + } + + /** + * Get the description of the template. + * + * @return the description value + */ + public String description() { + return this.description; + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/Apps.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/Apps.java index deec27d18075e..5b749808f2ff3 100644 --- a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/Apps.java +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/Apps.java @@ -40,4 +40,12 @@ public interface Apps extends SupportsCreating, Supp */ Observable checkSubdomainAvailabilityAsync(OperationInputs operationInputs); + /** + * Get all available application templates. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listTemplatesAsync(); + } diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppTemplateImpl.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppTemplateImpl.java new file mode 100644 index 0000000000000..c4369f12ac048 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppTemplateImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01.implementation; + +import com.microsoft.azure.management.iotcentral.v2018_09_01.AppTemplate; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class AppTemplateImpl extends WrapperImpl implements AppTemplate { + private final IoTCentralManager manager; + AppTemplateImpl(AppTemplateInner inner, IoTCentralManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public IoTCentralManager manager() { + return this.manager; + } + + @Override + public String appTemplateName() { + return this.inner().appTemplateName(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String manifestId() { + return this.inner().manifestId(); + } + + @Override + public String manifestVersion() { + return this.inner().manifestVersion(); + } + + @Override + public Double order() { + return this.inner().order(); + } + + @Override + public String title() { + return this.inner().title(); + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppTemplateInner.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppTemplateInner.java new file mode 100644 index 0000000000000..c1bdc2e593e91 --- /dev/null +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppTemplateInner.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.iotcentral.v2018_09_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IoT Central Application Template. + */ +public class AppTemplateInner { + /** + * The ID of the template. + */ + @JsonProperty(value = "manifestId", access = JsonProperty.Access.WRITE_ONLY) + private String manifestId; + + /** + * The version of the template. + */ + @JsonProperty(value = "manifestVersion", access = JsonProperty.Access.WRITE_ONLY) + private String manifestVersion; + + /** + * The name of the template. + */ + @JsonProperty(value = "appTemplateName", access = JsonProperty.Access.WRITE_ONLY) + private String appTemplateName; + + /** + * The title of the template. + */ + @JsonProperty(value = "title", access = JsonProperty.Access.WRITE_ONLY) + private String title; + + /** + * The order of the template in the templates list. + */ + @JsonProperty(value = "order", access = JsonProperty.Access.WRITE_ONLY) + private Double order; + + /** + * The description of the template. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the ID of the template. + * + * @return the manifestId value + */ + public String manifestId() { + return this.manifestId; + } + + /** + * Get the version of the template. + * + * @return the manifestVersion value + */ + public String manifestVersion() { + return this.manifestVersion; + } + + /** + * Get the name of the template. + * + * @return the appTemplateName value + */ + public String appTemplateName() { + return this.appTemplateName; + } + + /** + * Get the title of the template. + * + * @return the title value + */ + public String title() { + return this.title; + } + + /** + * Get the order of the template in the templates list. + * + * @return the order value + */ + public Double order() { + return this.order; + } + + /** + * Get the description of the template. + * + * @return the description value + */ + public String description() { + return this.description; + } + +} diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsImpl.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsImpl.java index 537fc693efa61..f2b622a042b7b 100644 --- a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsImpl.java +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsImpl.java @@ -23,6 +23,7 @@ import com.microsoft.azure.PagedList; import com.microsoft.azure.Page; import com.microsoft.azure.management.iotcentral.v2018_09_01.AppAvailabilityInfo; +import com.microsoft.azure.management.iotcentral.v2018_09_01.AppTemplate; import com.microsoft.azure.management.iotcentral.v2018_09_01.OperationInputs; class AppsImpl extends GroupableResourcesCoreImpl implements Apps { @@ -151,6 +152,24 @@ public AppAvailabilityInfo call(AppAvailabilityInfoInner inner) { }); } + @Override + public Observable listTemplatesAsync() { + AppsInner client = this.inner(); + return client.listTemplatesAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AppTemplate call(AppTemplateInner inner) { + return new AppTemplateImpl(inner, manager()); + } + }); + } + @Override protected AppImpl wrapModel(AppInner inner) { return new AppImpl(inner.name(), inner, manager()); diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsInner.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsInner.java index f551023b24b2a..2aaa8f1deacdd 100644 --- a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsInner.java +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsInner.java @@ -112,6 +112,10 @@ interface AppsService { @POST("subscriptions/{subscriptionId}/providers/Microsoft.IoTCentral/checkSubdomainAvailability") Observable> checkSubdomainAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body OperationInputs operationInputs, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2018_09_01.Apps listTemplates" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.IoTCentral/appTemplates") + Observable> listTemplates(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2018_09_01.Apps listNext" }) @GET Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -120,6 +124,10 @@ interface AppsService { @GET Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.iotcentral.v2018_09_01.Apps listTemplatesNext" }) + @GET + Observable> listTemplatesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** @@ -1090,6 +1098,113 @@ private ServiceResponse checkSubdomainAvailabilityDele .build(response); } + /** + * Get all available application templates. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AppTemplateInner> object if successful. + */ + public PagedList listTemplates() { + ServiceResponse> response = listTemplatesSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listTemplatesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all available application templates. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listTemplatesAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listTemplatesSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listTemplatesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all available application templates. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AppTemplateInner> object + */ + public Observable> listTemplatesAsync() { + return listTemplatesWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all available application templates. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AppTemplateInner> object + */ + public Observable>> listTemplatesWithServiceResponseAsync() { + return listTemplatesSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listTemplatesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all available application templates. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AppTemplateInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listTemplatesSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listTemplates(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listTemplatesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listTemplatesDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsException.class) + .build(response); + } + /** * Get all IoT Central Applications in a subscription. * @@ -1312,4 +1427,115 @@ private ServiceResponse> listByResourceGroupNextDelegate(Resp .build(response); } + /** + * Get all available application templates. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorDetailsException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AppTemplateInner> object if successful. + */ + public PagedList listTemplatesNext(final String nextPageLink) { + ServiceResponse> response = listTemplatesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listTemplatesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all available application templates. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listTemplatesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listTemplatesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listTemplatesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all available application templates. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AppTemplateInner> object + */ + public Observable> listTemplatesNextAsync(final String nextPageLink) { + return listTemplatesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all available application templates. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AppTemplateInner> object + */ + public Observable>> listTemplatesNextWithServiceResponseAsync(final String nextPageLink) { + return listTemplatesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listTemplatesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all available application templates. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AppTemplateInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listTemplatesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listTemplatesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listTemplatesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listTemplatesNextDelegate(Response response) throws ErrorDetailsException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorDetailsException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorDetailsException.class) + .build(response); + } + } diff --git a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/IotCentralClientImpl.java b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/IotCentralClientImpl.java index 39bad0a45afae..05afaa100cd86 100644 --- a/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/IotCentralClientImpl.java +++ b/iotcentral/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/IotCentralClientImpl.java @@ -63,11 +63,11 @@ public String apiVersion() { return this.apiVersion; } - /** Gets or sets the preferred language for the response. */ + /** The preferred language for the response. */ private String acceptLanguage; /** - * Gets Gets or sets the preferred language for the response. + * Gets The preferred language for the response. * * @return the acceptLanguage value. */ @@ -76,7 +76,7 @@ public String acceptLanguage() { } /** - * Sets Gets or sets the preferred language for the response. + * Sets The preferred language for the response. * * @param acceptLanguage the acceptLanguage value. * @return the service client itself @@ -86,11 +86,11 @@ public IotCentralClientImpl withAcceptLanguage(String acceptLanguage) { return this; } - /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ private int longRunningOperationRetryTimeout; /** - * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. * * @return the longRunningOperationRetryTimeout value. */ @@ -99,7 +99,7 @@ public int longRunningOperationRetryTimeout() { } /** - * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. * * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. * @return the service client itself @@ -109,11 +109,11 @@ public IotCentralClientImpl withLongRunningOperationRetryTimeout(int longRunning return this; } - /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ private boolean generateClientRequestId; /** - * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * * @return the generateClientRequestId value. */ @@ -122,7 +122,7 @@ public boolean generateClientRequestId() { } /** - * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * * @param generateClientRequestId the generateClientRequestId value. * @return the service client itself @@ -205,6 +205,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "IotCentralClient", "2018-09-01"); + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "IotCentralClient", "2018-09-01"); } }