diff --git a/storage/resource-manager/v2016_01_01/pom.xml b/storage/resource-manager/v2016_01_01/pom.xml index 615b1b836b3b..de38d4d120bd 100644 --- a/storage/resource-manager/v2016_01_01/pom.xml +++ b/storage/resource-manager/v2016_01_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.3-beta + 0.0.2-beta ../../../pom.xml azure-mgmt-storage diff --git a/storage/resource-manager/v2017_10_01/pom.xml b/storage/resource-manager/v2017_10_01/pom.xml index 1ad59c15226e..3625f22ea1e3 100644 --- a/storage/resource-manager/v2017_10_01/pom.xml +++ b/storage/resource-manager/v2017_10_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.3-beta + 0.0.2-beta ../../../pom.xml azure-mgmt-storage diff --git a/storage/resource-manager/v2018_02_01/pom.xml b/storage/resource-manager/v2018_02_01/pom.xml index 674e44ea3aeb..1c11c11ca29b 100644 --- a/storage/resource-manager/v2018_02_01/pom.xml +++ b/storage/resource-manager/v2018_02_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.3-beta + 0.0.2-beta ../../../pom.xml azure-mgmt-storage diff --git a/storage/resource-manager/v2018_03_01_preview/pom.xml b/storage/resource-manager/v2018_03_01_preview/pom.xml index 1e53c3ff243f..febf4b3044b2 100644 --- a/storage/resource-manager/v2018_03_01_preview/pom.xml +++ b/storage/resource-manager/v2018_03_01_preview/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.3-beta + 0.0.2-beta ../../../pom.xml azure-mgmt-storage diff --git a/storage/resource-manager/v2018_07_01/pom.xml b/storage/resource-manager/v2018_07_01/pom.xml index a69acbb04c02..28ed9952bd3e 100644 --- a/storage/resource-manager/v2018_07_01/pom.xml +++ b/storage/resource-manager/v2018_07_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 0.0.3-beta + 0.0.2-beta ../../../pom.xml azure-mgmt-storage diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobServiceProperties.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobServiceProperties.java new file mode 100644 index 000000000000..0e1e1689f5f1 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobServiceProperties.java @@ -0,0 +1,160 @@ +/** + * 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.storage.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.BlobServicePropertiesInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.StorageManager; + +/** + * Type representing BlobServiceProperties. + */ +public interface BlobServiceProperties extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the cors value. + */ + CorsRules cors(); + + /** + * @return the defaultServiceVersion value. + */ + String defaultServiceVersion(); + + /** + * @return the deleteRetentionPolicy value. + */ + DeleteRetentionPolicy deleteRetentionPolicy(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the BlobServiceProperties definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithStorageAccount, DefinitionStages.WithCreate { + } + + /** + * Grouping of BlobServiceProperties definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a BlobServiceProperties definition. + */ + interface Blank extends WithStorageAccount { + } + + /** + * The stage of the blobserviceproperties definition allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies resourceGroupName, accountName. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the blobserviceproperties definition allowing to specify Cors. + */ + interface WithCors { + /** + * Specifies cors. + */ + WithCreate withCors(CorsRules cors); + } + + /** + * The stage of the blobserviceproperties definition allowing to specify DefaultServiceVersion. + */ + interface WithDefaultServiceVersion { + /** + * Specifies defaultServiceVersion. + */ + WithCreate withDefaultServiceVersion(String defaultServiceVersion); + } + + /** + * The stage of the blobserviceproperties definition allowing to specify DeleteRetentionPolicy. + */ + interface WithDeleteRetentionPolicy { + /** + * Specifies deleteRetentionPolicy. + */ + WithCreate withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithCors, DefinitionStages.WithDefaultServiceVersion, DefinitionStages.WithDeleteRetentionPolicy { + } + } + /** + * The template for a BlobServiceProperties update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCors, UpdateStages.WithDefaultServiceVersion, UpdateStages.WithDeleteRetentionPolicy { + } + + /** + * Grouping of BlobServiceProperties update stages. + */ + interface UpdateStages { + /** + * The stage of the blobserviceproperties update allowing to specify Cors. + */ + interface WithCors { + /** + * Specifies cors. + */ + Update withCors(CorsRules cors); + } + + /** + * The stage of the blobserviceproperties update allowing to specify DefaultServiceVersion. + */ + interface WithDefaultServiceVersion { + /** + * Specifies defaultServiceVersion. + */ + Update withDefaultServiceVersion(String defaultServiceVersion); + } + + /** + * The stage of the blobserviceproperties update allowing to specify DeleteRetentionPolicy. + */ + interface WithDeleteRetentionPolicy { + /** + * Specifies deleteRetentionPolicy. + */ + Update withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy); + } + + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobServices.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobServices.java new file mode 100644 index 000000000000..5a317c549c25 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobServices.java @@ -0,0 +1,30 @@ +/** + * 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.storage.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.BlobServicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BlobServices. + */ +public interface BlobServices extends SupportsCreating, HasInner { + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getServicePropertiesAsync(String resourceGroupName, String accountName); + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/CorsRule.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/CorsRule.java new file mode 100644 index 000000000000..18d218344415 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/CorsRule.java @@ -0,0 +1,153 @@ +/** + * 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.storage.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies a CORS rule for the Blob service. + */ +public class CorsRule { + /** + * Required if CorsRule element is present. A list of origin domains that + * will be allowed via CORS, or "*" to allow all domains. + */ + @JsonProperty(value = "allowedOrigins", required = true) + private List allowedOrigins; + + /** + * Required if CorsRule element is present. A list of HTTP methods that are + * allowed to be executed by the origin. + */ + @JsonProperty(value = "allowedMethods", required = true) + private List allowedMethods; + + /** + * Required if CorsRule element is present. The number of seconds that the + * client/browser should cache a preflight response. + */ + @JsonProperty(value = "maxAgeInSeconds", required = true) + private int maxAgeInSeconds; + + /** + * Required if CorsRule element is present. A list of response headers to + * expose to CORS clients. + */ + @JsonProperty(value = "exposedHeaders", required = true) + private List exposedHeaders; + + /** + * Required if CorsRule element is present. A list of headers allowed to be + * part of the cross-origin request. + */ + @JsonProperty(value = "allowedHeaders", required = true) + private List allowedHeaders; + + /** + * Get required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow all domains. + * + * @return the allowedOrigins value + */ + public List allowedOrigins() { + return this.allowedOrigins; + } + + /** + * Set required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow all domains. + * + * @param allowedOrigins the allowedOrigins value to set + * @return the CorsRule object itself. + */ + public CorsRule withAllowedOrigins(List allowedOrigins) { + this.allowedOrigins = allowedOrigins; + return this; + } + + /** + * Get required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin. + * + * @return the allowedMethods value + */ + public List allowedMethods() { + return this.allowedMethods; + } + + /** + * Set required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin. + * + * @param allowedMethods the allowedMethods value to set + * @return the CorsRule object itself. + */ + public CorsRule withAllowedMethods(List allowedMethods) { + this.allowedMethods = allowedMethods; + return this; + } + + /** + * Get required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight response. + * + * @return the maxAgeInSeconds value + */ + public int maxAgeInSeconds() { + return this.maxAgeInSeconds; + } + + /** + * Set required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight response. + * + * @param maxAgeInSeconds the maxAgeInSeconds value to set + * @return the CorsRule object itself. + */ + public CorsRule withMaxAgeInSeconds(int maxAgeInSeconds) { + this.maxAgeInSeconds = maxAgeInSeconds; + return this; + } + + /** + * Get required if CorsRule element is present. A list of response headers to expose to CORS clients. + * + * @return the exposedHeaders value + */ + public List exposedHeaders() { + return this.exposedHeaders; + } + + /** + * Set required if CorsRule element is present. A list of response headers to expose to CORS clients. + * + * @param exposedHeaders the exposedHeaders value to set + * @return the CorsRule object itself. + */ + public CorsRule withExposedHeaders(List exposedHeaders) { + this.exposedHeaders = exposedHeaders; + return this; + } + + /** + * Get required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request. + * + * @return the allowedHeaders value + */ + public List allowedHeaders() { + return this.allowedHeaders; + } + + /** + * Set required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request. + * + * @param allowedHeaders the allowedHeaders value to set + * @return the CorsRule object itself. + */ + public CorsRule withAllowedHeaders(List allowedHeaders) { + this.allowedHeaders = allowedHeaders; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/CorsRules.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/CorsRules.java new file mode 100644 index 000000000000..f87c9c985442 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/CorsRules.java @@ -0,0 +1,46 @@ +/** + * 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.storage.v2018_07_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Sets the CORS rules. You can include up to five CorsRule elements in the + * request. + */ +public class CorsRules { + /** + * The List of CORS rules. You can include up to five CorsRule elements in + * the request. + */ + @JsonProperty(value = "corsRules") + private List corsRules; + + /** + * Get the List of CORS rules. You can include up to five CorsRule elements in the request. + * + * @return the corsRules value + */ + public List corsRules() { + return this.corsRules; + } + + /** + * Set the List of CORS rules. You can include up to five CorsRule elements in the request. + * + * @param corsRules the corsRules value to set + * @return the CorsRules object itself. + */ + public CorsRules withCorsRules(List corsRules) { + this.corsRules = corsRules; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/DeleteRetentionPolicy.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/DeleteRetentionPolicy.java new file mode 100644 index 000000000000..6f2da384f4c0 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/DeleteRetentionPolicy.java @@ -0,0 +1,70 @@ +/** + * 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.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The blob service properties for soft delete. + */ +public class DeleteRetentionPolicy { + /** + * Indicates whether DeleteRetentionPolicy is enabled for the Blob service. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Indicates the number of days that the deleted blob should be retained. + * The minimum specified value can be 1 and the maximum value can be 365. + */ + @JsonProperty(value = "days") + private Integer days; + + /** + * Get indicates whether DeleteRetentionPolicy is enabled for the Blob service. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set indicates whether DeleteRetentionPolicy is enabled for the Blob service. + * + * @param enabled the enabled value to set + * @return the DeleteRetentionPolicy object itself. + */ + public DeleteRetentionPolicy withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get indicates the number of days that the deleted blob should be retained. The minimum specified value can be 1 and the maximum value can be 365. + * + * @return the days value + */ + public Integer days() { + return this.days; + } + + /** + * Set indicates the number of days that the deleted blob should be retained. The minimum specified value can be 1 and the maximum value can be 365. + * + * @param days the days value to set + * @return the DeleteRetentionPolicy object itself. + */ + public DeleteRetentionPolicy withDays(Integer days) { + this.days = days; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ManagementPolicies.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ManagementPolicies.java new file mode 100644 index 000000000000..b04b1bef2ced --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ManagementPolicies.java @@ -0,0 +1,41 @@ +/** + * 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.storage.v2018_07_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.ManagementPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ManagementPolicies. + */ +public interface ManagementPolicies extends SupportsCreating, HasInner { + /** + * Gets the data policy rules associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName); + + /** + * Deletes the data policy rules associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName); + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ManagementPoliciesRulesSetParameter.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ManagementPoliciesRulesSetParameter.java new file mode 100644 index 000000000000..22c4231bfb4e --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ManagementPoliciesRulesSetParameter.java @@ -0,0 +1,49 @@ +/** + * 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.storage.v2018_07_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The Storage Account ManagementPolicies Rules, in JSON format. See more + * details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + */ +@JsonFlatten +public class ManagementPoliciesRulesSetParameter { + /** + * The Storage Account ManagementPolicies Rules, in JSON format. See more + * details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + */ + @JsonProperty(value = "properties.policy") + private Object policy; + + /** + * Get the Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @return the policy value + */ + public Object policy() { + return this.policy; + } + + /** + * Set the Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @param policy the policy value to set + * @return the ManagementPoliciesRulesSetParameter object itself. + */ + public ManagementPoliciesRulesSetParameter withPolicy(Object policy) { + this.policy = policy; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountManagementPolicies.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountManagementPolicies.java new file mode 100644 index 000000000000..8358d9b9e9f6 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountManagementPolicies.java @@ -0,0 +1,96 @@ +/** + * 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.storage.v2018_07_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.StorageAccountManagementPoliciesInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.StorageManager; +import org.joda.time.DateTime; + +/** + * Type representing StorageAccountManagementPolicies. + */ +public interface StorageAccountManagementPolicies extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModifiedTime value. + */ + DateTime lastModifiedTime(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the policy value. + */ + Object policy(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the StorageAccountManagementPolicies definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithStorageAccount, DefinitionStages.WithCreate { + } + + /** + * Grouping of StorageAccountManagementPolicies definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a StorageAccountManagementPolicies definition. + */ + interface Blank extends WithStorageAccount { + } + + /** + * The stage of the storageaccountmanagementpolicies definition allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies resourceGroupName, accountName. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a StorageAccountManagementPolicies update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of StorageAccountManagementPolicies update stages. + */ + interface UpdateStages { + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainersInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainersInner.java index 0e5d79d11e6c..8becbe11bd8f 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainersInner.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainersInner.java @@ -178,10 +178,8 @@ public Observable> listWithServiceRespo 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.list(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-07-01"; + return service.list(resourceGroupName, accountName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -271,15 +269,13 @@ public Observable> createWithServiceResponse 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."); - } + final String apiVersion = "2018-07-01"; final PublicAccess publicAccess = null; final Map metadata = null; BlobContainerInner blobContainer = new BlobContainerInner(); blobContainer.withPublicAccess(null); blobContainer.withMetadata(null); - return service.create(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), blobContainer, this.client.userAgent()) + return service.create(resourceGroupName, accountName, containerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), blobContainer, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -370,14 +366,12 @@ public Observable> createWithServiceResponse 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."); - } Validator.validate(metadata); + final String apiVersion = "2018-07-01"; BlobContainerInner blobContainer = new BlobContainerInner(); blobContainer.withPublicAccess(publicAccess); blobContainer.withMetadata(metadata); - return service.create(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), blobContainer, this.client.userAgent()) + return service.create(resourceGroupName, accountName, containerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), blobContainer, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -467,15 +461,13 @@ public Observable> updateWithServiceResponse 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."); - } + final String apiVersion = "2018-07-01"; final PublicAccess publicAccess = null; final Map metadata = null; BlobContainerInner blobContainer = new BlobContainerInner(); blobContainer.withPublicAccess(null); blobContainer.withMetadata(null); - return service.update(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), blobContainer, this.client.userAgent()) + return service.update(resourceGroupName, accountName, containerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), blobContainer, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -566,14 +558,12 @@ public Observable> updateWithServiceResponse 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."); - } Validator.validate(metadata); + final String apiVersion = "2018-07-01"; BlobContainerInner blobContainer = new BlobContainerInner(); blobContainer.withPublicAccess(publicAccess); blobContainer.withMetadata(metadata); - return service.update(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), blobContainer, this.client.userAgent()) + return service.update(resourceGroupName, accountName, containerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), blobContainer, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -663,10 +653,8 @@ public Observable> getWithServiceResponseAsy 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.get(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-07-01"; + return service.get(resourceGroupName, accountName, containerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -755,10 +743,8 @@ public Observable> deleteWithServiceResponseAsync(String r 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.delete(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-07-01"; + return service.delete(resourceGroupName, accountName, containerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -853,16 +839,14 @@ public Observable> setLegalHoldWithServiceRespon 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."); - } if (tags == null) { throw new IllegalArgumentException("Parameter tags is required and cannot be null."); } Validator.validate(tags); + final String apiVersion = "2018-07-01"; LegalHoldInner legalHold = new LegalHoldInner(); legalHold.withTags(tags); - return service.setLegalHold(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), legalHold, this.client.userAgent()) + return service.setLegalHold(resourceGroupName, accountName, containerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), legalHold, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -956,16 +940,14 @@ public Observable> clearLegalHoldWithServiceResp 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."); - } if (tags == null) { throw new IllegalArgumentException("Parameter tags is required and cannot be null."); } Validator.validate(tags); + final String apiVersion = "2018-07-01"; LegalHoldInner legalHold = new LegalHoldInner(); legalHold.withTags(tags); - return service.clearLegalHold(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), legalHold, this.client.userAgent()) + return service.clearLegalHold(resourceGroupName, accountName, containerName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), legalHold, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1059,14 +1041,12 @@ public Observable, Observable>>() { @Override public Observable> call(Response response) { @@ -1157,13 +1137,11 @@ public Observable, Observable>>() { @Override public Observable> call(Response response) { @@ -1253,12 +1231,10 @@ public Observable, Observable>>() { @Override public Observable> call(Response response) { @@ -1345,11 +1321,9 @@ public Observable, Observable>>() { @Override public Observable> call(Response response) { @@ -1443,14 +1417,12 @@ public Observable, Observable>>() { @Override public Observable> call(Response response) { @@ -1544,13 +1516,11 @@ public Observable, Observable>>() { @Override public Observable> call(Response response) { @@ -1648,15 +1618,13 @@ public Observable, Observable>>() { @Override public Observable> call(Response response) { diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobServicePropertiesImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobServicePropertiesImpl.java new file mode 100644 index 000000000000..03512ec2de55 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobServicePropertiesImpl.java @@ -0,0 +1,127 @@ +/** + * 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.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.BlobServiceProperties; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2018_07_01.CorsRules; +import com.microsoft.azure.management.storage.v2018_07_01.DeleteRetentionPolicy; + +class BlobServicePropertiesImpl extends CreatableUpdatableImpl implements BlobServiceProperties, BlobServiceProperties.Definition, BlobServiceProperties.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + + BlobServicePropertiesImpl(String name, StorageManager manager) { + super(name, new BlobServicePropertiesInner()); + this.manager = manager; + // Set resource name + this.accountName = name; + // + } + + BlobServicePropertiesImpl(BlobServicePropertiesInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.accountName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + // + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + BlobServicesInner client = this.manager().inner().blobServices(); + return client.setServicePropertiesAsync(this.resourceGroupName, this.accountName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + BlobServicesInner client = this.manager().inner().blobServices(); + return client.setServicePropertiesAsync(this.resourceGroupName, this.accountName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + BlobServicesInner client = this.manager().inner().blobServices(); + return client.getServicePropertiesAsync(this.resourceGroupName, this.accountName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public CorsRules cors() { + return this.inner().cors(); + } + + @Override + public String defaultServiceVersion() { + return this.inner().defaultServiceVersion(); + } + + @Override + public DeleteRetentionPolicy deleteRetentionPolicy() { + return this.inner().deleteRetentionPolicy(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public BlobServicePropertiesImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public BlobServicePropertiesImpl withCors(CorsRules cors) { + this.inner().withCors(cors); + return this; + } + + @Override + public BlobServicePropertiesImpl withDefaultServiceVersion(String defaultServiceVersion) { + this.inner().withDefaultServiceVersion(defaultServiceVersion); + return this; + } + + @Override + public BlobServicePropertiesImpl withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy) { + this.inner().withDeleteRetentionPolicy(deleteRetentionPolicy); + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobServicePropertiesInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobServicePropertiesInner.java new file mode 100644 index 000000000000..c4b4e1468ea2 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobServicePropertiesInner.java @@ -0,0 +1,105 @@ +/** + * 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.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.CorsRules; +import com.microsoft.azure.management.storage.v2018_07_01.DeleteRetentionPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The properties of a storage account’s Blob service. + */ +@JsonFlatten +public class BlobServicePropertiesInner extends ProxyResource { + /** + * Specifies CORS rules for the Blob service. You can include up to five + * CorsRule elements in the request. If no CorsRule elements are included + * in the request body, all CORS rules will be deleted, and CORS will be + * disabled for the Blob service. + */ + @JsonProperty(value = "properties.cors") + private CorsRules cors; + + /** + * DefaultServiceVersion indicates the default version to use for requests + * to the Blob service if an incoming request’s version is not specified. + * Possible values include version 2008-10-27 and all more recent versions. + */ + @JsonProperty(value = "properties.defaultServiceVersion") + private String defaultServiceVersion; + + /** + * The blob service properties for soft delete. + */ + @JsonProperty(value = "properties.deleteRetentionPolicy") + private DeleteRetentionPolicy deleteRetentionPolicy; + + /** + * Get specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service. + * + * @return the cors value + */ + public CorsRules cors() { + return this.cors; + } + + /** + * Set specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service. + * + * @param cors the cors value to set + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withCors(CorsRules cors) { + this.cors = cors; + return this; + } + + /** + * Get defaultServiceVersion indicates the default version to use for requests to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 and all more recent versions. + * + * @return the defaultServiceVersion value + */ + public String defaultServiceVersion() { + return this.defaultServiceVersion; + } + + /** + * Set defaultServiceVersion indicates the default version to use for requests to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 and all more recent versions. + * + * @param defaultServiceVersion the defaultServiceVersion value to set + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withDefaultServiceVersion(String defaultServiceVersion) { + this.defaultServiceVersion = defaultServiceVersion; + return this; + } + + /** + * Get the blob service properties for soft delete. + * + * @return the deleteRetentionPolicy value + */ + public DeleteRetentionPolicy deleteRetentionPolicy() { + return this.deleteRetentionPolicy; + } + + /** + * Set the blob service properties for soft delete. + * + * @param deleteRetentionPolicy the deleteRetentionPolicy value to set + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy) { + this.deleteRetentionPolicy = deleteRetentionPolicy; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobServicesImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobServicesImpl.java new file mode 100644 index 000000000000..9acdeb741ce4 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobServicesImpl.java @@ -0,0 +1,55 @@ +/** + * 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.storage.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2018_07_01.BlobServices; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.storage.v2018_07_01.BlobServiceProperties; + +class BlobServicesImpl extends WrapperImpl implements BlobServices { + private final StorageManager manager; + + BlobServicesImpl(StorageManager manager) { + super(manager.inner().blobServices()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public BlobServicePropertiesImpl define(String name) { + return wrapModel(name); + } + + private BlobServicePropertiesImpl wrapModel(BlobServicePropertiesInner inner) { + return new BlobServicePropertiesImpl(inner, manager()); + } + + private BlobServicePropertiesImpl wrapModel(String name) { + return new BlobServicePropertiesImpl(name, this.manager()); + } + + @Override + public Observable getServicePropertiesAsync(String resourceGroupName, String accountName) { + BlobServicesInner client = this.inner(); + return client.getServicePropertiesAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public BlobServiceProperties call(BlobServicePropertiesInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobServicesInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobServicesInner.java new file mode 100644 index 000000000000..1c5c5ba9c881 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobServicesInner.java @@ -0,0 +1,245 @@ +/** + * 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.storage.v2018_07_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BlobServices. + */ +public class BlobServicesInner { + /** The Retrofit service to perform REST calls. */ + private BlobServicesService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of BlobServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BlobServicesInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(BlobServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for BlobServices to be + * used by Retrofit to perform actually REST calls. + */ + interface BlobServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.BlobServices setServiceProperties" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}") + Observable> setServiceProperties(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("BlobServicesName") String blobServicesName, @Query("api-version") String apiVersion, @Body BlobServicePropertiesInner parameters, @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.storage.v2018_07_01.BlobServices getServiceProperties" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}") + Observable> getServiceProperties(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("BlobServicesName") String blobServicesName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BlobServicePropertiesInner object if successful. + */ + public BlobServicePropertiesInner setServiceProperties(String resourceGroupName, String accountName, BlobServicePropertiesInner parameters) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * @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 setServicePropertiesAsync(String resourceGroupName, String accountName, BlobServicePropertiesInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobServicePropertiesInner object + */ + public Observable setServicePropertiesAsync(String resourceGroupName, String accountName, BlobServicePropertiesInner parameters) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, BlobServicePropertiesInner>() { + @Override + public BlobServicePropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobServicePropertiesInner object + */ + public Observable> setServicePropertiesWithServiceResponseAsync(String resourceGroupName, String accountName, BlobServicePropertiesInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String blobServicesName = "default"; + final String apiVersion = "2018-07-01"; + return service.setServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), blobServicesName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setServicePropertiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse setServicePropertiesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BlobServicePropertiesInner object if successful. + */ + public BlobServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) { + return getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 getServicePropertiesAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobServicePropertiesInner object + */ + public Observable getServicePropertiesAsync(String resourceGroupName, String accountName) { + return getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, BlobServicePropertiesInner>() { + @Override + public BlobServicePropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobServicePropertiesInner object + */ + public Observable> getServicePropertiesWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String blobServicesName = "default"; + final String apiVersion = "2018-07-01"; + return service.getServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), blobServicesName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServicePropertiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getServicePropertiesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ManagementPoliciesImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ManagementPoliciesImpl.java new file mode 100644 index 000000000000..36b91db3d7db --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ManagementPoliciesImpl.java @@ -0,0 +1,62 @@ +/** + * 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.storage.v2018_07_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2018_07_01.ManagementPolicies; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountManagementPolicies; + +class ManagementPoliciesImpl extends WrapperImpl implements ManagementPolicies { + private final StorageManager manager; + + ManagementPoliciesImpl(StorageManager manager) { + super(manager.inner().managementPolicies()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public StorageAccountManagementPoliciesImpl define(String name) { + return wrapModel(name); + } + + private StorageAccountManagementPoliciesImpl wrapModel(StorageAccountManagementPoliciesInner inner) { + return new StorageAccountManagementPoliciesImpl(inner, manager()); + } + + private StorageAccountManagementPoliciesImpl wrapModel(String name) { + return new StorageAccountManagementPoliciesImpl(name, this.manager()); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName) { + ManagementPoliciesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public StorageAccountManagementPolicies call(StorageAccountManagementPoliciesInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName) { + ManagementPoliciesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName).toCompletable(); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ManagementPoliciesInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ManagementPoliciesInner.java new file mode 100644 index 000000000000..6ee0b003e413 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ManagementPoliciesInner.java @@ -0,0 +1,415 @@ +/** + * 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.storage.v2018_07_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.storage.v2018_07_01.ManagementPoliciesRulesSetParameter; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ManagementPolicies. + */ +public class ManagementPoliciesInner implements InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private ManagementPoliciesService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of ManagementPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ManagementPoliciesInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(ManagementPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ManagementPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface ManagementPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.ManagementPolicies get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("managementPolicyName") String managementPolicyName, @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.storage.v2018_07_01.ManagementPolicies createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("managementPolicyName") String managementPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ManagementPoliciesRulesSetParameter properties, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.ManagementPolicies delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("managementPolicyName") String managementPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the data policy rules associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountManagementPoliciesInner object if successful. + */ + public StorageAccountManagementPoliciesInner get(String resourceGroupName, String accountName) { + return getWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets the data policy rules associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 getAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Gets the data policy rules associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountManagementPoliciesInner object + */ + public Observable getAsync(String resourceGroupName, String accountName) { + return getWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, StorageAccountManagementPoliciesInner>() { + @Override + public StorageAccountManagementPoliciesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the data policy rules associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountManagementPoliciesInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String managementPolicyName = "default"; + final String apiVersion = "2018-03-01-preview"; + return service.get(resourceGroupName, accountName, this.client.subscriptionId(), managementPolicyName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Sets the data policy rules associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountManagementPoliciesInner object if successful. + */ + public StorageAccountManagementPoliciesInner createOrUpdate(String resourceGroupName, String accountName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Sets the data policy rules associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Sets the data policy rules associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountManagementPoliciesInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, StorageAccountManagementPoliciesInner>() { + @Override + public StorageAccountManagementPoliciesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the data policy rules associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountManagementPoliciesInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String managementPolicyName = "default"; + final String apiVersion = "2018-03-01-preview"; + final Object policy = null; + ManagementPoliciesRulesSetParameter properties = new ManagementPoliciesRulesSetParameter(); + properties.withPolicy(null); + return service.createOrUpdate(resourceGroupName, accountName, this.client.subscriptionId(), managementPolicyName, apiVersion, this.client.acceptLanguage(), properties, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Sets the data policy rules associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param policy The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountManagementPoliciesInner object if successful. + */ + public StorageAccountManagementPoliciesInner createOrUpdate(String resourceGroupName, String accountName, Object policy) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, policy).toBlocking().single().body(); + } + + /** + * Sets the data policy rules associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param policy The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * @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 accountName, Object policy, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, policy), serviceCallback); + } + + /** + * Sets the data policy rules associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param policy The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountManagementPoliciesInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, Object policy) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, policy).map(new Func1, StorageAccountManagementPoliciesInner>() { + @Override + public StorageAccountManagementPoliciesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the data policy rules associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param policy The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountManagementPoliciesInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, Object policy) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String managementPolicyName = "default"; + final String apiVersion = "2018-03-01-preview"; + ManagementPoliciesRulesSetParameter properties = new ManagementPoliciesRulesSetParameter(); + properties.withPolicy(policy); + return service.createOrUpdate(resourceGroupName, accountName, this.client.subscriptionId(), managementPolicyName, apiVersion, this.client.acceptLanguage(), properties, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the data policy rules associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Deletes the data policy rules associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes the data policy rules associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the data policy rules associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String managementPolicyName = "default"; + final String apiVersion = "2018-03-01-preview"; + return service.delete(resourceGroupName, accountName, this.client.subscriptionId(), managementPolicyName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/OperationsInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/OperationsInner.java index 6af8c590b97f..4a0ecd1dc33e 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/OperationsInner.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/OperationsInner.java @@ -102,10 +102,8 @@ public List call(ServiceResponse> response) * @return the observable to the List<OperationInner> object */ public Observable>> listWithServiceResponseAsync() { - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-07-01"; + return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -124,7 +122,7 @@ public Observable>> call(Response> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException { return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/SkusInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/SkusInner.java index 5b5faa8cb2e5..210c3a1ee176 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/SkusInner.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/SkusInner.java @@ -112,10 +112,8 @@ public Observable>> listWithServiceResponseAsync( 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.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountManagementPoliciesImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountManagementPoliciesImpl.java new file mode 100644 index 000000000000..915975cdfa9b --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountManagementPoliciesImpl.java @@ -0,0 +1,103 @@ +/** + * 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.storage.v2018_07_01.implementation; + +import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountManagementPolicies; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; + +class StorageAccountManagementPoliciesImpl extends CreatableUpdatableImpl implements StorageAccountManagementPolicies, StorageAccountManagementPolicies.Definition, StorageAccountManagementPolicies.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + + StorageAccountManagementPoliciesImpl(String name, StorageManager manager) { + super(name, new StorageAccountManagementPoliciesInner()); + this.manager = manager; + // Set resource name + this.accountName = name; + // + } + + StorageAccountManagementPoliciesImpl(StorageAccountManagementPoliciesInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.accountName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + // + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ManagementPoliciesInner client = this.manager().inner().managementPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ManagementPoliciesInner client = this.manager().inner().managementPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ManagementPoliciesInner client = this.manager().inner().managementPolicies(); + return client.getAsync(this.resourceGroupName, this.accountName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Object policy() { + return this.inner().policy(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public StorageAccountManagementPoliciesImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountManagementPoliciesInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountManagementPoliciesInner.java new file mode 100644 index 000000000000..f7c9938de562 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountManagementPoliciesInner.java @@ -0,0 +1,64 @@ +/** + * 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.storage.v2018_07_01.implementation; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The Get Storage Account ManagementPolicies operation response. + */ +@JsonFlatten +public class StorageAccountManagementPoliciesInner extends ProxyResource { + /** + * The Storage Account ManagementPolicies Rules, in JSON format. See more + * details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + */ + @JsonProperty(value = "properties.policy") + private Object policy; + + /** + * Returns the date and time the ManagementPolicies was last modified. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * Get the Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @return the policy value + */ + public Object policy() { + return this.policy; + } + + /** + * Set the Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @param policy the policy value to set + * @return the StorageAccountManagementPoliciesInner object itself. + */ + public StorageAccountManagementPoliciesInner withPolicy(Object policy) { + this.policy = policy; + return this; + } + + /** + * Get returns the date and time the ManagementPolicies was last modified. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountsInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountsInner.java index 20a62667e3bc..1f0c24dc3f09 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountsInner.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountsInner.java @@ -171,15 +171,13 @@ public Observable> checkNameAv 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."); - } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + final String apiVersion = "2018-07-01"; StorageAccountCheckNameAvailabilityParameters accountName = new StorageAccountCheckNameAvailabilityParameters(); accountName.withName(name); - return service.checkNameAvailability(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), accountName, this.client.userAgent()) + return service.checkNameAvailability(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), accountName, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -269,11 +267,9 @@ public Observable> createWithServiceRespons if (parameters == null) { throw new IllegalArgumentException("Parameter parameters 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(parameters); - Observable> observable = service.create(resourceGroupName, accountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + final String apiVersion = "2018-07-01"; + Observable> observable = service.create(resourceGroupName, accountName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -346,11 +342,9 @@ public Observable> beginCreateWithServiceRe if (parameters == null) { throw new IllegalArgumentException("Parameter parameters 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(parameters); - return service.beginCreate(resourceGroupName, accountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-07-01"; + return service.beginCreate(resourceGroupName, accountName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -433,10 +427,8 @@ public Observable> deleteWithServiceResponseAsync(String r 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.delete(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-07-01"; + return service.delete(resourceGroupName, accountName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -520,10 +512,8 @@ public Observable> getByResourceGroupWithSe 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.getByResourceGroup(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, accountName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -613,11 +603,9 @@ public Observable> updateWithServiceRespons if (parameters == null) { throw new IllegalArgumentException("Parameter parameters 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(parameters); - return service.update(resourceGroupName, accountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-07-01"; + return service.update(resourceGroupName, accountName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -690,10 +678,8 @@ public Observable>> listWithServiceRes 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.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-07-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -778,10 +764,8 @@ public Observable>> listByResourceGrou 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.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-07-01"; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -869,10 +853,8 @@ public Observable> listKeysWi 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.listKeys(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-07-01"; + return service.listKeys(resourceGroupName, accountName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -959,15 +941,13 @@ public Observable> regenerate 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."); - } if (keyName == null) { throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); } + final String apiVersion = "2018-07-01"; StorageAccountRegenerateKeyParameters regenerateKey = new StorageAccountRegenerateKeyParameters(); regenerateKey.withKeyName(keyName); - return service.regenerateKey(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), regenerateKey, this.client.userAgent()) + return service.regenerateKey(resourceGroupName, accountName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), regenerateKey, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1057,11 +1037,9 @@ public Observable> listAccountSASWi if (parameters == null) { throw new IllegalArgumentException("Parameter parameters 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(parameters); - return service.listAccountSAS(resourceGroupName, accountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-07-01"; + return service.listAccountSAS(resourceGroupName, accountName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1151,11 +1129,9 @@ public Observable> listServiceSASWi if (parameters == null) { throw new IllegalArgumentException("Parameter parameters 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(parameters); - return service.listServiceSAS(resourceGroupName, accountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-07-01"; + return service.listServiceSAS(resourceGroupName, accountName, this.client.subscriptionId(), parameters, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageManagementClientImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageManagementClientImpl.java index 7b7c819632d7..816606da870f 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageManagementClientImpl.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageManagementClientImpl.java @@ -51,18 +51,6 @@ public StorageManagementClientImpl withSubscriptionId(String subscriptionId) { return this; } - /** The API version to use for this operation. */ - private String apiVersion; - - /** - * Gets The API version to use for this operation. - * - * @return the apiVersion value. - */ - public String apiVersion() { - return this.apiVersion; - } - /** Gets or sets the preferred language for the response. */ private String acceptLanguage; @@ -184,6 +172,19 @@ public UsagesInner usages() { return this.usages; } + /** + * The BlobServicesInner object to access its operations. + */ + private BlobServicesInner blobServices; + + /** + * Gets the BlobServicesInner object to access its operations. + * @return the BlobServicesInner object. + */ + public BlobServicesInner blobServices() { + return this.blobServices; + } + /** * The BlobContainersInner object to access its operations. */ @@ -197,6 +198,19 @@ public BlobContainersInner blobContainers() { return this.blobContainers; } + /** + * The ManagementPoliciesInner object to access its operations. + */ + private ManagementPoliciesInner managementPolicies; + + /** + * Gets the ManagementPoliciesInner object to access its operations. + * @return the ManagementPoliciesInner object. + */ + public ManagementPoliciesInner managementPolicies() { + return this.managementPolicies; + } + /** * Initializes an instance of StorageManagementClient client. * @@ -228,7 +242,6 @@ public StorageManagementClientImpl(RestClient restClient) { } protected void initialize() { - this.apiVersion = "2018-07-01"; this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -236,7 +249,9 @@ protected void initialize() { this.skus = new SkusInner(restClient().retrofit(), this); this.storageAccounts = new StorageAccountsInner(restClient().retrofit(), this); this.usages = new UsagesInner(restClient().retrofit(), this); + this.blobServices = new BlobServicesInner(restClient().retrofit(), this); this.blobContainers = new BlobContainersInner(restClient().retrofit(), this); + this.managementPolicies = new ManagementPoliciesInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } @@ -247,6 +262,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "StorageManagementClient", "2018-07-01"); + return String.format("%s (%s)", super.userAgent(), "StorageManagementClient"); } } diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageManager.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageManager.java index 5f20828e6920..c54496fa7bb3 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageManager.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageManager.java @@ -20,7 +20,9 @@ import com.microsoft.azure.management.storage.v2018_07_01.Skus; import com.microsoft.azure.management.storage.v2018_07_01.StorageAccounts; import com.microsoft.azure.management.storage.v2018_07_01.Usages; +import com.microsoft.azure.management.storage.v2018_07_01.BlobServices; import com.microsoft.azure.management.storage.v2018_07_01.BlobContainers; +import com.microsoft.azure.management.storage.v2018_07_01.ManagementPolicies; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -32,7 +34,9 @@ public final class StorageManager extends ManagerCore>> listByLocationWithServiceRe if (location == null) { throw new IllegalArgumentException("Parameter location 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.listByLocation(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2018-07-01"; + return service.listByLocation(this.client.subscriptionId(), location, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) {