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 b36a7d0b2866..f33a4a8d411d 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 @@ -130,7 +130,7 @@ interface WithCreate extends Creatable, Resource.DefinitionWithTags, Resource.UpdateWithTags, UpdateStages.WithDisplayName, UpdateStages.WithSubdomain, UpdateStages.WithTemplate { + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDisplayName, UpdateStages.WithSku, UpdateStages.WithSubdomain, UpdateStages.WithTemplate { } /** @@ -149,6 +149,18 @@ interface WithDisplayName { Update withDisplayName(String displayName); } + /** + * The stage of the app update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku A valid instance SKU + * @return the next update stage + */ + Update withSku(AppSkuInfo sku); + } + /** * The stage of the app update allowing to specify Subdomain. */ diff --git a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppPatch.java b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppPatch.java index 87cbc43fd52d..9bfed46302eb 100644 --- a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppPatch.java +++ b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/AppPatch.java @@ -23,6 +23,12 @@ public class AppPatch { @JsonProperty(value = "tags") private Map tags; + /** + * A valid instance SKU. + */ + @JsonProperty(value = "sku") + private AppSkuInfo sku; + /** * The ID of the application. */ @@ -70,6 +76,26 @@ public AppPatch withTags(Map tags) { return this; } + /** + * Get a valid instance SKU. + * + * @return the sku value + */ + public AppSkuInfo sku() { + return this.sku; + } + + /** + * Set a valid instance SKU. + * + * @param sku the sku value to set + * @return the AppPatch object itself. + */ + public AppPatch withSku(AppSkuInfo sku) { + this.sku = sku; + return this; + } + /** * Get the ID of the application. * diff --git a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/ErrorDetails.java b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/ErrorDetails.java deleted file mode 100644 index 708471461f70..000000000000 --- a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/ErrorDetails.java +++ /dev/null @@ -1,91 +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 java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.rest.serializer.JsonFlatten; - -/** - * Error details. - */ -@JsonFlatten -public class ErrorDetails { - /** - * The error code. - */ - @JsonProperty(value = "error.code", access = JsonProperty.Access.WRITE_ONLY) - private String code; - - /** - * The error message. - */ - @JsonProperty(value = "error.message", access = JsonProperty.Access.WRITE_ONLY) - private String message; - - /** - * The target of the particular error. - */ - @JsonProperty(value = "error.target", access = JsonProperty.Access.WRITE_ONLY) - private String target; - - /** - * A list of additional details about the error. - */ - @JsonProperty(value = "error.details") - private List details; - - /** - * Get the error code. - * - * @return the code value - */ - public String code() { - return this.code; - } - - /** - * Get the error message. - * - * @return the message value - */ - public String message() { - return this.message; - } - - /** - * Get the target of the particular error. - * - * @return the target value - */ - public String target() { - return this.target; - } - - /** - * Get a list of additional details about the error. - * - * @return the details value - */ - public List details() { - return this.details; - } - - /** - * Set a list of additional details about the error. - * - * @param details the details value to set - * @return the ErrorDetails object itself. - */ - public ErrorDetails withDetails(List details) { - this.details = details; - return this; - } - -} diff --git a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/ErrorDetailsException.java b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/ErrorDetailsException.java deleted file mode 100644 index d6d9c28f291a..000000000000 --- a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/ErrorDetailsException.java +++ /dev/null @@ -1,44 +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.microsoft.rest.RestException; -import okhttp3.ResponseBody; -import retrofit2.Response; - -/** - * Exception thrown for an invalid response with ErrorDetails information. - */ -public class ErrorDetailsException extends RestException { - /** - * Initializes a new instance of the ErrorDetailsException class. - * - * @param message the exception message or the response content if a message is not available - * @param response the HTTP response - */ - public ErrorDetailsException(final String message, final Response response) { - super(message, response); - } - - /** - * Initializes a new instance of the ErrorDetailsException class. - * - * @param message the exception message or the response content if a message is not available - * @param response the HTTP response - * @param body the deserialized response body - */ - public ErrorDetailsException(final String message, final Response response, final ErrorDetails body) { - super(message, response, body); - } - - @Override - public ErrorDetails body() { - return (ErrorDetails) super.body(); - } -} diff --git a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/ErrorResponseBody.java b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/ErrorResponseBody.java deleted file mode 100644 index a7b6c9d7730a..000000000000 --- a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/ErrorResponseBody.java +++ /dev/null @@ -1,89 +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 java.util.List; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Details of error response. - */ -public class ErrorResponseBody { - /** - * The error code. - */ - @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) - private String code; - - /** - * The error message. - */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) - private String message; - - /** - * The target of the particular error. - */ - @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) - private String target; - - /** - * A list of additional details about the error. - */ - @JsonProperty(value = "details") - private List details; - - /** - * Get the error code. - * - * @return the code value - */ - public String code() { - return this.code; - } - - /** - * Get the error message. - * - * @return the message value - */ - public String message() { - return this.message; - } - - /** - * Get the target of the particular error. - * - * @return the target value - */ - public String target() { - return this.target; - } - - /** - * Get a list of additional details about the error. - * - * @return the details value - */ - public List details() { - return this.details; - } - - /** - * Set a list of additional details about the error. - * - * @param details the details value to set - * @return the ErrorResponseBody object itself. - */ - public ErrorResponseBody withDetails(List details) { - this.details = details; - return this; - } - -} diff --git a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppImpl.java b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppImpl.java index 7e5706ebecca..8ea8e01a91a6 100644 --- a/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppImpl.java +++ b/sdk/iotcentral/mgmt-v2018_09_01/src/main/java/com/microsoft/azure/management/iotcentral/v2018_09_01/implementation/AppImpl.java @@ -92,7 +92,11 @@ public String template() { @Override public AppImpl withSku(AppSkuInfo sku) { - this.inner().withSku(sku); + if (isInCreateMode()) { + this.inner().withSku(sku); + } else { + this.updateParameter.withSku(sku); + } return this; }