diff --git a/sdk/iotcentral/mgmt-v2018_09_01/pom.xml b/sdk/iotcentral/mgmt-v2018_09_01/pom.xml index b2e9bef6d1e7..479b314aaee5 100644 --- a/sdk/iotcentral/mgmt-v2018_09_01/pom.xml +++ b/sdk/iotcentral/mgmt-v2018_09_01/pom.xml @@ -15,11 +15,11 @@ ../../../pom.management.xml azure-mgmt-iotcentral - 1.0.0-beta + 1.0.0 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 @@ -71,6 +71,8 @@ azure-arm-client-runtime test-jar test + + 1.6.5 diff --git a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/App.java b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/App.java index f51ff4e27af1..b36a7d0b2866 100644 --- a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/App.java +++ b/sdk/iotcentral/mgmt-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/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppNameUnavailabilityReason.java b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppNameUnavailabilityReason.java deleted file mode 100644 index 01ab6c857a61..000000000000 --- a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppNameUnavailabilityReason.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * 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.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Defines values for AppNameUnavailabilityReason. - */ -public enum AppNameUnavailabilityReason { - /** Enum value Invalid. */ - INVALID("Invalid"), - - /** Enum value AlreadyExists. */ - ALREADY_EXISTS("AlreadyExists"); - - /** The actual serialized value for a AppNameUnavailabilityReason instance. */ - private String value; - - AppNameUnavailabilityReason(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a AppNameUnavailabilityReason instance. - * - * @param value the serialized value to parse. - * @return the parsed AppNameUnavailabilityReason object, or null if unable to parse. - */ - @JsonCreator - public static AppNameUnavailabilityReason fromString(String value) { - AppNameUnavailabilityReason[] items = AppNameUnavailabilityReason.values(); - for (AppNameUnavailabilityReason item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppSku.java b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppSku.java index 7f2f66345bfb..1ceb80cec8fa 100644 --- a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppSku.java +++ b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppSku.java @@ -22,6 +22,15 @@ public final class AppSku extends ExpandableStringEnum { /** Static value S1 for AppSku. */ public static final AppSku S1 = fromString("S1"); + /** Static value ST0 for AppSku. */ + public static final AppSku ST0 = fromString("ST0"); + + /** Static value ST1 for AppSku. */ + public static final AppSku ST1 = fromString("ST1"); + + /** Static value ST2 for AppSku. */ + public static final AppSku ST2 = fromString("ST2"); + /** * Creates or finds a AppSku from its string representation. * @param name a name to look for diff --git a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppSkuInfo.java b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppSkuInfo.java index 44c1c9815f70..3a501dac8a90 100644 --- a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppSkuInfo.java +++ b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppSkuInfo.java @@ -15,13 +15,14 @@ */ public class AppSkuInfo { /** - * The name of the SKU. Possible values include: 'F1', 'S1'. + * The name of the SKU. Possible values include: 'F1', 'S1', 'ST0', 'ST1', + * 'ST2'. */ @JsonProperty(value = "name", required = true) private AppSku name; /** - * Get the name of the SKU. Possible values include: 'F1', 'S1'. + * Get the name of the SKU. Possible values include: 'F1', 'S1', 'ST0', 'ST1', 'ST2'. * * @return the name value */ @@ -30,7 +31,7 @@ public AppSku name() { } /** - * Set the name of the SKU. Possible values include: 'F1', 'S1'. + * Set the name of the SKU. Possible values include: 'F1', 'S1', 'ST0', 'ST1', 'ST2'. * * @param name the name value to set * @return the AppSkuInfo object itself. diff --git a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppNameAvailabilityInfo.java b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppTemplate.java similarity index 51% rename from sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppNameAvailabilityInfo.java rename to sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppTemplate.java index d6cf9fec610a..274c36c81fec 100644 --- a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppNameAvailabilityInfo.java +++ b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppTemplate.java @@ -11,25 +11,40 @@ 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.AppNameAvailabilityInfoInner; +import com.microsoft.azure.management.iotcentral.v2018_09_01.implementation.AppTemplateInner; /** - * Type representing AppNameAvailabilityInfo. + * Type representing AppTemplate. */ -public interface AppNameAvailabilityInfo extends HasInner, HasManager { +public interface AppTemplate extends HasInner, HasManager { /** - * @return the message value. + * @return the appTemplateName value. */ - String message(); + String appTemplateName(); /** - * @return the nameAvailable value. + * @return the description value. */ - Boolean nameAvailable(); + String description(); /** - * @return the reason value. + * @return the manifestId value. */ - AppNameUnavailabilityReason reason(); + String manifestId(); + + /** + * @return the manifestVersion value. + */ + String manifestVersion(); + + /** + * @return the order value. + */ + Double order(); + + /** + * @return the title value. + */ + String title(); } diff --git a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/Apps.java b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/Apps.java index deec27d18075..5b749808f2ff 100644 --- a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/Apps.java +++ b/sdk/iotcentral/mgmt-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/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/NameAvailabilityInputs.java b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/NameAvailabilityInputs.java deleted file mode 100644 index ae0e3c6414d0..000000000000 --- a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/NameAvailabilityInputs.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * 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; - -/** - * Input values. - */ -public class NameAvailabilityInputs { - /** - * The name of the IoT Central application instance to check. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /** - * The type of the IoT Central resource to query. - */ - @JsonProperty(value = "type") - private String type; - - /** - * Get the name of the IoT Central application instance to check. - * - * @return the name value - */ - public String name() { - return this.name; - } - - /** - * Set the name of the IoT Central application instance to check. - * - * @param name the name value to set - * @return the NameAvailabilityInputs object itself. - */ - public NameAvailabilityInputs withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type of the IoT Central resource to query. - * - * @return the type value - */ - public String type() { - return this.type; - } - - /** - * Set the type of the IoT Central resource to query. - * - * @param type the type value to set - * @return the NameAvailabilityInputs object itself. - */ - public NameAvailabilityInputs withType(String type) { - this.type = type; - return this; - } - -} diff --git a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/SubdomainAvailabilityInputs.java b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/SubdomainAvailabilityInputs.java deleted file mode 100644 index ad53cb471be4..000000000000 --- a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/SubdomainAvailabilityInputs.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * 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; - -/** - * Input values. - */ -public class SubdomainAvailabilityInputs { - /** - * The subdomain of the IoT Central application instance to check. - */ - @JsonProperty(value = "subdomain", required = true) - private String subdomain; - - /** - * The type of the IoT Central resource to query. - */ - @JsonProperty(value = "type") - private String type; - - /** - * Get the subdomain of the IoT Central application instance to check. - * - * @return the subdomain value - */ - public String subdomain() { - return this.subdomain; - } - - /** - * Set the subdomain of the IoT Central application instance to check. - * - * @param subdomain the subdomain value to set - * @return the SubdomainAvailabilityInputs object itself. - */ - public SubdomainAvailabilityInputs withSubdomain(String subdomain) { - this.subdomain = subdomain; - return this; - } - - /** - * Get the type of the IoT Central resource to query. - * - * @return the type value - */ - public String type() { - return this.type; - } - - /** - * Set the type of the IoT Central resource to query. - * - * @param type the type value to set - * @return the SubdomainAvailabilityInputs object itself. - */ - public SubdomainAvailabilityInputs withType(String type) { - this.type = type; - return this; - } - -} diff --git a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppNameAvailabilityInfoInner.java b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppNameAvailabilityInfoInner.java deleted file mode 100644 index cac83d5ca21f..000000000000 --- a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppNameAvailabilityInfoInner.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * 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.AppNameUnavailabilityReason; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The properties indicating whether a given IoT Central application name is - * available. - */ -public class AppNameAvailabilityInfoInner { - /** - * The value which indicates whether the provided name is available. - */ - @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) - private Boolean nameAvailable; - - /** - * The reason for unavailability. Possible values include: 'Invalid', - * 'AlreadyExists'. - */ - @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) - private AppNameUnavailabilityReason reason; - - /** - * The detailed reason message. - */ - @JsonProperty(value = "message") - private String message; - - /** - * Get the value which indicates whether the provided name is available. - * - * @return the nameAvailable value - */ - public Boolean nameAvailable() { - return this.nameAvailable; - } - - /** - * Get the reason for unavailability. Possible values include: 'Invalid', 'AlreadyExists'. - * - * @return the reason value - */ - public AppNameUnavailabilityReason reason() { - return this.reason; - } - - /** - * Get the detailed reason message. - * - * @return the message value - */ - public String message() { - return this.message; - } - - /** - * Set the detailed reason message. - * - * @param message the message value to set - * @return the AppNameAvailabilityInfoInner object itself. - */ - public AppNameAvailabilityInfoInner withMessage(String message) { - this.message = message; - return this; - } - -} diff --git a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppNameAvailabilityInfoImpl.java b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppTemplateImpl.java similarity index 50% rename from sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppNameAvailabilityInfoImpl.java rename to sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppTemplateImpl.java index d68656e3d487..c4369f12ac04 100644 --- a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppNameAvailabilityInfoImpl.java +++ b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppTemplateImpl.java @@ -8,13 +8,12 @@ package com.microsoft.azure.management.iotcentral.v2018_09_01.implementation; -import com.microsoft.azure.management.iotcentral.v2018_09_01.AppNameAvailabilityInfo; +import com.microsoft.azure.management.iotcentral.v2018_09_01.AppTemplate; import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import com.microsoft.azure.management.iotcentral.v2018_09_01.AppNameUnavailabilityReason; -class AppNameAvailabilityInfoImpl extends WrapperImpl implements AppNameAvailabilityInfo { +class AppTemplateImpl extends WrapperImpl implements AppTemplate { private final IoTCentralManager manager; - AppNameAvailabilityInfoImpl(AppNameAvailabilityInfoInner inner, IoTCentralManager manager) { + AppTemplateImpl(AppTemplateInner inner, IoTCentralManager manager) { super(inner); this.manager = manager; } @@ -25,18 +24,33 @@ public IoTCentralManager manager() { } @Override - public String message() { - return this.inner().message(); + public String appTemplateName() { + return this.inner().appTemplateName(); } @Override - public Boolean nameAvailable() { - return this.inner().nameAvailable(); + public String description() { + return this.inner().description(); } @Override - public AppNameUnavailabilityReason reason() { - return this.inner().reason(); + 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/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppTemplateInner.java b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppTemplateInner.java new file mode 100644 index 000000000000..c1bdc2e593e9 --- /dev/null +++ b/sdk/iotcentral/mgmt-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/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsImpl.java b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsImpl.java index 537fc693efa6..f2b622a042b7 100644 --- a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsImpl.java +++ b/sdk/iotcentral/mgmt-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/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsInner.java b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsInner.java index f551023b24b2..2aaa8f1deacd 100644 --- a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppsInner.java +++ b/sdk/iotcentral/mgmt-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/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/IotCentralClientImpl.java b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/IotCentralClientImpl.java index 39bad0a45afa..05afaa100cd8 100644 --- a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/IotCentralClientImpl.java +++ b/sdk/iotcentral/mgmt-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"); } }