diff --git a/sdk/avs/mgmt-v2019_08_09_preview/pom.xml b/sdk/avs/mgmt-v2019_08_09_preview/pom.xml index 3c443679eb21..1834c947f390 100644 --- a/sdk/avs/mgmt-v2019_08_09_preview/pom.xml +++ b/sdk/avs/mgmt-v2019_08_09_preview/pom.xml @@ -11,8 +11,8 @@ com.microsoft.azure azure-arm-parent - 1.3.0 - ../../parents/azure-arm-parent/pom.xml + 1.1.0 + ../../../pom.management.xml azure-mgmt-avs 1.0.0-beta diff --git a/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/Cluster.java b/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/Cluster.java index add6dd8dc057..fb4ae28eb2d6 100644 --- a/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/Cluster.java +++ b/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/Cluster.java @@ -17,7 +17,6 @@ import com.microsoft.azure.arm.model.Creatable; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.avs.v2019_08_09_preview.implementation.AVSManager; -import java.util.List; /** * Type representing Cluster. @@ -46,7 +45,7 @@ public interface Cluster extends HasInner, Indexable, Refreshable< /** * The entirety of the Cluster definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithPrivateCloud, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithPrivateCloud, DefinitionStages.WithCreate { } /** @@ -69,18 +68,18 @@ interface WithPrivateCloud { * @param privateCloudName The name of the private cloud * @return the next definition stage */ - WithProperties withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); } /** * The stage of the cluster definition allowing to specify Properties. */ interface WithProperties { - /** - * Specifies properties. - * @param properties The properties of a cluster resource - * @return the next definition stage - */ + /** + * Specifies properties. + * @param properties The properties of a cluster resource + * @return the next definition stage + */ WithCreate withProperties(ClusterProperties properties); } @@ -89,7 +88,7 @@ interface WithProperties { * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable { + interface WithCreate extends Creatable, DefinitionStages.WithProperties { } } /** diff --git a/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/DefaultClusterProperties.java b/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/DefaultClusterProperties.java index 9eeb01b9f3fe..9484c7f9c605 100644 --- a/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/DefaultClusterProperties.java +++ b/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/DefaultClusterProperties.java @@ -15,6 +15,12 @@ * The properties of a default cluster. */ public class DefaultClusterProperties { + /** + * The deprecated identity. + */ + @JsonProperty(value = "clusterID", access = JsonProperty.Access.WRITE_ONLY) + private Integer clusterID; + /** * The identity. */ @@ -33,6 +39,15 @@ public class DefaultClusterProperties { @JsonProperty(value = "hosts", access = JsonProperty.Access.WRITE_ONLY) private List hosts; + /** + * Get the deprecated identity. + * + * @return the clusterID value + */ + public Integer clusterID() { + return this.clusterID; + } + /** * Get the identity. * diff --git a/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/LogSpecification.java b/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/LogSpecification.java new file mode 100644 index 000000000000..bb1818e10f4d --- /dev/null +++ b/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/LogSpecification.java @@ -0,0 +1,95 @@ +/** + * 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.avs.v2019_08_09_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifications of the Log for Azure Monitoring. + */ +public class LogSpecification { + /** + * Name of the log. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Localized friendly display name of the log. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Blob duration of the log. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get name of the log. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the log. + * + * @param name the name value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get localized friendly display name of the log. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set localized friendly display name of the log. + * + * @param displayName the displayName value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get blob duration of the log. + * + * @return the blobDuration value + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set blob duration of the log. + * + * @param blobDuration the blobDuration value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + +} diff --git a/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/MetricDimension.java b/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/MetricDimension.java new file mode 100644 index 000000000000..a806ac40fa74 --- /dev/null +++ b/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/MetricDimension.java @@ -0,0 +1,69 @@ +/** + * 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.avs.v2019_08_09_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifications of the Dimension of metrics. + */ +public class MetricDimension { + /** + * Name of the dimension. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Localized friendly display name of the dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get name of the dimension. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the dimension. + * + * @param name the name value to set + * @return the MetricDimension object itself. + */ + public MetricDimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get localized friendly display name of the dimension. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set localized friendly display name of the dimension. + * + * @param displayName the displayName value to set + * @return the MetricDimension object itself. + */ + public MetricDimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + +} diff --git a/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/MetricSpecification.java b/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/MetricSpecification.java new file mode 100644 index 000000000000..81f8b7d99ea6 --- /dev/null +++ b/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/MetricSpecification.java @@ -0,0 +1,359 @@ +/** + * 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.avs.v2019_08_09_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifications of the Metrics for Azure Monitoring. + */ +public class MetricSpecification { + /** + * Name of the metric. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Localized friendly display name of the metric. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Localized friendly description of the metric. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /** + * Unit that makes sense for the metric. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Name of the metric category that the metric belongs to. A metric can + * only belong to a single category. + */ + @JsonProperty(value = "category") + private String category; + + /** + * Only provide one value for this field. Valid values: Average, Minimum, + * Maximum, Total, Count. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /** + * Supported aggregation types. + */ + @JsonProperty(value = "supportedAggregationTypes") + private List supportedAggregationTypes; + + /** + * Supported time grain types. + */ + @JsonProperty(value = "supportedTimeGrainTypes") + private List supportedTimeGrainTypes; + + /** + * Optional. If set to true, then zero will be returned for time duration + * where no metric is emitted/published. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /** + * Dimensions of the metric. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Whether or not the service is using regional MDM accounts. + */ + @JsonProperty(value = "enableRegionalMdmAccount") + private String enableRegionalMdmAccount; + + /** + * The name of the MDM account. + */ + @JsonProperty(value = "sourceMdmAccount") + private String sourceMdmAccount; + + /** + * The name of the MDM namespace. + */ + @JsonProperty(value = "sourceMdmNamespace") + private String sourceMdmNamespace; + + /** + * Get name of the metric. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the metric. + * + * @param name the name value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get localized friendly display name of the metric. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set localized friendly display name of the metric. + * + * @param displayName the displayName value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get localized friendly description of the metric. + * + * @return the displayDescription value + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set localized friendly description of the metric. + * + * @param displayDescription the displayDescription value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get unit that makes sense for the metric. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set unit that makes sense for the metric. + * + * @param unit the unit value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get name of the metric category that the metric belongs to. A metric can only belong to a single category. + * + * @return the category value + */ + public String category() { + return this.category; + } + + /** + * Set name of the metric category that the metric belongs to. A metric can only belong to a single category. + * + * @param category the category value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. + * + * @return the aggregationType value + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. + * + * @param aggregationType the aggregationType value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get supported aggregation types. + * + * @return the supportedAggregationTypes value + */ + public List supportedAggregationTypes() { + return this.supportedAggregationTypes; + } + + /** + * Set supported aggregation types. + * + * @param supportedAggregationTypes the supportedAggregationTypes value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedAggregationTypes(List supportedAggregationTypes) { + this.supportedAggregationTypes = supportedAggregationTypes; + return this; + } + + /** + * Get supported time grain types. + * + * @return the supportedTimeGrainTypes value + */ + public List supportedTimeGrainTypes() { + return this.supportedTimeGrainTypes; + } + + /** + * Set supported time grain types. + * + * @param supportedTimeGrainTypes the supportedTimeGrainTypes value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedTimeGrainTypes(List supportedTimeGrainTypes) { + this.supportedTimeGrainTypes = supportedTimeGrainTypes; + return this; + } + + /** + * Get optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. + * + * @return the fillGapWithZero value + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. + * + * @param fillGapWithZero the fillGapWithZero value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get dimensions of the metric. + * + * @return the dimensions value + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set dimensions of the metric. + * + * @param dimensions the dimensions value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get whether or not the service is using regional MDM accounts. + * + * @return the enableRegionalMdmAccount value + */ + public String enableRegionalMdmAccount() { + return this.enableRegionalMdmAccount; + } + + /** + * Set whether or not the service is using regional MDM accounts. + * + * @param enableRegionalMdmAccount the enableRegionalMdmAccount value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withEnableRegionalMdmAccount(String enableRegionalMdmAccount) { + this.enableRegionalMdmAccount = enableRegionalMdmAccount; + return this; + } + + /** + * Get the name of the MDM account. + * + * @return the sourceMdmAccount value + */ + public String sourceMdmAccount() { + return this.sourceMdmAccount; + } + + /** + * Set the name of the MDM account. + * + * @param sourceMdmAccount the sourceMdmAccount value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSourceMdmAccount(String sourceMdmAccount) { + this.sourceMdmAccount = sourceMdmAccount; + return this; + } + + /** + * Get the name of the MDM namespace. + * + * @return the sourceMdmNamespace value + */ + public String sourceMdmNamespace() { + return this.sourceMdmNamespace; + } + + /** + * Set the name of the MDM namespace. + * + * @param sourceMdmNamespace the sourceMdmNamespace value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSourceMdmNamespace(String sourceMdmNamespace) { + this.sourceMdmNamespace = sourceMdmNamespace; + return this; + } + +} diff --git a/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/Operation.java b/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/Operation.java index 22a23f218157..77ffdfc6f4d3 100644 --- a/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/Operation.java +++ b/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/Operation.java @@ -22,9 +22,24 @@ public interface Operation extends HasInner, HasManager logSpecifications; + + /** + * Specifications of the Metrics for Azure Monitoring. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get specifications of the Log for Azure Monitoring. + * + * @return the logSpecifications value + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set specifications of the Log for Azure Monitoring. + * + * @param logSpecifications the logSpecifications value to set + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withLogSpecifications(List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Get specifications of the Metrics for Azure Monitoring. + * + * @return the metricSpecifications value + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set specifications of the Metrics for Azure Monitoring. + * + * @param metricSpecifications the metricSpecifications value to set + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + +} diff --git a/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/implementation/ClusterImpl.java b/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/implementation/ClusterImpl.java index 9140acc2174b..be1f37f89ffa 100644 --- a/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/implementation/ClusterImpl.java +++ b/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/implementation/ClusterImpl.java @@ -12,16 +12,12 @@ import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; import rx.Observable; import com.microsoft.azure.management.avs.v2019_08_09_preview.ClusterProperties; -import java.util.List; -import rx.functions.Func1; class ClusterImpl extends CreatableUpdatableImpl implements Cluster, Cluster.Definition, Cluster.Update { private final AVSManager manager; private String resourceGroupName; private String privateCloudName; private String clusterName; - private ClusterProperties cproperties; - private ClusterProperties uproperties; ClusterImpl(String name, AVSManager manager) { super(name, new ClusterInner()); @@ -29,8 +25,6 @@ class ClusterImpl extends CreatableUpdatableImpl createResourceAsync() { ClustersInner client = this.manager().inner().clusters(); - return client.createOrUpdateAsync(this.resourceGroupName, this.privateCloudName, this.clusterName, this.cproperties) - .map(new Func1() { - @Override - public ClusterInner call(ClusterInner resource) { - resetCreateUpdateParameters(); - return resource; - } - }) + return client.createOrUpdateAsync(this.resourceGroupName, this.privateCloudName, this.clusterName, this.inner()) .map(innerToFluentMap(this)); } @Override public Observable updateResourceAsync() { ClustersInner client = this.manager().inner().clusters(); - return client.updateAsync(this.resourceGroupName, this.privateCloudName, this.clusterName, this.uproperties) - .map(new Func1() { - @Override - public ClusterInner call(ClusterInner resource) { - resetCreateUpdateParameters(); - return resource; - } - }) + return client.updateAsync(this.resourceGroupName, this.privateCloudName, this.clusterName, this.inner()) .map(innerToFluentMap(this)); } @@ -91,10 +69,6 @@ public boolean isInCreateMode() { return this.inner().id() == null; } - private void resetCreateUpdateParameters() { - this.cproperties = new ClusterProperties(); - this.uproperties = new ClusterProperties(); - } @Override public String id() { @@ -125,11 +99,7 @@ public ClusterImpl withExistingPrivateCloud(String resourceGroupName, String pri @Override public ClusterImpl withProperties(ClusterProperties properties) { - if (isInCreateMode()) { - this.cproperties = properties; - } else { - this.uproperties = properties; - } + this.inner().withProperties(properties); return this; } diff --git a/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/implementation/ClustersInner.java b/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/implementation/ClustersInner.java index 80ca8e864b5b..fc38a284b325 100644 --- a/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/implementation/ClustersInner.java +++ b/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/implementation/ClustersInner.java @@ -13,7 +13,6 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.ListOperationCallback; import com.microsoft.azure.management.avs.v2019_08_09_preview.ApiErrorException; -import com.microsoft.azure.management.avs.v2019_08_09_preview.ClusterProperties; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -73,19 +72,19 @@ interface ClustersService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2019_08_09_preview.Clusters createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}") - Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterInner cluster, @Header("User-Agent") String userAgent); + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("clusterName") String clusterName, @Body ClusterInner cluster, @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.avs.v2019_08_09_preview.Clusters beginCreateOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}") - Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterInner cluster, @Header("User-Agent") String userAgent); + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("clusterName") String clusterName, @Body ClusterInner cluster, @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.avs.v2019_08_09_preview.Clusters update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}") - Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterInner cluster, @Header("User-Agent") String userAgent); + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("clusterName") String clusterName, @Body ClusterInner cluster, @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.avs.v2019_08_09_preview.Clusters beginUpdate" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}") - Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterInner cluster, @Header("User-Agent") String userAgent); + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("clusterName") String clusterName, @Body ClusterInner cluster, @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.avs.v2019_08_09_preview.Clusters delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}", method = "DELETE", hasBody = true) @@ -323,13 +322,14 @@ private ServiceResponse getDelegate(Response respons * @param resourceGroupName Name of the resource group within the Azure subscription * @param privateCloudName The name of the private cloud. * @param clusterName Name of the cluster in the private cloud + * @param cluster A cluster in the private cloud * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ApiErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ClusterInner object if successful. */ - public ClusterInner createOrUpdate(String resourceGroupName, String privateCloudName, String clusterName) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName).toBlocking().last().body(); + public ClusterInner createOrUpdate(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster).toBlocking().last().body(); } /** @@ -338,12 +338,13 @@ public ClusterInner createOrUpdate(String resourceGroupName, String privateCloud * @param resourceGroupName Name of the resource group within the Azure subscription * @param privateCloudName The name of the private cloud. * @param clusterName Name of the cluster in the private cloud + * @param cluster A cluster in the private cloud * @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 createOrUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName), serviceCallback); + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster), serviceCallback); } /** @@ -352,11 +353,12 @@ public ServiceFuture createOrUpdateAsync(String resourceGroupName, * @param resourceGroupName Name of the resource group within the Azure subscription * @param privateCloudName The name of the private cloud. * @param clusterName Name of the cluster in the private cloud + * @param cluster A cluster in the private cloud * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable createOrUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName).map(new Func1, ClusterInner>() { + public Observable createOrUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster).map(new Func1, ClusterInner>() { @Override public ClusterInner call(ServiceResponse response) { return response.body(); @@ -370,10 +372,11 @@ public ClusterInner call(ServiceResponse response) { * @param resourceGroupName Name of the resource group within the Azure subscription * @param privateCloudName The name of the private cloud. * @param clusterName Name of the cluster in the private cloud + * @param cluster A cluster in the private cloud * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String clusterName) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -386,95 +389,14 @@ public Observable> createOrUpdateWithServiceRespon if (clusterName == null) { throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final ClusterProperties properties = null; - ClusterInner cluster = new ClusterInner(); - cluster.withProperties(null); - Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, privateCloudName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), cluster, this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); - } - /** - * Create or update a cluster in a private cloud. - * - * @param resourceGroupName Name of the resource group within the Azure subscription - * @param privateCloudName The name of the private cloud. - * @param clusterName Name of the cluster in the private cloud - * @param properties The properties of a cluster resource - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ClusterInner object if successful. - */ - public ClusterInner createOrUpdate(String resourceGroupName, String privateCloudName, String clusterName, ClusterProperties properties) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, properties).toBlocking().last().body(); - } - - /** - * Create or update a cluster in a private cloud. - * - * @param resourceGroupName Name of the resource group within the Azure subscription - * @param privateCloudName The name of the private cloud. - * @param clusterName Name of the cluster in the private cloud - * @param properties The properties of a cluster resource - * @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 createOrUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterProperties properties, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, properties), serviceCallback); - } - - /** - * Create or update a cluster in a private cloud. - * - * @param resourceGroupName Name of the resource group within the Azure subscription - * @param privateCloudName The name of the private cloud. - * @param clusterName Name of the cluster in the private cloud - * @param properties The properties of a cluster resource - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable createOrUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterProperties properties) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, properties).map(new Func1, ClusterInner>() { - @Override - public ClusterInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create or update a cluster in a private cloud. - * - * @param resourceGroupName Name of the resource group within the Azure subscription - * @param privateCloudName The name of the private cloud. - * @param clusterName Name of the cluster in the private cloud - * @param properties The properties of a cluster resource - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterProperties properties) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (privateCloudName == null) { - throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); - } - if (clusterName == null) { - throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + if (cluster == null) { + throw new IllegalArgumentException("Parameter cluster is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - Validator.validate(properties); - ClusterInner cluster = new ClusterInner(); - cluster.withProperties(properties); - Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, privateCloudName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), cluster, this.client.userAgent()); + Validator.validate(cluster); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, privateCloudName, clusterName, cluster, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -484,13 +406,14 @@ public Observable> createOrUpdateWithServiceRespon * @param resourceGroupName Name of the resource group within the Azure subscription * @param privateCloudName The name of the private cloud. * @param clusterName Name of the cluster in the private cloud + * @param cluster A cluster in the private cloud * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ApiErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ClusterInner object if successful. */ - public ClusterInner beginCreateOrUpdate(String resourceGroupName, String privateCloudName, String clusterName) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName).toBlocking().single().body(); + public ClusterInner beginCreateOrUpdate(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster).toBlocking().single().body(); } /** @@ -499,12 +422,13 @@ public ClusterInner beginCreateOrUpdate(String resourceGroupName, String private * @param resourceGroupName Name of the resource group within the Azure subscription * @param privateCloudName The name of the private cloud. * @param clusterName Name of the cluster in the private cloud + * @param cluster A cluster in the private cloud * @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 beginCreateOrUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName), serviceCallback); + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster), serviceCallback); } /** @@ -513,11 +437,12 @@ public ServiceFuture beginCreateOrUpdateAsync(String resourceGroup * @param resourceGroupName Name of the resource group within the Azure subscription * @param privateCloudName The name of the private cloud. * @param clusterName Name of the cluster in the private cloud + * @param cluster A cluster in the private cloud * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ClusterInner object */ - public Observable beginCreateOrUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName).map(new Func1, ClusterInner>() { + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster).map(new Func1, ClusterInner>() { @Override public ClusterInner call(ServiceResponse response) { return response.body(); @@ -531,10 +456,11 @@ public ClusterInner call(ServiceResponse response) { * @param resourceGroupName Name of the resource group within the Azure subscription * @param privateCloudName The name of the private cloud. * @param clusterName Name of the cluster in the private cloud + * @param cluster A cluster in the private cloud * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ClusterInner object */ - public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String clusterName) { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -547,106 +473,14 @@ public Observable> beginCreateOrUpdateWithServiceR if (clusterName == null) { throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final ClusterProperties properties = null; - ClusterInner cluster = new ClusterInner(); - cluster.withProperties(null); - return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, privateCloudName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), cluster, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * Create or update a cluster in a private cloud. - * - * @param resourceGroupName Name of the resource group within the Azure subscription - * @param privateCloudName The name of the private cloud. - * @param clusterName Name of the cluster in the private cloud - * @param properties The properties of a cluster resource - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ClusterInner object if successful. - */ - public ClusterInner beginCreateOrUpdate(String resourceGroupName, String privateCloudName, String clusterName, ClusterProperties properties) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, properties).toBlocking().single().body(); - } - - /** - * Create or update a cluster in a private cloud. - * - * @param resourceGroupName Name of the resource group within the Azure subscription - * @param privateCloudName The name of the private cloud. - * @param clusterName Name of the cluster in the private cloud - * @param properties The properties of a cluster resource - * @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 beginCreateOrUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterProperties properties, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, properties), serviceCallback); - } - - /** - * Create or update a cluster in a private cloud. - * - * @param resourceGroupName Name of the resource group within the Azure subscription - * @param privateCloudName The name of the private cloud. - * @param clusterName Name of the cluster in the private cloud - * @param properties The properties of a cluster resource - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ClusterInner object - */ - public Observable beginCreateOrUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterProperties properties) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, properties).map(new Func1, ClusterInner>() { - @Override - public ClusterInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create or update a cluster in a private cloud. - * - * @param resourceGroupName Name of the resource group within the Azure subscription - * @param privateCloudName The name of the private cloud. - * @param clusterName Name of the cluster in the private cloud - * @param properties The properties of a cluster resource - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ClusterInner object - */ - public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterProperties properties) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (privateCloudName == null) { - throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); - } - if (clusterName == null) { - throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + if (cluster == null) { + throw new IllegalArgumentException("Parameter cluster is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - Validator.validate(properties); - ClusterInner cluster = new ClusterInner(); - cluster.withProperties(properties); - return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, privateCloudName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), cluster, this.client.userAgent()) + Validator.validate(cluster); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, privateCloudName, clusterName, cluster, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -674,13 +508,14 @@ private ServiceResponse beginCreateOrUpdateDelegate(Response updateAsync(String resourceGroupName, String privateCloudName, String clusterName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName), serviceCallback); + public ServiceFuture updateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster), serviceCallback); } /** @@ -703,11 +539,12 @@ public ServiceFuture updateAsync(String resourceGroupName, String * @param resourceGroupName Name of the resource group within the Azure subscription * @param privateCloudName Name of the private cloud * @param clusterName Name of the cluster in the private cloud + * @param cluster A cluster in a private cloud * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable updateAsync(String resourceGroupName, String privateCloudName, String clusterName) { - return updateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName).map(new Func1, ClusterInner>() { + public Observable updateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { + return updateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster).map(new Func1, ClusterInner>() { @Override public ClusterInner call(ServiceResponse response) { return response.body(); @@ -721,10 +558,11 @@ public ClusterInner call(ServiceResponse response) { * @param resourceGroupName Name of the resource group within the Azure subscription * @param privateCloudName Name of the private cloud * @param clusterName Name of the cluster in the private cloud + * @param cluster A cluster in a private cloud * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String clusterName) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -737,95 +575,14 @@ public Observable> updateWithServiceResponseAsync( if (clusterName == null) { throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final ClusterProperties properties = null; - ClusterInner cluster = new ClusterInner(); - cluster.withProperties(null); - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, privateCloudName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), cluster, this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); - } - /** - * Update a cluster in a private cloud. - * - * @param resourceGroupName Name of the resource group within the Azure subscription - * @param privateCloudName Name of the private cloud - * @param clusterName Name of the cluster in the private cloud - * @param properties The properties of a cluster resource - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ClusterInner object if successful. - */ - public ClusterInner update(String resourceGroupName, String privateCloudName, String clusterName, ClusterProperties properties) { - return updateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, properties).toBlocking().last().body(); - } - - /** - * Update a cluster in a private cloud. - * - * @param resourceGroupName Name of the resource group within the Azure subscription - * @param privateCloudName Name of the private cloud - * @param clusterName Name of the cluster in the private cloud - * @param properties The properties of a cluster resource - * @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 updateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterProperties properties, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, properties), serviceCallback); - } - - /** - * Update a cluster in a private cloud. - * - * @param resourceGroupName Name of the resource group within the Azure subscription - * @param privateCloudName Name of the private cloud - * @param clusterName Name of the cluster in the private cloud - * @param properties The properties of a cluster resource - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable updateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterProperties properties) { - return updateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, properties).map(new Func1, ClusterInner>() { - @Override - public ClusterInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Update a cluster in a private cloud. - * - * @param resourceGroupName Name of the resource group within the Azure subscription - * @param privateCloudName Name of the private cloud - * @param clusterName Name of the cluster in the private cloud - * @param properties The properties of a cluster resource - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterProperties properties) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (privateCloudName == null) { - throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); - } - if (clusterName == null) { - throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + if (cluster == null) { + throw new IllegalArgumentException("Parameter cluster is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - Validator.validate(properties); - ClusterInner cluster = new ClusterInner(); - cluster.withProperties(properties); - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, privateCloudName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), cluster, this.client.userAgent()); + Validator.validate(cluster); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, privateCloudName, clusterName, cluster, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -835,13 +592,14 @@ public Observable> updateWithServiceResponseAsync( * @param resourceGroupName Name of the resource group within the Azure subscription * @param privateCloudName Name of the private cloud * @param clusterName Name of the cluster in the private cloud + * @param cluster A cluster in a private cloud * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ApiErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ClusterInner object if successful. */ - public ClusterInner beginUpdate(String resourceGroupName, String privateCloudName, String clusterName) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName).toBlocking().single().body(); + public ClusterInner beginUpdate(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster).toBlocking().single().body(); } /** @@ -850,12 +608,13 @@ public ClusterInner beginUpdate(String resourceGroupName, String privateCloudNam * @param resourceGroupName Name of the resource group within the Azure subscription * @param privateCloudName Name of the private cloud * @param clusterName Name of the cluster in the private cloud + * @param cluster A cluster in a private cloud * @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 beginUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName), serviceCallback); + public ServiceFuture beginUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster), serviceCallback); } /** @@ -864,11 +623,12 @@ public ServiceFuture beginUpdateAsync(String resourceGroupName, St * @param resourceGroupName Name of the resource group within the Azure subscription * @param privateCloudName Name of the private cloud * @param clusterName Name of the cluster in the private cloud + * @param cluster A cluster in a private cloud * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ClusterInner object */ - public Observable beginUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName).map(new Func1, ClusterInner>() { + public Observable beginUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster).map(new Func1, ClusterInner>() { @Override public ClusterInner call(ServiceResponse response) { return response.body(); @@ -882,10 +642,11 @@ public ClusterInner call(ServiceResponse response) { * @param resourceGroupName Name of the resource group within the Azure subscription * @param privateCloudName Name of the private cloud * @param clusterName Name of the cluster in the private cloud + * @param cluster A cluster in a private cloud * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ClusterInner object */ - public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String clusterName) { + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -898,106 +659,14 @@ public Observable> beginUpdateWithServiceResponseA if (clusterName == null) { throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - final ClusterProperties properties = null; - ClusterInner cluster = new ClusterInner(); - cluster.withProperties(null); - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, privateCloudName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), cluster, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginUpdateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * Update a cluster in a private cloud. - * - * @param resourceGroupName Name of the resource group within the Azure subscription - * @param privateCloudName Name of the private cloud - * @param clusterName Name of the cluster in the private cloud - * @param properties The properties of a cluster resource - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ApiErrorException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ClusterInner object if successful. - */ - public ClusterInner beginUpdate(String resourceGroupName, String privateCloudName, String clusterName, ClusterProperties properties) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, properties).toBlocking().single().body(); - } - - /** - * Update a cluster in a private cloud. - * - * @param resourceGroupName Name of the resource group within the Azure subscription - * @param privateCloudName Name of the private cloud - * @param clusterName Name of the cluster in the private cloud - * @param properties The properties of a cluster resource - * @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 beginUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterProperties properties, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, properties), serviceCallback); - } - - /** - * Update a cluster in a private cloud. - * - * @param resourceGroupName Name of the resource group within the Azure subscription - * @param privateCloudName Name of the private cloud - * @param clusterName Name of the cluster in the private cloud - * @param properties The properties of a cluster resource - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ClusterInner object - */ - public Observable beginUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterProperties properties) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, properties).map(new Func1, ClusterInner>() { - @Override - public ClusterInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Update a cluster in a private cloud. - * - * @param resourceGroupName Name of the resource group within the Azure subscription - * @param privateCloudName Name of the private cloud - * @param clusterName Name of the cluster in the private cloud - * @param properties The properties of a cluster resource - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ClusterInner object - */ - public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterProperties properties) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (privateCloudName == null) { - throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); - } - if (clusterName == null) { - throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + if (cluster == null) { + throw new IllegalArgumentException("Parameter cluster is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - Validator.validate(properties); - ClusterInner cluster = new ClusterInner(); - cluster.withProperties(properties); - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, privateCloudName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), cluster, this.client.userAgent()) + Validator.validate(cluster); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, privateCloudName, clusterName, cluster, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { diff --git a/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/implementation/OperationImpl.java b/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/implementation/OperationImpl.java index d02bfd36a581..d1a48a4312d0 100644 --- a/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/implementation/OperationImpl.java +++ b/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/implementation/OperationImpl.java @@ -11,6 +11,7 @@ import com.microsoft.azure.management.avs.v2019_08_09_preview.Operation; import com.microsoft.azure.arm.model.implementation.WrapperImpl; import com.microsoft.azure.management.avs.v2019_08_09_preview.OperationDisplay; +import com.microsoft.azure.management.avs.v2019_08_09_preview.OperationProperties; class OperationImpl extends WrapperImpl implements Operation { private final AVSManager manager; @@ -29,9 +30,24 @@ public OperationDisplay display() { return this.inner().display(); } + @Override + public Boolean isDataAction() { + return this.inner().isDataAction(); + } + @Override public String name() { return this.inner().name(); } + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public OperationProperties properties() { + return this.inner().properties(); + } + } diff --git a/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/implementation/OperationInner.java b/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/implementation/OperationInner.java index 24511baaf2a8..76903bd5543a 100644 --- a/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/implementation/OperationInner.java +++ b/sdk/avs/mgmt-v2019_08_09_preview/src/main/java/com/microsoft/azure/management/avs/v2019_08_09_preview/implementation/OperationInner.java @@ -9,6 +9,7 @@ package com.microsoft.azure.management.avs.v2019_08_09_preview.implementation; import com.microsoft.azure.management.avs.v2019_08_09_preview.OperationDisplay; +import com.microsoft.azure.management.avs.v2019_08_09_preview.OperationProperties; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -27,6 +28,25 @@ public class OperationInner { @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) private OperationDisplay display; + /** + * Gets or sets a value indicating whether the operation is a data action + * or not. + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /** + * Origin of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Properties of the operation. + */ + @JsonProperty(value = "properties") + private OperationProperties properties; + /** * Get name of the operation being performed on this object. * @@ -45,4 +65,64 @@ public OperationDisplay display() { return this.display; } + /** + * Get gets or sets a value indicating whether the operation is a data action or not. + * + * @return the isDataAction value + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set gets or sets a value indicating whether the operation is a data action or not. + * + * @param isDataAction the isDataAction value to set + * @return the OperationInner object itself. + */ + public OperationInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get origin of the operation. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set origin of the operation. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get properties of the operation. + * + * @return the properties value + */ + public OperationProperties properties() { + return this.properties; + } + + /** + * Set properties of the operation. + * + * @param properties the properties value to set + * @return the OperationInner object itself. + */ + public OperationInner withProperties(OperationProperties properties) { + this.properties = properties; + return this; + } + }