diff --git a/storage/resource-manager/v2016_01_01/pom.xml b/storage/resource-manager/v2016_01_01/pom.xml index 63be50708815..25539aee83a1 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 - 1.0.0 + 0.0.3-beta ../../../pom.xml azure-mgmt-storage @@ -19,7 +19,7 @@ jar Microsoft Azure SDK for Storage Management This package contains Microsoft Storage Management SDK. - https://github.com/Azure/azure-libraries-for-java + https://github.com/Azure/azure-sdk-for-java The MIT License (MIT) @@ -28,8 +28,8 @@ - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git HEAD diff --git a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/CustomDomain.java b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/CustomDomain.java index 7597576a81b8..bf357b6e12c8 100644 --- a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/CustomDomain.java +++ b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/CustomDomain.java @@ -26,8 +26,8 @@ public class CustomDomain { * Indicates whether indirect CName validation is enabled. Default value is * false. This should only be set on updates. */ - @JsonProperty(value = "useSubDomain") - private Boolean useSubDomain; + @JsonProperty(value = "useSubDomainName") + private Boolean useSubDomainName; /** * Get gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. @@ -52,20 +52,20 @@ public CustomDomain withName(String name) { /** * Get indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. * - * @return the useSubDomain value + * @return the useSubDomainName value */ - public Boolean useSubDomain() { - return this.useSubDomain; + public Boolean useSubDomainName() { + return this.useSubDomainName; } /** * Set indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. * - * @param useSubDomain the useSubDomain value to set + * @param useSubDomainName the useSubDomainName value to set * @return the CustomDomain object itself. */ - public CustomDomain withUseSubDomain(Boolean useSubDomain) { - this.useSubDomain = useSubDomain; + public CustomDomain withUseSubDomainName(Boolean useSubDomainName) { + this.useSubDomainName = useSubDomainName; return this; } diff --git a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccount.java b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccount.java index 29d682b11e7a..f4d5164dc3e9 100644 --- a/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccount.java +++ b/storage/resource-manager/v2016_01_01/src/main/java/com/microsoft/azure/management/storage/v2016_01_01/StorageAccount.java @@ -123,7 +123,9 @@ interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup, Resource.UpdateWithTags com.microsoft.azure azure-arm-parent - 1.0.0 + 0.0.3-beta ../../../pom.xml azure-mgmt-storage @@ -19,7 +19,7 @@ jar Microsoft Azure SDK for Storage Management This package contains Microsoft Storage Management SDK. - https://github.com/Azure/azure-libraries-for-java + https://github.com/Azure/azure-sdk-for-java The MIT License (MIT) @@ -28,8 +28,8 @@ - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git HEAD diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/CustomDomain.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/CustomDomain.java index cbc14318cf29..34895ed0bda0 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/CustomDomain.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/CustomDomain.java @@ -26,8 +26,8 @@ public class CustomDomain { * Indicates whether indirect CName validation is enabled. Default value is * false. This should only be set on updates. */ - @JsonProperty(value = "useSubDomain") - private Boolean useSubDomain; + @JsonProperty(value = "useSubDomainName") + private Boolean useSubDomainName; /** * Get gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. @@ -52,20 +52,20 @@ public CustomDomain withName(String name) { /** * Get indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. * - * @return the useSubDomain value + * @return the useSubDomainName value */ - public Boolean useSubDomain() { - return this.useSubDomain; + public Boolean useSubDomainName() { + return this.useSubDomainName; } /** * Set indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. * - * @param useSubDomain the useSubDomain value to set + * @param useSubDomainName the useSubDomainName value to set * @return the CustomDomain object itself. */ - public CustomDomain withUseSubDomain(Boolean useSubDomain) { - this.useSubDomain = useSubDomain; + public CustomDomain withUseSubDomainName(Boolean useSubDomainName) { + this.useSubDomainName = useSubDomainName; return this; } diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Dimension.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Dimension.java index 9cb5f123501e..c0838ab51b96 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Dimension.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/Dimension.java @@ -11,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Dimension of blobs, possiblly be blob type or access tier. + * Dimension of blobs, possibly be blob type or access tier. */ public class Dimension { /** diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/ServiceSasParameters.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/ServiceSasParameters.java index 033862f56610..fee6c492b651 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/ServiceSasParameters.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/ServiceSasParameters.java @@ -12,7 +12,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The parameters to list service SAS credentials of a speicific resource. + * The parameters to list service SAS credentials of a specific resource. */ public class ServiceSasParameters { /** diff --git a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccount.java b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccount.java index 0a7a5fe13744..6f8f1fe746c5 100644 --- a/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccount.java +++ b/storage/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/storage/v2017_10_01/StorageAccount.java @@ -139,7 +139,9 @@ interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup, Resource.UpdateWithTags listKeysDelegate(Resp * * @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 keyName The name of storage keys that want to be regenerated, possible vaules are key1, key2. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2. * @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 @@ -913,7 +913,7 @@ public StorageAccountListKeysResultInner regenerateKey(String resourceGroupName, * * @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 keyName The name of storage keys that want to be regenerated, possible vaules are key1, key2. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -927,7 +927,7 @@ public ServiceFuture regenerateKeyAsync(Strin * * @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 keyName The name of storage keys that want to be regenerated, possible vaules are key1, key2. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the StorageAccountListKeysResultInner object */ @@ -945,7 +945,7 @@ public StorageAccountListKeysResultInner call(ServiceResponse com.microsoft.azure azure-arm-parent - 1.0.0 + 0.0.3-beta ../../../pom.xml azure-mgmt-storage @@ -19,7 +19,7 @@ jar Microsoft Azure SDK for Storage Management This package contains Microsoft Storage Management SDK. - https://github.com/Azure/azure-libraries-for-java + https://github.com/Azure/azure-sdk-for-java The MIT License (MIT) @@ -28,8 +28,8 @@ - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git HEAD diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainer.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainer.java index fd6c8a3baf7b..e6256282596a 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainer.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainer.java @@ -16,8 +16,8 @@ import com.microsoft.azure.arm.model.Creatable; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.storage.v2018_02_01.implementation.StorageManager; -import org.joda.time.DateTime; import java.util.Map; +import org.joda.time.DateTime; /** * Type representing BlobContainer. @@ -96,7 +96,7 @@ public interface BlobContainer extends HasInner, Indexable, /** * The entirety of the BlobContainer definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithBlobService, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithBlobService, DefinitionStages.WithPublicAccess, DefinitionStages.WithMetadata, DefinitionStages.WithCreate { } /** @@ -115,8 +115,35 @@ interface Blank extends WithBlobService { interface WithBlobService { /** * Specifies resourceGroupName, accountName. + * @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 + * @return the next definition stage + */ + WithPublicAccess withExistingBlobService(String resourceGroupName, String accountName); + } + + /** + * The stage of the blobcontainer definition allowing to specify PublicAccess. + */ + interface WithPublicAccess { + /** + * Specifies publicAccess. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @return the next definition stage + */ + WithMetadata withPublicAccess(PublicAccess publicAccess); + } + + /** + * The stage of the blobcontainer definition allowing to specify Metadata. + */ + interface WithMetadata { + /** + * Specifies metadata. + * @param metadata A name-value pair to associate with the container as metadata + * @return the next definition stage */ - WithCreate withExistingBlobService(String resourceGroupName, String accountName); + WithCreate withMetadata(Map metadata); } /** @@ -130,12 +157,36 @@ interface WithCreate extends Creatable { /** * The template for a BlobContainer update operation, containing all the settings that can be modified. */ - interface Update extends Appliable { + interface Update extends Appliable, UpdateStages.WithPublicAccess, UpdateStages.WithMetadata { } /** * Grouping of BlobContainer update stages. */ interface UpdateStages { + /** + * The stage of the blobcontainer update allowing to specify PublicAccess. + */ + interface WithPublicAccess { + /** + * Specifies publicAccess. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @return the next update stage + */ + Update withPublicAccess(PublicAccess publicAccess); + } + + /** + * The stage of the blobcontainer update allowing to specify Metadata. + */ + interface WithMetadata { + /** + * Specifies metadata. + * @param metadata A name-value pair to associate with the container as metadata + * @return the next update stage + */ + Update withMetadata(Map metadata); + } + } } diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainers.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainers.java index feaf8cb438fd..b22510b3b26e 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainers.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/BlobContainers.java @@ -86,6 +86,17 @@ public interface BlobContainers { */ Observable clearLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags); + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable leaseAsync(String resourceGroupName, String accountName, String containerName); + /** * Gets the existing immutability policy along with the corresponding ETag in response headers and body. * diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/CustomDomain.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/CustomDomain.java index eb6a3f64f18f..ab5fb6b3a084 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/CustomDomain.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/CustomDomain.java @@ -26,8 +26,8 @@ public class CustomDomain { * Indicates whether indirect CName validation is enabled. Default value is * false. This should only be set on updates. */ - @JsonProperty(value = "useSubDomain") - private Boolean useSubDomain; + @JsonProperty(value = "useSubDomainName") + private Boolean useSubDomainName; /** * Get gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. @@ -52,20 +52,20 @@ public CustomDomain withName(String name) { /** * Get indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. * - * @return the useSubDomain value + * @return the useSubDomainName value */ - public Boolean useSubDomain() { - return this.useSubDomain; + public Boolean useSubDomainName() { + return this.useSubDomainName; } /** * Set indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. * - * @param useSubDomain the useSubDomain value to set + * @param useSubDomainName the useSubDomainName value to set * @return the CustomDomain object itself. */ - public CustomDomain withUseSubDomain(Boolean useSubDomain) { - this.useSubDomain = useSubDomain; + public CustomDomain withUseSubDomainName(Boolean useSubDomainName) { + this.useSubDomainName = useSubDomainName; return this; } diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Dimension.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Dimension.java index e328ee85e642..0c65384071b0 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Dimension.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/Dimension.java @@ -11,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Dimension of blobs, possiblly be blob type or access tier. + * Dimension of blobs, possibly be blob type or access tier. */ public class Dimension { /** diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ImmutabilityPolicy.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ImmutabilityPolicy.java index d498ce639d8f..8b5c0ce52f8f 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ImmutabilityPolicy.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ImmutabilityPolicy.java @@ -55,7 +55,7 @@ public interface ImmutabilityPolicy extends HasInner, I /** * The entirety of the ImmutabilityPolicy definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithContainer, DefinitionStages.WithImmutabilityPeriodSinceCreationInDays, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithContainer, DefinitionStages.WithIfMatch, DefinitionStages.WithImmutabilityPeriodSinceCreationInDays, DefinitionStages.WithCreate { } /** @@ -74,8 +74,24 @@ interface Blank extends WithContainer { interface WithContainer { /** * Specifies resourceGroupName, accountName, containerName. + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number + * @return the next definition stage */ - WithImmutabilityPeriodSinceCreationInDays withExistingContainer(String resourceGroupName, String accountName, String containerName); + WithIfMatch withExistingContainer(String resourceGroupName, String accountName, String containerName); + } + + /** + * The stage of the immutabilitypolicy definition allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied + * @return the next definition stage + */ + WithImmutabilityPeriodSinceCreationInDays withIfMatch(String ifMatch); } /** @@ -84,6 +100,8 @@ interface WithContainer { interface WithImmutabilityPeriodSinceCreationInDays { /** * Specifies immutabilityPeriodSinceCreationInDays. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days + * @return the next definition stage */ WithCreate withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays); } @@ -99,19 +117,33 @@ interface WithCreate extends Creatable { /** * The template for a ImmutabilityPolicy update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, UpdateStages.WithImmutabilityPeriodSinceCreationInDays { + interface Update extends Appliable, UpdateStages.WithIfMatch, UpdateStages.WithImmutabilityPeriodSinceCreationInDays { } /** * Grouping of ImmutabilityPolicy update stages. */ interface UpdateStages { + /** + * The stage of the immutabilitypolicy update allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied + * @return the next update stage + */ + Update withIfMatch(String ifMatch); + } + /** * The stage of the immutabilitypolicy update allowing to specify ImmutabilityPeriodSinceCreationInDays. */ interface WithImmutabilityPeriodSinceCreationInDays { /** * Specifies immutabilityPeriodSinceCreationInDays. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days + * @return the next update stage */ Update withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays); } diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/LeaseContainerRequest.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/LeaseContainerRequest.java new file mode 100644 index 000000000000..378ba0d885e5 --- /dev/null +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/LeaseContainerRequest.java @@ -0,0 +1,152 @@ +/** + * 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_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Lease Container request schema. + */ +public class LeaseContainerRequest { + /** + * Specifies the lease action. Can be one of the available actions. + * Possible values include: 'Acquire', 'Renew', 'Change', 'Release', + * 'Break'. + */ + @JsonProperty(value = "action", required = true) + private String action; + + /** + * Identifies the lease. Can be specified in any valid GUID string format. + */ + @JsonProperty(value = "leaseId") + private String leaseId; + + /** + * Optional. For a break action, proposed duration the lease should + * continue before it is broken, in seconds, between 0 and 60. + */ + @JsonProperty(value = "breakPeriod") + private Integer breakPeriod; + + /** + * Required for acquire. Specifies the duration of the lease, in seconds, + * or negative one (-1) for a lease that never expires. + */ + @JsonProperty(value = "leaseDuration") + private Integer leaseDuration; + + /** + * Optional for acquire, required for change. Proposed lease ID, in a GUID + * string format. + */ + @JsonProperty(value = "proposedLeaseId") + private String proposedLeaseId; + + /** + * Get specifies the lease action. Can be one of the available actions. Possible values include: 'Acquire', 'Renew', 'Change', 'Release', 'Break'. + * + * @return the action value + */ + public String action() { + return this.action; + } + + /** + * Set specifies the lease action. Can be one of the available actions. Possible values include: 'Acquire', 'Renew', 'Change', 'Release', 'Break'. + * + * @param action the action value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withAction(String action) { + this.action = action; + return this; + } + + /** + * Get identifies the lease. Can be specified in any valid GUID string format. + * + * @return the leaseId value + */ + public String leaseId() { + return this.leaseId; + } + + /** + * Set identifies the lease. Can be specified in any valid GUID string format. + * + * @param leaseId the leaseId value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withLeaseId(String leaseId) { + this.leaseId = leaseId; + return this; + } + + /** + * Get optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + * + * @return the breakPeriod value + */ + public Integer breakPeriod() { + return this.breakPeriod; + } + + /** + * Set optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + * + * @param breakPeriod the breakPeriod value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withBreakPeriod(Integer breakPeriod) { + this.breakPeriod = breakPeriod; + return this; + } + + /** + * Get required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + * + * @return the leaseDuration value + */ + public Integer leaseDuration() { + return this.leaseDuration; + } + + /** + * Set required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + * + * @param leaseDuration the leaseDuration value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withLeaseDuration(Integer leaseDuration) { + this.leaseDuration = leaseDuration; + return this; + } + + /** + * Get optional for acquire, required for change. Proposed lease ID, in a GUID string format. + * + * @return the proposedLeaseId value + */ + public String proposedLeaseId() { + return this.proposedLeaseId; + } + + /** + * Set optional for acquire, required for change. Proposed lease ID, in a GUID string format. + * + * @param proposedLeaseId the proposedLeaseId value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withProposedLeaseId(String proposedLeaseId) { + this.proposedLeaseId = proposedLeaseId; + return this; + } + +} diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/LeaseContainerResponse.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/LeaseContainerResponse.java new file mode 100644 index 000000000000..33f884df3ac8 --- /dev/null +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/LeaseContainerResponse.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_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2018_02_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2018_02_01.implementation.LeaseContainerResponseInner; + +/** + * Type representing LeaseContainerResponse. + */ +public interface LeaseContainerResponse extends HasInner, HasManager { + /** + * @return the leaseId value. + */ + String leaseId(); + + /** + * @return the leaseTimeSeconds value. + */ + String leaseTimeSeconds(); + +} diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ServiceSasParameters.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ServiceSasParameters.java index 030dd36f59f5..b7b1c328c71c 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ServiceSasParameters.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/ServiceSasParameters.java @@ -12,7 +12,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The parameters to list service SAS credentials of a speicific resource. + * The parameters to list service SAS credentials of a specific resource. */ public class ServiceSasParameters { /** diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccount.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccount.java index f571f0589619..c021886e588d 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccount.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/StorageAccount.java @@ -144,7 +144,9 @@ interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup, Resource.UpdateWithTags implements BlobContainer, BlobContainer.Definition, BlobContainer.Update { private final StorageManager manager; private String resourceGroupName; private String accountName; private String containerName; + private PublicAccess cpublicAccess; + private Map cmetadata; + private PublicAccess upublicAccess; + private Map umetadata; BlobContainerImpl(String name, StorageManager manager) { super(name, new BlobContainerInner()); @@ -39,7 +43,7 @@ class BlobContainerImpl extends CreatableUpdatableImpl createResourceAsync() { BlobContainersInner client = this.manager().inner().blobContainers(); - return client.createAsync(this.resourceGroupName, this.accountName, this.containerName) + return client.createAsync(this.resourceGroupName, this.accountName, this.containerName, this.cpublicAccess, this.cmetadata) .map(innerToFluentMap(this)); } @Override public Observable updateResourceAsync() { BlobContainersInner client = this.manager().inner().blobContainers(); - return client.updateAsync(this.resourceGroupName, this.accountName, this.containerName) + return client.updateAsync(this.resourceGroupName, this.accountName, this.containerName, this.upublicAccess, this.umetadata) .map(innerToFluentMap(this)); } @@ -154,4 +158,24 @@ public BlobContainerImpl withExistingBlobService(String resourceGroupName, Strin return this; } + @Override + public BlobContainerImpl withPublicAccess(PublicAccess publicAccess) { + if (isInCreateMode()) { + this.cpublicAccess = publicAccess; + } else { + this.upublicAccess = publicAccess; + } + return this; + } + + @Override + public BlobContainerImpl withMetadata(Map metadata) { + if (isInCreateMode()) { + this.cmetadata = metadata; + } else { + this.umetadata = metadata; + } + return this; + } + } diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/BlobContainersImpl.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/BlobContainersImpl.java index ed140db7d4e8..7000d935eb57 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/BlobContainersImpl.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/BlobContainersImpl.java @@ -17,6 +17,7 @@ import com.microsoft.azure.management.storage.v2018_02_01.ListContainerItems; import com.microsoft.azure.management.storage.v2018_02_01.BlobContainer; import com.microsoft.azure.management.storage.v2018_02_01.LegalHold; +import com.microsoft.azure.management.storage.v2018_02_01.LeaseContainerResponse; import java.util.List; import com.microsoft.azure.management.storage.v2018_02_01.ImmutabilityPolicy; @@ -120,6 +121,18 @@ public LegalHold call(LegalHoldInner inner) { }); } + @Override + public Observable leaseAsync(String resourceGroupName, String accountName, String containerName) { + BlobContainersInner client = this.inner(); + return client.leaseAsync(resourceGroupName, accountName, containerName) + .map(new Func1() { + @Override + public LeaseContainerResponse call(LeaseContainerResponseInner inner) { + return new LeaseContainerResponseImpl(inner, manager()); + } + }); + } + @Override public Observable getImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName) { BlobContainersInner client = this.inner(); diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/BlobContainersInner.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/BlobContainersInner.java index 79f2511cae8c..162132c628b2 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/BlobContainersInner.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/BlobContainersInner.java @@ -16,6 +16,7 @@ import com.microsoft.azure.management.storage.v2018_02_01.BlobContainersExtendImmutabilityPolicyHeaders; import com.microsoft.azure.management.storage.v2018_02_01.BlobContainersGetImmutabilityPolicyHeaders; import com.microsoft.azure.management.storage.v2018_02_01.BlobContainersLockImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.v2018_02_01.LeaseContainerRequest; import com.microsoft.azure.management.storage.v2018_02_01.PublicAccess; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; @@ -114,6 +115,10 @@ interface BlobContainersService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend") Observable> extendImmutabilityPolicy(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Header("accept-language") String acceptLanguage, @Body ImmutabilityPolicyInner parameters, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_02_01.BlobContainers lease" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease") + Observable> lease(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body LeaseContainerRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** @@ -1677,4 +1682,189 @@ private ServiceResponseWithHeaders leaseAsync(String resourceGroupName, String accountName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName), serviceCallback); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LeaseContainerResponseInner object + */ + public Observable leaseAsync(String resourceGroupName, String accountName, String containerName) { + return leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName).map(new Func1, LeaseContainerResponseInner>() { + @Override + public LeaseContainerResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LeaseContainerResponseInner object + */ + public Observable> leaseWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final LeaseContainerRequest parameters = null; + return service.lease(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = leaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @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 LeaseContainerResponseInner object if successful. + */ + public LeaseContainerResponseInner lease(String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters) { + return leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName, parameters).toBlocking().single().body(); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @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 leaseAsync(String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName, parameters), serviceCallback); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LeaseContainerResponseInner object + */ + public Observable leaseAsync(String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters) { + return leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName, parameters).map(new Func1, LeaseContainerResponseInner>() { + @Override + public LeaseContainerResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LeaseContainerResponseInner object + */ + public Observable> leaseWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, LeaseContainerRequest 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.lease(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = leaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse leaseDelegate(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_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ImmutabilityPolicyImpl.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ImmutabilityPolicyImpl.java index f9e594e63ca2..abe385de55fe 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ImmutabilityPolicyImpl.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ImmutabilityPolicyImpl.java @@ -18,7 +18,9 @@ class ImmutabilityPolicyImpl extends CreatableUpdatableImpl createResourceAsync() { BlobContainersInner client = this.manager().inner().blobContainers(); - return client.createOrUpdateImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName, this.cimmutabilityPeriodSinceCreationInDays) + return client.createOrUpdateImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName, this.cimmutabilityPeriodSinceCreationInDays, this.cifMatch) .map(innerToFluentMap(this)); } @Override public Observable updateResourceAsync() { BlobContainersInner client = this.manager().inner().blobContainers(); - return client.createOrUpdateImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName, this.uimmutabilityPeriodSinceCreationInDays) + return client.createOrUpdateImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName, this.uimmutabilityPeriodSinceCreationInDays, this.uifMatch) .map(innerToFluentMap(this)); } @@ -110,6 +112,16 @@ public ImmutabilityPolicyImpl withExistingContainer(String resourceGroupName, St return this; } + @Override + public ImmutabilityPolicyImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.cifMatch = ifMatch; + } else { + this.uifMatch = ifMatch; + } + return this; + } + @Override public ImmutabilityPolicyImpl withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays) { if (isInCreateMode()) { diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/LeaseContainerResponseImpl.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/LeaseContainerResponseImpl.java new file mode 100644 index 000000000000..86d386f02d2f --- /dev/null +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/LeaseContainerResponseImpl.java @@ -0,0 +1,36 @@ +/** + * 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_02_01.implementation; + +import com.microsoft.azure.management.storage.v2018_02_01.LeaseContainerResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class LeaseContainerResponseImpl extends WrapperImpl implements LeaseContainerResponse { + private final StorageManager manager; + LeaseContainerResponseImpl(LeaseContainerResponseInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String leaseId() { + return this.inner().leaseId(); + } + + @Override + public String leaseTimeSeconds() { + return this.inner().leaseTimeSeconds(); + } + +} diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/LeaseContainerResponseInner.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/LeaseContainerResponseInner.java new file mode 100644 index 000000000000..04ce93344ef3 --- /dev/null +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/LeaseContainerResponseInner.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_02_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Lease Container response schema. + */ +public class LeaseContainerResponseInner { + /** + * Returned unique lease ID that must be included with any request to + * delete the container, or to renew, change, or release the lease. + */ + @JsonProperty(value = "leaseId") + private String leaseId; + + /** + * Approximate time remaining in the lease period, in seconds. + */ + @JsonProperty(value = "leaseTimeSeconds") + private String leaseTimeSeconds; + + /** + * Get returned unique lease ID that must be included with any request to delete the container, or to renew, change, or release the lease. + * + * @return the leaseId value + */ + public String leaseId() { + return this.leaseId; + } + + /** + * Set returned unique lease ID that must be included with any request to delete the container, or to renew, change, or release the lease. + * + * @param leaseId the leaseId value to set + * @return the LeaseContainerResponseInner object itself. + */ + public LeaseContainerResponseInner withLeaseId(String leaseId) { + this.leaseId = leaseId; + return this; + } + + /** + * Get approximate time remaining in the lease period, in seconds. + * + * @return the leaseTimeSeconds value + */ + public String leaseTimeSeconds() { + return this.leaseTimeSeconds; + } + + /** + * Set approximate time remaining in the lease period, in seconds. + * + * @param leaseTimeSeconds the leaseTimeSeconds value to set + * @return the LeaseContainerResponseInner object itself. + */ + public LeaseContainerResponseInner withLeaseTimeSeconds(String leaseTimeSeconds) { + this.leaseTimeSeconds = leaseTimeSeconds; + return this; + } + +} diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ListServiceSasResponseInner.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ListServiceSasResponseInner.java index 1be2c12da9a0..aa2f104a83d0 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ListServiceSasResponseInner.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/ListServiceSasResponseInner.java @@ -15,13 +15,13 @@ */ public class ListServiceSasResponseInner { /** - * List service SAS credentials of speicific resource. + * List service SAS credentials of specific resource. */ @JsonProperty(value = "serviceSasToken", access = JsonProperty.Access.WRITE_ONLY) private String serviceSasToken; /** - * Get list service SAS credentials of speicific resource. + * Get list service SAS credentials of specific resource. * * @return the serviceSasToken value */ diff --git a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/StorageAccountsInner.java b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/StorageAccountsInner.java index 75ae74d0594a..45a42cd74d10 100644 --- a/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/StorageAccountsInner.java +++ b/storage/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/storage/v2018_02_01/implementation/StorageAccountsInner.java @@ -898,7 +898,7 @@ private ServiceResponse listKeysDelegate(Resp * * @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 keyName The name of storage keys that want to be regenerated, possible vaules are key1, key2. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2. * @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 @@ -913,7 +913,7 @@ public StorageAccountListKeysResultInner regenerateKey(String resourceGroupName, * * @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 keyName The name of storage keys that want to be regenerated, possible vaules are key1, key2. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -927,7 +927,7 @@ public ServiceFuture regenerateKeyAsync(Strin * * @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 keyName The name of storage keys that want to be regenerated, possible vaules are key1, key2. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the StorageAccountListKeysResultInner object */ @@ -945,7 +945,7 @@ public StorageAccountListKeysResultInner call(ServiceResponse com.microsoft.azure azure-arm-parent - 1.0.0 + 0.0.3-beta ../../../pom.xml azure-mgmt-storage @@ -19,7 +19,7 @@ jar Microsoft Azure SDK for Storage Management This package contains Microsoft Storage Management SDK. - https://github.com/Azure/azure-libraries-for-java + https://github.com/Azure/azure-sdk-for-java The MIT License (MIT) @@ -28,8 +28,8 @@ - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git HEAD diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainer.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainer.java index 54c019796553..04536a38c672 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainer.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainer.java @@ -16,8 +16,8 @@ import com.microsoft.azure.arm.model.Creatable; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.storage.v2018_03_01_preview.implementation.StorageManager; -import org.joda.time.DateTime; import java.util.Map; +import org.joda.time.DateTime; /** * Type representing BlobContainer. @@ -96,7 +96,7 @@ public interface BlobContainer extends HasInner, Indexable, /** * The entirety of the BlobContainer definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithBlobService, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithBlobService, DefinitionStages.WithPublicAccess, DefinitionStages.WithMetadata, DefinitionStages.WithCreate { } /** @@ -115,8 +115,35 @@ interface Blank extends WithBlobService { interface WithBlobService { /** * Specifies resourceGroupName, accountName. + * @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 + * @return the next definition stage + */ + WithPublicAccess withExistingBlobService(String resourceGroupName, String accountName); + } + + /** + * The stage of the blobcontainer definition allowing to specify PublicAccess. + */ + interface WithPublicAccess { + /** + * Specifies publicAccess. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @return the next definition stage + */ + WithMetadata withPublicAccess(PublicAccess publicAccess); + } + + /** + * The stage of the blobcontainer definition allowing to specify Metadata. + */ + interface WithMetadata { + /** + * Specifies metadata. + * @param metadata A name-value pair to associate with the container as metadata + * @return the next definition stage */ - WithCreate withExistingBlobService(String resourceGroupName, String accountName); + WithCreate withMetadata(Map metadata); } /** @@ -130,12 +157,36 @@ interface WithCreate extends Creatable { /** * The template for a BlobContainer update operation, containing all the settings that can be modified. */ - interface Update extends Appliable { + interface Update extends Appliable, UpdateStages.WithPublicAccess, UpdateStages.WithMetadata { } /** * Grouping of BlobContainer update stages. */ interface UpdateStages { + /** + * The stage of the blobcontainer update allowing to specify PublicAccess. + */ + interface WithPublicAccess { + /** + * Specifies publicAccess. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @return the next update stage + */ + Update withPublicAccess(PublicAccess publicAccess); + } + + /** + * The stage of the blobcontainer update allowing to specify Metadata. + */ + interface WithMetadata { + /** + * Specifies metadata. + * @param metadata A name-value pair to associate with the container as metadata + * @return the next update stage + */ + Update withMetadata(Map metadata); + } + } } diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainers.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainers.java index d25debdf1248..c149ef6ec7b3 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainers.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/BlobContainers.java @@ -86,6 +86,17 @@ public interface BlobContainers { */ Observable clearLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags); + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable leaseAsync(String resourceGroupName, String accountName, String containerName); + /** * Gets the existing immutability policy along with the corresponding ETag in response headers and body. * diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/CustomDomain.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/CustomDomain.java index f89dcb1e5d07..875be4784514 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/CustomDomain.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/CustomDomain.java @@ -26,8 +26,8 @@ public class CustomDomain { * Indicates whether indirect CName validation is enabled. Default value is * false. This should only be set on updates. */ - @JsonProperty(value = "useSubDomain") - private Boolean useSubDomain; + @JsonProperty(value = "useSubDomainName") + private Boolean useSubDomainName; /** * Get gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. @@ -52,20 +52,20 @@ public CustomDomain withName(String name) { /** * Get indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. * - * @return the useSubDomain value + * @return the useSubDomainName value */ - public Boolean useSubDomain() { - return this.useSubDomain; + public Boolean useSubDomainName() { + return this.useSubDomainName; } /** * Set indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. * - * @param useSubDomain the useSubDomain value to set + * @param useSubDomainName the useSubDomainName value to set * @return the CustomDomain object itself. */ - public CustomDomain withUseSubDomain(Boolean useSubDomain) { - this.useSubDomain = useSubDomain; + public CustomDomain withUseSubDomainName(Boolean useSubDomainName) { + this.useSubDomainName = useSubDomainName; return this; } diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Dimension.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Dimension.java index 360fb387ec97..a8ca737948c5 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Dimension.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/Dimension.java @@ -11,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Dimension of blobs, possiblly be blob type or access tier. + * Dimension of blobs, possibly be blob type or access tier. */ public class Dimension { /** diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ImmutabilityPolicy.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ImmutabilityPolicy.java index 7e1f1681b78c..f5c18548dddc 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ImmutabilityPolicy.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ImmutabilityPolicy.java @@ -55,7 +55,7 @@ public interface ImmutabilityPolicy extends HasInner, I /** * The entirety of the ImmutabilityPolicy definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithContainer, DefinitionStages.WithImmutabilityPeriodSinceCreationInDays, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithContainer, DefinitionStages.WithIfMatch, DefinitionStages.WithImmutabilityPeriodSinceCreationInDays, DefinitionStages.WithCreate { } /** @@ -74,8 +74,24 @@ interface Blank extends WithContainer { interface WithContainer { /** * Specifies resourceGroupName, accountName, containerName. + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number + * @return the next definition stage */ - WithImmutabilityPeriodSinceCreationInDays withExistingContainer(String resourceGroupName, String accountName, String containerName); + WithIfMatch withExistingContainer(String resourceGroupName, String accountName, String containerName); + } + + /** + * The stage of the immutabilitypolicy definition allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied + * @return the next definition stage + */ + WithImmutabilityPeriodSinceCreationInDays withIfMatch(String ifMatch); } /** @@ -84,6 +100,8 @@ interface WithContainer { interface WithImmutabilityPeriodSinceCreationInDays { /** * Specifies immutabilityPeriodSinceCreationInDays. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days + * @return the next definition stage */ WithCreate withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays); } @@ -99,19 +117,33 @@ interface WithCreate extends Creatable { /** * The template for a ImmutabilityPolicy update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, UpdateStages.WithImmutabilityPeriodSinceCreationInDays { + interface Update extends Appliable, UpdateStages.WithIfMatch, UpdateStages.WithImmutabilityPeriodSinceCreationInDays { } /** * Grouping of ImmutabilityPolicy update stages. */ interface UpdateStages { + /** + * The stage of the immutabilitypolicy update allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied + * @return the next update stage + */ + Update withIfMatch(String ifMatch); + } + /** * The stage of the immutabilitypolicy update allowing to specify ImmutabilityPeriodSinceCreationInDays. */ interface WithImmutabilityPeriodSinceCreationInDays { /** * Specifies immutabilityPeriodSinceCreationInDays. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days + * @return the next update stage */ Update withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays); } diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/LeaseContainerRequest.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/LeaseContainerRequest.java new file mode 100644 index 000000000000..20d0da2c4217 --- /dev/null +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/LeaseContainerRequest.java @@ -0,0 +1,152 @@ +/** + * 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_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Lease Container request schema. + */ +public class LeaseContainerRequest { + /** + * Specifies the lease action. Can be one of the available actions. + * Possible values include: 'Acquire', 'Renew', 'Change', 'Release', + * 'Break'. + */ + @JsonProperty(value = "action", required = true) + private String action; + + /** + * Identifies the lease. Can be specified in any valid GUID string format. + */ + @JsonProperty(value = "leaseId") + private String leaseId; + + /** + * Optional. For a break action, proposed duration the lease should + * continue before it is broken, in seconds, between 0 and 60. + */ + @JsonProperty(value = "breakPeriod") + private Integer breakPeriod; + + /** + * Required for acquire. Specifies the duration of the lease, in seconds, + * or negative one (-1) for a lease that never expires. + */ + @JsonProperty(value = "leaseDuration") + private Integer leaseDuration; + + /** + * Optional for acquire, required for change. Proposed lease ID, in a GUID + * string format. + */ + @JsonProperty(value = "proposedLeaseId") + private String proposedLeaseId; + + /** + * Get specifies the lease action. Can be one of the available actions. Possible values include: 'Acquire', 'Renew', 'Change', 'Release', 'Break'. + * + * @return the action value + */ + public String action() { + return this.action; + } + + /** + * Set specifies the lease action. Can be one of the available actions. Possible values include: 'Acquire', 'Renew', 'Change', 'Release', 'Break'. + * + * @param action the action value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withAction(String action) { + this.action = action; + return this; + } + + /** + * Get identifies the lease. Can be specified in any valid GUID string format. + * + * @return the leaseId value + */ + public String leaseId() { + return this.leaseId; + } + + /** + * Set identifies the lease. Can be specified in any valid GUID string format. + * + * @param leaseId the leaseId value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withLeaseId(String leaseId) { + this.leaseId = leaseId; + return this; + } + + /** + * Get optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + * + * @return the breakPeriod value + */ + public Integer breakPeriod() { + return this.breakPeriod; + } + + /** + * Set optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + * + * @param breakPeriod the breakPeriod value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withBreakPeriod(Integer breakPeriod) { + this.breakPeriod = breakPeriod; + return this; + } + + /** + * Get required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + * + * @return the leaseDuration value + */ + public Integer leaseDuration() { + return this.leaseDuration; + } + + /** + * Set required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + * + * @param leaseDuration the leaseDuration value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withLeaseDuration(Integer leaseDuration) { + this.leaseDuration = leaseDuration; + return this; + } + + /** + * Get optional for acquire, required for change. Proposed lease ID, in a GUID string format. + * + * @return the proposedLeaseId value + */ + public String proposedLeaseId() { + return this.proposedLeaseId; + } + + /** + * Set optional for acquire, required for change. Proposed lease ID, in a GUID string format. + * + * @param proposedLeaseId the proposedLeaseId value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withProposedLeaseId(String proposedLeaseId) { + this.proposedLeaseId = proposedLeaseId; + return this; + } + +} diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/LeaseContainerResponse.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/LeaseContainerResponse.java new file mode 100644 index 000000000000..b3bb6832b9d6 --- /dev/null +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/LeaseContainerResponse.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_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2018_03_01_preview.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2018_03_01_preview.implementation.LeaseContainerResponseInner; + +/** + * Type representing LeaseContainerResponse. + */ +public interface LeaseContainerResponse extends HasInner, HasManager { + /** + * @return the leaseId value. + */ + String leaseId(); + + /** + * @return the leaseTimeSeconds value. + */ + String leaseTimeSeconds(); + +} diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ServiceSasParameters.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ServiceSasParameters.java index 89e4208e2c52..cd505f805c40 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ServiceSasParameters.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/ServiceSasParameters.java @@ -12,7 +12,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The parameters to list service SAS credentials of a speicific resource. + * The parameters to list service SAS credentials of a specific resource. */ public class ServiceSasParameters { /** diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccount.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccount.java index 9338ff33a412..ce8569751319 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccount.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccount.java @@ -144,7 +144,9 @@ interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup, Resource.UpdateWithTags { /** * The template for a StorageAccountManagementPolicies update operation, containing all the settings that can be modified. */ - interface Update extends Appliable { + interface Update extends Appliable, UpdateStages.WithPolicy { } /** * Grouping of StorageAccountManagementPolicies update stages. */ interface UpdateStages { + /** + * The stage of the storageaccountmanagementpolicies update allowing to specify Policy. + */ + interface WithPolicy { + /** + * Specifies policy. + * @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 + * @return the next update stage + */ + Update withPolicy(Object policy); + } + } } diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountRegenerateKeyParameters.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountRegenerateKeyParameters.java index c78fc8a24f88..24f224bdbac6 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountRegenerateKeyParameters.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccountRegenerateKeyParameters.java @@ -15,14 +15,14 @@ */ public class StorageAccountRegenerateKeyParameters { /** - * The name of storage keys that want to be regenerated, possible vaules + * The name of storage keys that want to be regenerated, possible values * are key1, key2. */ @JsonProperty(value = "keyName", required = true) private String keyName; /** - * Get the name of storage keys that want to be regenerated, possible vaules are key1, key2. + * Get the name of storage keys that want to be regenerated, possible values are key1, key2. * * @return the keyName value */ @@ -31,7 +31,7 @@ public String keyName() { } /** - * Set the name of storage keys that want to be regenerated, possible vaules are key1, key2. + * Set the name of storage keys that want to be regenerated, possible values are key1, key2. * * @param keyName the keyName value to set * @return the StorageAccountRegenerateKeyParameters object itself. diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccounts.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccounts.java index 9250577e7185..d20553d1ebf1 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccounts.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/StorageAccounts.java @@ -45,7 +45,7 @@ public interface StorageAccounts extends SupportsCreating implements BlobContainer, BlobContainer.Definition, BlobContainer.Update { private final StorageManager manager; private String resourceGroupName; private String accountName; private String containerName; + private PublicAccess cpublicAccess; + private Map cmetadata; + private PublicAccess upublicAccess; + private Map umetadata; BlobContainerImpl(String name, StorageManager manager) { super(name, new BlobContainerInner()); @@ -39,7 +43,7 @@ class BlobContainerImpl extends CreatableUpdatableImpl createResourceAsync() { BlobContainersInner client = this.manager().inner().blobContainers(); - return client.createAsync(this.resourceGroupName, this.accountName, this.containerName) + return client.createAsync(this.resourceGroupName, this.accountName, this.containerName, this.cpublicAccess, this.cmetadata) .map(innerToFluentMap(this)); } @Override public Observable updateResourceAsync() { BlobContainersInner client = this.manager().inner().blobContainers(); - return client.updateAsync(this.resourceGroupName, this.accountName, this.containerName) + return client.updateAsync(this.resourceGroupName, this.accountName, this.containerName, this.upublicAccess, this.umetadata) .map(innerToFluentMap(this)); } @@ -154,4 +158,24 @@ public BlobContainerImpl withExistingBlobService(String resourceGroupName, Strin return this; } + @Override + public BlobContainerImpl withPublicAccess(PublicAccess publicAccess) { + if (isInCreateMode()) { + this.cpublicAccess = publicAccess; + } else { + this.upublicAccess = publicAccess; + } + return this; + } + + @Override + public BlobContainerImpl withMetadata(Map metadata) { + if (isInCreateMode()) { + this.cmetadata = metadata; + } else { + this.umetadata = metadata; + } + return this; + } + } diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersImpl.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersImpl.java index 339a41114f22..bbdabd32e5dc 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersImpl.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersImpl.java @@ -17,6 +17,7 @@ import com.microsoft.azure.management.storage.v2018_03_01_preview.ListContainerItems; import com.microsoft.azure.management.storage.v2018_03_01_preview.BlobContainer; import com.microsoft.azure.management.storage.v2018_03_01_preview.LegalHold; +import com.microsoft.azure.management.storage.v2018_03_01_preview.LeaseContainerResponse; import java.util.List; import com.microsoft.azure.management.storage.v2018_03_01_preview.ImmutabilityPolicy; @@ -120,6 +121,18 @@ public LegalHold call(LegalHoldInner inner) { }); } + @Override + public Observable leaseAsync(String resourceGroupName, String accountName, String containerName) { + BlobContainersInner client = this.inner(); + return client.leaseAsync(resourceGroupName, accountName, containerName) + .map(new Func1() { + @Override + public LeaseContainerResponse call(LeaseContainerResponseInner inner) { + return new LeaseContainerResponseImpl(inner, manager()); + } + }); + } + @Override public Observable getImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName) { BlobContainersInner client = this.inner(); diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java index df52c2da2797..165b0f9a5b9f 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java @@ -16,6 +16,7 @@ import com.microsoft.azure.management.storage.v2018_03_01_preview.BlobContainersExtendImmutabilityPolicyHeaders; import com.microsoft.azure.management.storage.v2018_03_01_preview.BlobContainersGetImmutabilityPolicyHeaders; import com.microsoft.azure.management.storage.v2018_03_01_preview.BlobContainersLockImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.v2018_03_01_preview.LeaseContainerRequest; import com.microsoft.azure.management.storage.v2018_03_01_preview.PublicAccess; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; @@ -114,6 +115,10 @@ interface BlobContainersService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend") Observable> extendImmutabilityPolicy(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Header("accept-language") String acceptLanguage, @Body ImmutabilityPolicyInner parameters, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_03_01_preview.BlobContainers lease" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease") + Observable> lease(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body LeaseContainerRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** @@ -1677,4 +1682,189 @@ private ServiceResponseWithHeaders leaseAsync(String resourceGroupName, String accountName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName), serviceCallback); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LeaseContainerResponseInner object + */ + public Observable leaseAsync(String resourceGroupName, String accountName, String containerName) { + return leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName).map(new Func1, LeaseContainerResponseInner>() { + @Override + public LeaseContainerResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LeaseContainerResponseInner object + */ + public Observable> leaseWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final LeaseContainerRequest parameters = null; + return service.lease(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = leaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @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 LeaseContainerResponseInner object if successful. + */ + public LeaseContainerResponseInner lease(String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters) { + return leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName, parameters).toBlocking().single().body(); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @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 leaseAsync(String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName, parameters), serviceCallback); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LeaseContainerResponseInner object + */ + public Observable leaseAsync(String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters) { + return leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName, parameters).map(new Func1, LeaseContainerResponseInner>() { + @Override + public LeaseContainerResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LeaseContainerResponseInner object + */ + public Observable> leaseWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, LeaseContainerRequest 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.lease(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = leaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse leaseDelegate(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_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ImmutabilityPolicyImpl.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ImmutabilityPolicyImpl.java index 4eff1c639b16..7bddb6297bb9 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ImmutabilityPolicyImpl.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ImmutabilityPolicyImpl.java @@ -18,7 +18,9 @@ class ImmutabilityPolicyImpl extends CreatableUpdatableImpl createResourceAsync() { BlobContainersInner client = this.manager().inner().blobContainers(); - return client.createOrUpdateImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName, this.cimmutabilityPeriodSinceCreationInDays) + return client.createOrUpdateImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName, this.cimmutabilityPeriodSinceCreationInDays, this.cifMatch) .map(innerToFluentMap(this)); } @Override public Observable updateResourceAsync() { BlobContainersInner client = this.manager().inner().blobContainers(); - return client.createOrUpdateImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName, this.uimmutabilityPeriodSinceCreationInDays) + return client.createOrUpdateImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName, this.uimmutabilityPeriodSinceCreationInDays, this.uifMatch) .map(innerToFluentMap(this)); } @@ -110,6 +112,16 @@ public ImmutabilityPolicyImpl withExistingContainer(String resourceGroupName, St return this; } + @Override + public ImmutabilityPolicyImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.cifMatch = ifMatch; + } else { + this.uifMatch = ifMatch; + } + return this; + } + @Override public ImmutabilityPolicyImpl withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays) { if (isInCreateMode()) { diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/LeaseContainerResponseImpl.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/LeaseContainerResponseImpl.java new file mode 100644 index 000000000000..b100457c765a --- /dev/null +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/LeaseContainerResponseImpl.java @@ -0,0 +1,36 @@ +/** + * 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_03_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2018_03_01_preview.LeaseContainerResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class LeaseContainerResponseImpl extends WrapperImpl implements LeaseContainerResponse { + private final StorageManager manager; + LeaseContainerResponseImpl(LeaseContainerResponseInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String leaseId() { + return this.inner().leaseId(); + } + + @Override + public String leaseTimeSeconds() { + return this.inner().leaseTimeSeconds(); + } + +} diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/LeaseContainerResponseInner.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/LeaseContainerResponseInner.java new file mode 100644 index 000000000000..1094eba46a86 --- /dev/null +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/LeaseContainerResponseInner.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_03_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Lease Container response schema. + */ +public class LeaseContainerResponseInner { + /** + * Returned unique lease ID that must be included with any request to + * delete the container, or to renew, change, or release the lease. + */ + @JsonProperty(value = "leaseId") + private String leaseId; + + /** + * Approximate time remaining in the lease period, in seconds. + */ + @JsonProperty(value = "leaseTimeSeconds") + private String leaseTimeSeconds; + + /** + * Get returned unique lease ID that must be included with any request to delete the container, or to renew, change, or release the lease. + * + * @return the leaseId value + */ + public String leaseId() { + return this.leaseId; + } + + /** + * Set returned unique lease ID that must be included with any request to delete the container, or to renew, change, or release the lease. + * + * @param leaseId the leaseId value to set + * @return the LeaseContainerResponseInner object itself. + */ + public LeaseContainerResponseInner withLeaseId(String leaseId) { + this.leaseId = leaseId; + return this; + } + + /** + * Get approximate time remaining in the lease period, in seconds. + * + * @return the leaseTimeSeconds value + */ + public String leaseTimeSeconds() { + return this.leaseTimeSeconds; + } + + /** + * Set approximate time remaining in the lease period, in seconds. + * + * @param leaseTimeSeconds the leaseTimeSeconds value to set + * @return the LeaseContainerResponseInner object itself. + */ + public LeaseContainerResponseInner withLeaseTimeSeconds(String leaseTimeSeconds) { + this.leaseTimeSeconds = leaseTimeSeconds; + return this; + } + +} diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ListServiceSasResponseInner.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ListServiceSasResponseInner.java index a7d8f454128e..ba0d25493b2f 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ListServiceSasResponseInner.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/ListServiceSasResponseInner.java @@ -15,13 +15,13 @@ */ public class ListServiceSasResponseInner { /** - * List service SAS credentials of speicific resource. + * List service SAS credentials of specific resource. */ @JsonProperty(value = "serviceSasToken", access = JsonProperty.Access.WRITE_ONLY) private String serviceSasToken; /** - * Get list service SAS credentials of speicific resource. + * Get list service SAS credentials of specific resource. * * @return the serviceSasToken value */ diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountManagementPoliciesImpl.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountManagementPoliciesImpl.java index 2d7be45a80da..f7cd3bae8631 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountManagementPoliciesImpl.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountManagementPoliciesImpl.java @@ -17,6 +17,8 @@ class StorageAccountManagementPoliciesImpl extends CreatableUpdatableImpl createResourceAsync() { StorageAccountsInner client = this.manager().inner().storageAccounts(); - return client.createOrUpdateManagementPoliciesAsync(this.resourceGroupName, this.accountName) + return client.createOrUpdateManagementPoliciesAsync(this.resourceGroupName, this.accountName, this.cpolicy) .map(innerToFluentMap(this)); } @Override public Observable updateResourceAsync() { StorageAccountsInner client = this.manager().inner().storageAccounts(); - return client.createOrUpdateManagementPoliciesAsync(this.resourceGroupName, this.accountName) + return client.createOrUpdateManagementPoliciesAsync(this.resourceGroupName, this.accountName, this.upolicy) .map(innerToFluentMap(this)); } @@ -100,4 +102,14 @@ public StorageAccountManagementPoliciesImpl withExistingStorageAccount(String re return this; } + @Override + public StorageAccountManagementPoliciesImpl withPolicy(Object policy) { + if (isInCreateMode()) { + this.cpolicy = policy; + } else { + this.upolicy = policy; + } + return this; + } + } diff --git a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountsInner.java b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountsInner.java index 6ffe72a5678f..85fb43cebd58 100644 --- a/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountsInner.java +++ b/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountsInner.java @@ -911,7 +911,7 @@ private ServiceResponse listKeysDelegate(Resp * * @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 keyName The name of storage keys that want to be regenerated, possible vaules are key1, key2. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2. * @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 @@ -926,7 +926,7 @@ public StorageAccountListKeysResultInner regenerateKey(String resourceGroupName, * * @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 keyName The name of storage keys that want to be regenerated, possible vaules are key1, key2. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -940,7 +940,7 @@ public ServiceFuture regenerateKeyAsync(Strin * * @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 keyName The name of storage keys that want to be regenerated, possible vaules are key1, key2. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the StorageAccountListKeysResultInner object */ @@ -958,7 +958,7 @@ public StorageAccountListKeysResultInner call(ServiceResponse com.microsoft.azure azure-arm-parent - 1.0.0 + 0.0.3-beta ../../../pom.xml azure-mgmt-storage @@ -19,7 +19,7 @@ jar Microsoft Azure SDK for Storage Management This package contains Microsoft Storage Management SDK. - https://github.com/Azure/azure-libraries-for-java + https://github.com/Azure/azure-sdk-for-java The MIT License (MIT) @@ -28,8 +28,8 @@ - scm:git:https://github.com/Azure/azure-libraries-for-java - scm:git:git@github.com:Azure/azure-libraries-for-java.git + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git HEAD diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainer.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainer.java index 3094bc2edbce..f8cad4b50282 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainer.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainer.java @@ -16,8 +16,8 @@ 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; import java.util.Map; +import org.joda.time.DateTime; /** * Type representing BlobContainer. @@ -96,7 +96,7 @@ public interface BlobContainer extends HasInner, Indexable, /** * The entirety of the BlobContainer definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithBlobService, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithBlobService, DefinitionStages.WithPublicAccess, DefinitionStages.WithMetadata, DefinitionStages.WithCreate { } /** @@ -115,8 +115,35 @@ interface Blank extends WithBlobService { interface WithBlobService { /** * Specifies resourceGroupName, accountName. + * @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 + * @return the next definition stage + */ + WithPublicAccess withExistingBlobService(String resourceGroupName, String accountName); + } + + /** + * The stage of the blobcontainer definition allowing to specify PublicAccess. + */ + interface WithPublicAccess { + /** + * Specifies publicAccess. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @return the next definition stage + */ + WithMetadata withPublicAccess(PublicAccess publicAccess); + } + + /** + * The stage of the blobcontainer definition allowing to specify Metadata. + */ + interface WithMetadata { + /** + * Specifies metadata. + * @param metadata A name-value pair to associate with the container as metadata + * @return the next definition stage */ - WithCreate withExistingBlobService(String resourceGroupName, String accountName); + WithCreate withMetadata(Map metadata); } /** @@ -130,12 +157,36 @@ interface WithCreate extends Creatable { /** * The template for a BlobContainer update operation, containing all the settings that can be modified. */ - interface Update extends Appliable { + interface Update extends Appliable, UpdateStages.WithPublicAccess, UpdateStages.WithMetadata { } /** * Grouping of BlobContainer update stages. */ interface UpdateStages { + /** + * The stage of the blobcontainer update allowing to specify PublicAccess. + */ + interface WithPublicAccess { + /** + * Specifies publicAccess. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @return the next update stage + */ + Update withPublicAccess(PublicAccess publicAccess); + } + + /** + * The stage of the blobcontainer update allowing to specify Metadata. + */ + interface WithMetadata { + /** + * Specifies metadata. + * @param metadata A name-value pair to associate with the container as metadata + * @return the next update stage + */ + Update withMetadata(Map metadata); + } + } } diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainers.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainers.java index 19a94b05e165..a72756046faf 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainers.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/BlobContainers.java @@ -86,6 +86,17 @@ public interface BlobContainers { */ Observable clearLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags); + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable leaseAsync(String resourceGroupName, String accountName, String containerName); + /** * Gets the existing immutability policy along with the corresponding ETag in response headers and body. * 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..482aa5f47cf9 --- /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,175 @@ +/** + * 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. + * @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 + * @return the next definition stage + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the blobserviceproperties definition allowing to specify Cors. + */ + interface WithCors { + /** + * Specifies cors. + * @param cors 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 next definition stage + */ + WithCreate withCors(CorsRules cors); + } + + /** + * The stage of the blobserviceproperties definition allowing to specify DefaultServiceVersion. + */ + interface WithDefaultServiceVersion { + /** + * Specifies defaultServiceVersion. + * @param defaultServiceVersion 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 next definition stage + */ + WithCreate withDefaultServiceVersion(String defaultServiceVersion); + } + + /** + * The stage of the blobserviceproperties definition allowing to specify DeleteRetentionPolicy. + */ + interface WithDeleteRetentionPolicy { + /** + * Specifies deleteRetentionPolicy. + * @param deleteRetentionPolicy The blob service properties for soft delete + * @return the next definition stage + */ + 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. + * @param cors 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 next update stage + */ + Update withCors(CorsRules cors); + } + + /** + * The stage of the blobserviceproperties update allowing to specify DefaultServiceVersion. + */ + interface WithDefaultServiceVersion { + /** + * Specifies defaultServiceVersion. + * @param defaultServiceVersion 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 next update stage + */ + Update withDefaultServiceVersion(String defaultServiceVersion); + } + + /** + * The stage of the blobserviceproperties update allowing to specify DeleteRetentionPolicy. + */ + interface WithDeleteRetentionPolicy { + /** + * Specifies deleteRetentionPolicy. + * @param deleteRetentionPolicy The blob service properties for soft delete + * @return the next update stage + */ + 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/CustomDomain.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/CustomDomain.java index d94a30c7346d..a8d0a25a03e6 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/CustomDomain.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/CustomDomain.java @@ -26,8 +26,8 @@ public class CustomDomain { * Indicates whether indirect CName validation is enabled. Default value is * false. This should only be set on updates. */ - @JsonProperty(value = "useSubDomain") - private Boolean useSubDomain; + @JsonProperty(value = "useSubDomainName") + private Boolean useSubDomainName; /** * Get gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. @@ -52,20 +52,20 @@ public CustomDomain withName(String name) { /** * Get indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. * - * @return the useSubDomain value + * @return the useSubDomainName value */ - public Boolean useSubDomain() { - return this.useSubDomain; + public Boolean useSubDomainName() { + return this.useSubDomainName; } /** * Set indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. * - * @param useSubDomain the useSubDomain value to set + * @param useSubDomainName the useSubDomainName value to set * @return the CustomDomain object itself. */ - public CustomDomain withUseSubDomain(Boolean useSubDomain) { - this.useSubDomain = useSubDomain; + public CustomDomain withUseSubDomainName(Boolean useSubDomainName) { + this.useSubDomainName = useSubDomainName; 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/Dimension.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Dimension.java index 865d0b65bb53..b6f9ada52d1a 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Dimension.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/Dimension.java @@ -11,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Dimension of blobs, possiblly be blob type or access tier. + * Dimension of blobs, possibly be blob type or access tier. */ public class Dimension { /** diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/GeoReplicationStats.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/GeoReplicationStats.java new file mode 100644 index 000000000000..6a767bc92fee --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/GeoReplicationStats.java @@ -0,0 +1,76 @@ +/** + * 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 org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Statistics related to replication for storage account's Blob, Table, Queue + * and File services. It is only available when geo-redundant replication is + * enabled for the storage account. + */ +public class GeoReplicationStats { + /** + * The status of the secondary location. Possible values are: - Live: + * Indicates that the secondary location is active and operational. - + * Bootstrap: Indicates initial synchronization from the primary location + * to the secondary location is in progress.This typically occurs when + * replication is first enabled. - Unavailable: Indicates that the + * secondary location is temporarily unavailable. Possible values include: + * 'Live', 'Bootstrap', 'Unavailable'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private GeoReplicationStatus status; + + /** + * All primary writes preceding this UTC date/time value are guaranteed to + * be available for read operations. Primary writes following this point in + * time may or may not be available for reads. Element may be default value + * if value of LastSyncTime is not available, this can happen if secondary + * is offline or we are in bootstrap. + */ + @JsonProperty(value = "lastSyncTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastSyncTime; + + /** + * A boolean flag which indicates whether or not account failover is + * supported for the account. + */ + @JsonProperty(value = "canFailover", access = JsonProperty.Access.WRITE_ONLY) + private Boolean canFailover; + + /** + * Get the status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location is temporarily unavailable. Possible values include: 'Live', 'Bootstrap', 'Unavailable'. + * + * @return the status value + */ + public GeoReplicationStatus status() { + return this.status; + } + + /** + * Get all primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary writes following this point in time may or may not be available for reads. Element may be default value if value of LastSyncTime is not available, this can happen if secondary is offline or we are in bootstrap. + * + * @return the lastSyncTime value + */ + public DateTime lastSyncTime() { + return this.lastSyncTime; + } + + /** + * Get a boolean flag which indicates whether or not account failover is supported for the account. + * + * @return the canFailover value + */ + public Boolean canFailover() { + return this.canFailover; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/GeoReplicationStatus.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/GeoReplicationStatus.java new file mode 100644 index 000000000000..78eddbb46689 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/GeoReplicationStatus.java @@ -0,0 +1,44 @@ +/** + * 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.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for GeoReplicationStatus. + */ +public final class GeoReplicationStatus extends ExpandableStringEnum { + /** Static value Live for GeoReplicationStatus. */ + public static final GeoReplicationStatus LIVE = fromString("Live"); + + /** Static value Bootstrap for GeoReplicationStatus. */ + public static final GeoReplicationStatus BOOTSTRAP = fromString("Bootstrap"); + + /** Static value Unavailable for GeoReplicationStatus. */ + public static final GeoReplicationStatus UNAVAILABLE = fromString("Unavailable"); + + /** + * Creates or finds a GeoReplicationStatus from its string representation. + * @param name a name to look for + * @return the corresponding GeoReplicationStatus + */ + @JsonCreator + public static GeoReplicationStatus fromString(String name) { + return fromString(name, GeoReplicationStatus.class); + } + + /** + * @return known GeoReplicationStatus values + */ + public static Collection values() { + return values(GeoReplicationStatus.class); + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ImmutabilityPolicy.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ImmutabilityPolicy.java index a70873dc21f3..9a3f763714f9 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ImmutabilityPolicy.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ImmutabilityPolicy.java @@ -55,7 +55,7 @@ public interface ImmutabilityPolicy extends HasInner, I /** * The entirety of the ImmutabilityPolicy definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithContainer, DefinitionStages.WithImmutabilityPeriodSinceCreationInDays, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithContainer, DefinitionStages.WithIfMatch, DefinitionStages.WithImmutabilityPeriodSinceCreationInDays, DefinitionStages.WithCreate { } /** @@ -74,8 +74,24 @@ interface Blank extends WithContainer { interface WithContainer { /** * Specifies resourceGroupName, accountName, containerName. + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number + * @return the next definition stage */ - WithImmutabilityPeriodSinceCreationInDays withExistingContainer(String resourceGroupName, String accountName, String containerName); + WithIfMatch withExistingContainer(String resourceGroupName, String accountName, String containerName); + } + + /** + * The stage of the immutabilitypolicy definition allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied + * @return the next definition stage + */ + WithImmutabilityPeriodSinceCreationInDays withIfMatch(String ifMatch); } /** @@ -84,6 +100,8 @@ interface WithContainer { interface WithImmutabilityPeriodSinceCreationInDays { /** * Specifies immutabilityPeriodSinceCreationInDays. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days + * @return the next definition stage */ WithCreate withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays); } @@ -99,19 +117,33 @@ interface WithCreate extends Creatable { /** * The template for a ImmutabilityPolicy update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, UpdateStages.WithImmutabilityPeriodSinceCreationInDays { + interface Update extends Appliable, UpdateStages.WithIfMatch, UpdateStages.WithImmutabilityPeriodSinceCreationInDays { } /** * Grouping of ImmutabilityPolicy update stages. */ interface UpdateStages { + /** + * The stage of the immutabilitypolicy update allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied + * @return the next update stage + */ + Update withIfMatch(String ifMatch); + } + /** * The stage of the immutabilitypolicy update allowing to specify ImmutabilityPeriodSinceCreationInDays. */ interface WithImmutabilityPeriodSinceCreationInDays { /** * Specifies immutabilityPeriodSinceCreationInDays. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days + * @return the next update stage */ Update withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays); } diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LeaseContainerRequest.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LeaseContainerRequest.java new file mode 100644 index 000000000000..36270f628dc1 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LeaseContainerRequest.java @@ -0,0 +1,152 @@ +/** + * 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; + +/** + * Lease Container request schema. + */ +public class LeaseContainerRequest { + /** + * Specifies the lease action. Can be one of the available actions. + * Possible values include: 'Acquire', 'Renew', 'Change', 'Release', + * 'Break'. + */ + @JsonProperty(value = "action", required = true) + private String action; + + /** + * Identifies the lease. Can be specified in any valid GUID string format. + */ + @JsonProperty(value = "leaseId") + private String leaseId; + + /** + * Optional. For a break action, proposed duration the lease should + * continue before it is broken, in seconds, between 0 and 60. + */ + @JsonProperty(value = "breakPeriod") + private Integer breakPeriod; + + /** + * Required for acquire. Specifies the duration of the lease, in seconds, + * or negative one (-1) for a lease that never expires. + */ + @JsonProperty(value = "leaseDuration") + private Integer leaseDuration; + + /** + * Optional for acquire, required for change. Proposed lease ID, in a GUID + * string format. + */ + @JsonProperty(value = "proposedLeaseId") + private String proposedLeaseId; + + /** + * Get specifies the lease action. Can be one of the available actions. Possible values include: 'Acquire', 'Renew', 'Change', 'Release', 'Break'. + * + * @return the action value + */ + public String action() { + return this.action; + } + + /** + * Set specifies the lease action. Can be one of the available actions. Possible values include: 'Acquire', 'Renew', 'Change', 'Release', 'Break'. + * + * @param action the action value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withAction(String action) { + this.action = action; + return this; + } + + /** + * Get identifies the lease. Can be specified in any valid GUID string format. + * + * @return the leaseId value + */ + public String leaseId() { + return this.leaseId; + } + + /** + * Set identifies the lease. Can be specified in any valid GUID string format. + * + * @param leaseId the leaseId value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withLeaseId(String leaseId) { + this.leaseId = leaseId; + return this; + } + + /** + * Get optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + * + * @return the breakPeriod value + */ + public Integer breakPeriod() { + return this.breakPeriod; + } + + /** + * Set optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + * + * @param breakPeriod the breakPeriod value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withBreakPeriod(Integer breakPeriod) { + this.breakPeriod = breakPeriod; + return this; + } + + /** + * Get required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + * + * @return the leaseDuration value + */ + public Integer leaseDuration() { + return this.leaseDuration; + } + + /** + * Set required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + * + * @param leaseDuration the leaseDuration value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withLeaseDuration(Integer leaseDuration) { + this.leaseDuration = leaseDuration; + return this; + } + + /** + * Get optional for acquire, required for change. Proposed lease ID, in a GUID string format. + * + * @return the proposedLeaseId value + */ + public String proposedLeaseId() { + return this.proposedLeaseId; + } + + /** + * Set optional for acquire, required for change. Proposed lease ID, in a GUID string format. + * + * @param proposedLeaseId the proposedLeaseId value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withProposedLeaseId(String proposedLeaseId) { + this.proposedLeaseId = proposedLeaseId; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LeaseContainerResponse.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LeaseContainerResponse.java new file mode 100644 index 000000000000..7250ed0e30bd --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/LeaseContainerResponse.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.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2018_07_01.implementation.LeaseContainerResponseInner; + +/** + * Type representing LeaseContainerResponse. + */ +public interface LeaseContainerResponse extends HasInner, HasManager { + /** + * @return the leaseId value. + */ + String leaseId(); + + /** + * @return the leaseTimeSeconds value. + */ + String leaseTimeSeconds(); + +} 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/SKUCapability.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/SKUCapability.java index d6557a5d4f92..525186013042 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/SKUCapability.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/SKUCapability.java @@ -11,13 +11,13 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The capability information in the specified sku, including file encryption, - * network acls, change notification, etc. + * The capability information in the specified SKU, including file encryption, + * network ACLs, change notification, etc. */ public class SKUCapability { /** - * The name of capability, The capability information in the specified sku, - * including file encryption, network acls, change notification, etc. + * The name of capability, The capability information in the specified SKU, + * including file encryption, network ACLs, change notification, etc. */ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; @@ -30,7 +30,7 @@ public class SKUCapability { private String value; /** - * Get the name of capability, The capability information in the specified sku, including file encryption, network acls, change notification, etc. + * Get the name of capability, The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. * * @return the name value */ diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ServiceSasParameters.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ServiceSasParameters.java index fc8c469d9632..623550b03ebe 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ServiceSasParameters.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/ServiceSasParameters.java @@ -12,7 +12,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The parameters to list service SAS credentials of a speicific resource. + * The parameters to list service SAS credentials of a specific resource. */ public class ServiceSasParameters { /** diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccount.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccount.java index eca1971d1f5f..124265b35ef9 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccount.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccount.java @@ -56,6 +56,16 @@ public interface StorageAccount extends HasInner, Resource, */ Encryption encryption(); + /** + * @return the failoverInProgress value. + */ + Boolean failoverInProgress(); + + /** + * @return the geoReplicationStats value. + */ + GeoReplicationStats geoReplicationStats(); + /** * @return the identity value. */ @@ -149,7 +159,9 @@ interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup, Resource.UpdateWithTags, 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.WithPolicy, 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. + * @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 + * @return the next definition stage + */ + WithPolicy withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the storageaccountmanagementpolicies definition allowing to specify Policy. + */ + interface WithPolicy { + /** + * Specifies policy. + * @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 + * @return the next definition stage + */ + WithCreate withPolicy(Object policy); + } + + /** + * 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, UpdateStages.WithPolicy { + } + + /** + * Grouping of StorageAccountManagementPolicies update stages. + */ + interface UpdateStages { + /** + * The stage of the storageaccountmanagementpolicies update allowing to specify Policy. + */ + interface WithPolicy { + /** + * Specifies policy. + * @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 + * @return the next update stage + */ + Update withPolicy(Object policy); + } + + } +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountRegenerateKeyParameters.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountRegenerateKeyParameters.java index a81e8d8647dc..36ac7d94db62 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountRegenerateKeyParameters.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountRegenerateKeyParameters.java @@ -15,14 +15,14 @@ */ public class StorageAccountRegenerateKeyParameters { /** - * The name of storage keys that want to be regenerated, possible vaules + * The name of storage keys that want to be regenerated, possible values * are key1, key2. */ @JsonProperty(value = "keyName", required = true) private String keyName; /** - * Get the name of storage keys that want to be regenerated, possible vaules are key1, key2. + * Get the name of storage keys that want to be regenerated, possible values are key1, key2. * * @return the keyName value */ @@ -31,7 +31,7 @@ public String keyName() { } /** - * Set the name of storage keys that want to be regenerated, possible vaules are key1, key2. + * Set the name of storage keys that want to be regenerated, possible values are key1, key2. * * @param keyName the keyName value to set * @return the StorageAccountRegenerateKeyParameters object itself. diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountUpdateParameters.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountUpdateParameters.java index 2970b7306691..90ab30164729 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountUpdateParameters.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccountUpdateParameters.java @@ -21,7 +21,7 @@ public class StorageAccountUpdateParameters { /** * Gets or sets the SKU name. Note that the SKU name cannot be updated to - * Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those sku + * Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU * names be updated to any other value. */ @JsonProperty(value = "sku") @@ -93,7 +93,7 @@ public class StorageAccountUpdateParameters { private Kind kind; /** - * Get gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those sku names be updated to any other value. + * Get gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other value. * * @return the sku value */ @@ -102,7 +102,7 @@ public SkuInner sku() { } /** - * Set gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those sku names be updated to any other value. + * Set gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other value. * * @param sku the sku value to set * @return the StorageAccountUpdateParameters object itself. diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccounts.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccounts.java index 2556de0e4625..c7283d8c7c27 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccounts.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/StorageAccounts.java @@ -15,6 +15,7 @@ import rx.Observable; import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; import com.microsoft.azure.management.storage.v2018_07_01.implementation.StorageAccountsInner; import com.microsoft.azure.arm.model.HasInner; @@ -37,7 +38,7 @@ public interface StorageAccounts extends SupportsCreating listServiceSASAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters); + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @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 failoverAsync(String resourceGroupName, String accountName); + /** * Checks that the storage account name is valid and is not already in use. * diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainerImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainerImpl.java index 0d07f2299081..7d0eac4eb1a6 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainerImpl.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainerImpl.java @@ -11,20 +11,24 @@ import com.microsoft.azure.management.storage.v2018_07_01.BlobContainer; import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; import rx.Observable; +import com.microsoft.azure.management.storage.v2018_07_01.PublicAccess; +import java.util.Map; import com.microsoft.azure.management.storage.v2018_07_01.ImmutabilityPolicyProperties; import org.joda.time.DateTime; import com.microsoft.azure.management.storage.v2018_07_01.LeaseDuration; import com.microsoft.azure.management.storage.v2018_07_01.LeaseState; import com.microsoft.azure.management.storage.v2018_07_01.LeaseStatus; import com.microsoft.azure.management.storage.v2018_07_01.LegalHoldProperties; -import java.util.Map; -import com.microsoft.azure.management.storage.v2018_07_01.PublicAccess; class BlobContainerImpl extends CreatableUpdatableImpl implements BlobContainer, BlobContainer.Definition, BlobContainer.Update { private final StorageManager manager; private String resourceGroupName; private String accountName; private String containerName; + private PublicAccess cpublicAccess; + private Map cmetadata; + private PublicAccess upublicAccess; + private Map umetadata; BlobContainerImpl(String name, StorageManager manager) { super(name, new BlobContainerInner()); @@ -39,7 +43,7 @@ class BlobContainerImpl extends CreatableUpdatableImpl createResourceAsync() { BlobContainersInner client = this.manager().inner().blobContainers(); - return client.createAsync(this.resourceGroupName, this.accountName, this.containerName) + return client.createAsync(this.resourceGroupName, this.accountName, this.containerName, this.cpublicAccess, this.cmetadata) .map(innerToFluentMap(this)); } @Override public Observable updateResourceAsync() { BlobContainersInner client = this.manager().inner().blobContainers(); - return client.updateAsync(this.resourceGroupName, this.accountName, this.containerName) + return client.updateAsync(this.resourceGroupName, this.accountName, this.containerName, this.upublicAccess, this.umetadata) .map(innerToFluentMap(this)); } @@ -154,4 +158,24 @@ public BlobContainerImpl withExistingBlobService(String resourceGroupName, Strin return this; } + @Override + public BlobContainerImpl withPublicAccess(PublicAccess publicAccess) { + if (isInCreateMode()) { + this.cpublicAccess = publicAccess; + } else { + this.upublicAccess = publicAccess; + } + return this; + } + + @Override + public BlobContainerImpl withMetadata(Map metadata) { + if (isInCreateMode()) { + this.cmetadata = metadata; + } else { + this.umetadata = metadata; + } + return this; + } + } diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainersImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainersImpl.java index f95e86181d0f..87f5e94fe088 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainersImpl.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/BlobContainersImpl.java @@ -17,6 +17,7 @@ import com.microsoft.azure.management.storage.v2018_07_01.ListContainerItems; import com.microsoft.azure.management.storage.v2018_07_01.BlobContainer; import com.microsoft.azure.management.storage.v2018_07_01.LegalHold; +import com.microsoft.azure.management.storage.v2018_07_01.LeaseContainerResponse; import java.util.List; import com.microsoft.azure.management.storage.v2018_07_01.ImmutabilityPolicy; @@ -120,6 +121,18 @@ public LegalHold call(LegalHoldInner inner) { }); } + @Override + public Observable leaseAsync(String resourceGroupName, String accountName, String containerName) { + BlobContainersInner client = this.inner(); + return client.leaseAsync(resourceGroupName, accountName, containerName) + .map(new Func1() { + @Override + public LeaseContainerResponse call(LeaseContainerResponseInner inner) { + return new LeaseContainerResponseImpl(inner, manager()); + } + }); + } + @Override public Observable getImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName) { BlobContainersInner client = this.inner(); 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..f2f41a302356 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 @@ -16,6 +16,7 @@ import com.microsoft.azure.management.storage.v2018_07_01.BlobContainersExtendImmutabilityPolicyHeaders; import com.microsoft.azure.management.storage.v2018_07_01.BlobContainersGetImmutabilityPolicyHeaders; import com.microsoft.azure.management.storage.v2018_07_01.BlobContainersLockImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.v2018_07_01.LeaseContainerRequest; import com.microsoft.azure.management.storage.v2018_07_01.PublicAccess; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; @@ -114,6 +115,10 @@ interface BlobContainersService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend") Observable> extendImmutabilityPolicy(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Header("accept-language") String acceptLanguage, @Body ImmutabilityPolicyInner parameters, @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.BlobContainers lease" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease") + Observable> lease(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body LeaseContainerRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** @@ -178,10 +183,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 +274,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 +371,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 +466,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 +563,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 +658,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 +748,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 +844,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 +945,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 +1046,12 @@ public Observable, Observable>>() { @Override public Observable> call(Response response) { @@ -1157,13 +1142,11 @@ public Observable, Observable>>() { @Override public Observable> call(Response response) { @@ -1253,12 +1236,10 @@ public Observable, Observable>>() { @Override public Observable> call(Response response) { @@ -1345,11 +1326,9 @@ public Observable, Observable>>() { @Override public Observable> call(Response response) { @@ -1443,14 +1422,12 @@ public Observable, Observable>>() { @Override public Observable> call(Response response) { @@ -1544,13 +1521,11 @@ public Observable, Observable>>() { @Override public Observable> call(Response response) { @@ -1648,15 +1623,13 @@ public Observable, Observable>>() { @Override public Observable> call(Response response) { @@ -1677,4 +1650,185 @@ private ServiceResponseWithHeaders leaseAsync(String resourceGroupName, String accountName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName), serviceCallback); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LeaseContainerResponseInner object + */ + public Observable leaseAsync(String resourceGroupName, String accountName, String containerName) { + return leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName).map(new Func1, LeaseContainerResponseInner>() { + @Override + public LeaseContainerResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LeaseContainerResponseInner object + */ + public Observable> leaseWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 apiVersion = "2018-07-01"; + final LeaseContainerRequest parameters = null; + return service.lease(resourceGroupName, accountName, containerName, this.client.subscriptionId(), apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = leaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @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 LeaseContainerResponseInner object if successful. + */ + public LeaseContainerResponseInner lease(String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters) { + return leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName, parameters).toBlocking().single().body(); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @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 leaseAsync(String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName, parameters), serviceCallback); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LeaseContainerResponseInner object + */ + public Observable leaseAsync(String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters) { + return leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName, parameters).map(new Func1, LeaseContainerResponseInner>() { + @Override + public LeaseContainerResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LeaseContainerResponseInner object + */ + public Observable> leaseWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, LeaseContainerRequest 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-07-01"; + return service.lease(resourceGroupName, accountName, containerName, this.client.subscriptionId(), apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = leaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse leaseDelegate(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/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..fa527e840935 --- /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(); + // set resource ancestor and positional variables + 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/ImmutabilityPolicyImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ImmutabilityPolicyImpl.java index 6940a6bd79fa..156cb9d3fc4e 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ImmutabilityPolicyImpl.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ImmutabilityPolicyImpl.java @@ -18,7 +18,9 @@ class ImmutabilityPolicyImpl extends CreatableUpdatableImpl createResourceAsync() { BlobContainersInner client = this.manager().inner().blobContainers(); - return client.createOrUpdateImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName, this.cimmutabilityPeriodSinceCreationInDays) + return client.createOrUpdateImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName, this.cimmutabilityPeriodSinceCreationInDays, this.cifMatch) .map(innerToFluentMap(this)); } @Override public Observable updateResourceAsync() { BlobContainersInner client = this.manager().inner().blobContainers(); - return client.createOrUpdateImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName, this.uimmutabilityPeriodSinceCreationInDays) + return client.createOrUpdateImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName, this.uimmutabilityPeriodSinceCreationInDays, this.uifMatch) .map(innerToFluentMap(this)); } @@ -110,6 +112,16 @@ public ImmutabilityPolicyImpl withExistingContainer(String resourceGroupName, St return this; } + @Override + public ImmutabilityPolicyImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.cifMatch = ifMatch; + } else { + this.uifMatch = ifMatch; + } + return this; + } + @Override public ImmutabilityPolicyImpl withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays) { if (isInCreateMode()) { diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/LeaseContainerResponseImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/LeaseContainerResponseImpl.java new file mode 100644 index 000000000000..3b7f81c37079 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/LeaseContainerResponseImpl.java @@ -0,0 +1,36 @@ +/** + * 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.LeaseContainerResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class LeaseContainerResponseImpl extends WrapperImpl implements LeaseContainerResponse { + private final StorageManager manager; + LeaseContainerResponseImpl(LeaseContainerResponseInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String leaseId() { + return this.inner().leaseId(); + } + + @Override + public String leaseTimeSeconds() { + return this.inner().leaseTimeSeconds(); + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/LeaseContainerResponseInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/LeaseContainerResponseInner.java new file mode 100644 index 000000000000..963ca029e2b9 --- /dev/null +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/LeaseContainerResponseInner.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.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Lease Container response schema. + */ +public class LeaseContainerResponseInner { + /** + * Returned unique lease ID that must be included with any request to + * delete the container, or to renew, change, or release the lease. + */ + @JsonProperty(value = "leaseId") + private String leaseId; + + /** + * Approximate time remaining in the lease period, in seconds. + */ + @JsonProperty(value = "leaseTimeSeconds") + private String leaseTimeSeconds; + + /** + * Get returned unique lease ID that must be included with any request to delete the container, or to renew, change, or release the lease. + * + * @return the leaseId value + */ + public String leaseId() { + return this.leaseId; + } + + /** + * Set returned unique lease ID that must be included with any request to delete the container, or to renew, change, or release the lease. + * + * @param leaseId the leaseId value to set + * @return the LeaseContainerResponseInner object itself. + */ + public LeaseContainerResponseInner withLeaseId(String leaseId) { + this.leaseId = leaseId; + return this; + } + + /** + * Get approximate time remaining in the lease period, in seconds. + * + * @return the leaseTimeSeconds value + */ + public String leaseTimeSeconds() { + return this.leaseTimeSeconds; + } + + /** + * Set approximate time remaining in the lease period, in seconds. + * + * @param leaseTimeSeconds the leaseTimeSeconds value to set + * @return the LeaseContainerResponseInner object itself. + */ + public LeaseContainerResponseInner withLeaseTimeSeconds(String leaseTimeSeconds) { + this.leaseTimeSeconds = leaseTimeSeconds; + return this; + } + +} diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListServiceSasResponseInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListServiceSasResponseInner.java index 81bad787aefe..b72a19298825 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListServiceSasResponseInner.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/ListServiceSasResponseInner.java @@ -15,13 +15,13 @@ */ public class ListServiceSasResponseInner { /** - * List service SAS credentials of speicific resource. + * List service SAS credentials of specific resource. */ @JsonProperty(value = "serviceSasToken", access = JsonProperty.Access.WRITE_ONLY) private String serviceSasToken; /** - * Get list service SAS credentials of speicific resource. + * Get list service SAS credentials of specific resource. * * @return the serviceSasToken value */ 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/SkuInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/SkuInner.java index 6473ac9f21ea..b834c87dfe41 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/SkuInner.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/SkuInner.java @@ -21,8 +21,8 @@ */ public class SkuInner { /** - * Gets or sets the sku name. Required for account creation; optional for - * update. Note that in older versions, sku name was called accountType. + * Gets or sets the SKU name. Required for account creation; optional for + * update. Note that in older versions, SKU name was called accountType. * Possible values include: 'Standard_LRS', 'Standard_GRS', * 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS'. */ @@ -30,7 +30,7 @@ public class SkuInner { private SkuName name; /** - * Gets the sku tier. This is based on the SKU name. Possible values + * Gets the SKU tier. This is based on the SKU name. Possible values * include: 'Standard', 'Premium'. */ @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) @@ -59,8 +59,8 @@ public class SkuInner { private List locations; /** - * The capability information in the specified sku, including file - * encryption, network acls, change notification, etc. + * The capability information in the specified SKU, including file + * encryption, network ACLs, change notification, etc. */ @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) private List capabilities; @@ -73,7 +73,7 @@ public class SkuInner { private List restrictions; /** - * Get gets or sets the sku name. Required for account creation; optional for update. Note that in older versions, sku name was called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS'. + * Get gets or sets the SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS'. * * @return the name value */ @@ -82,7 +82,7 @@ public SkuName name() { } /** - * Set gets or sets the sku name. Required for account creation; optional for update. Note that in older versions, sku name was called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS'. + * Set gets or sets the SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS'. * * @param name the name value to set * @return the SkuInner object itself. @@ -93,7 +93,7 @@ public SkuInner withName(SkuName name) { } /** - * Get gets the sku tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium'. + * Get gets the SKU tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium'. * * @return the tier value */ @@ -129,7 +129,7 @@ public List locations() { } /** - * Get the capability information in the specified sku, including file encryption, network acls, change notification, etc. + * Get the capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. * * @return the capabilities value */ 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/StorageAccountImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountImpl.java index 7d38ffba6fc2..cb28d289fd30 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountImpl.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountImpl.java @@ -17,6 +17,7 @@ import org.joda.time.DateTime; import com.microsoft.azure.management.storage.v2018_07_01.CustomDomain; import com.microsoft.azure.management.storage.v2018_07_01.Encryption; +import com.microsoft.azure.management.storage.v2018_07_01.GeoReplicationStats; import com.microsoft.azure.management.storage.v2018_07_01.Identity; import com.microsoft.azure.management.storage.v2018_07_01.Kind; import com.microsoft.azure.management.storage.v2018_07_01.NetworkRuleSet; @@ -111,6 +112,16 @@ public Encryption encryption() { return this.inner().encryption(); } + @Override + public Boolean failoverInProgress() { + return this.inner().failoverInProgress(); + } + + @Override + public GeoReplicationStats geoReplicationStats() { + return this.inner().geoReplicationStats(); + } + @Override public Identity identity() { return this.inner().identity(); diff --git a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountInner.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountInner.java index a1a80e5cdca4..c4f28d227479 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountInner.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountInner.java @@ -18,6 +18,7 @@ import com.microsoft.azure.management.storage.v2018_07_01.Encryption; import com.microsoft.azure.management.storage.v2018_07_01.AccessTier; import com.microsoft.azure.management.storage.v2018_07_01.NetworkRuleSet; +import com.microsoft.azure.management.storage.v2018_07_01.GeoReplicationStats; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.Resource; @@ -160,6 +161,19 @@ public class StorageAccountInner extends Resource { @JsonProperty(value = "properties.isHnsEnabled") private Boolean isHnsEnabled; + /** + * Geo Replication Stats. + */ + @JsonProperty(value = "properties.geoReplicationStats", access = JsonProperty.Access.WRITE_ONLY) + private GeoReplicationStats geoReplicationStats; + + /** + * If the failover is in progress, the value will be true, otherwise, it + * will be null. + */ + @JsonProperty(value = "properties.failoverInProgress", access = JsonProperty.Access.WRITE_ONLY) + private Boolean failoverInProgress; + /** * Get gets the SKU. * @@ -375,4 +389,22 @@ public StorageAccountInner withIsHnsEnabled(Boolean isHnsEnabled) { return this; } + /** + * Get geo Replication Stats. + * + * @return the geoReplicationStats value + */ + public GeoReplicationStats geoReplicationStats() { + return this.geoReplicationStats; + } + + /** + * Get if the failover is in progress, the value will be true, otherwise, it will be null. + * + * @return the failoverInProgress value + */ + public Boolean failoverInProgress() { + return this.failoverInProgress; + } + } 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..3b5521cc4fa6 --- /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,115 @@ +/** + * 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; + private Object cpolicy; + private Object upolicy; + + 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(); + // set resource ancestor and positional variables + 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, this.cpolicy) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ManagementPoliciesInner client = this.manager().inner().managementPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.upolicy) + .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; + } + + @Override + public StorageAccountManagementPoliciesImpl withPolicy(Object policy) { + if (isInCreateMode()) { + this.cpolicy = policy; + } else { + this.upolicy = policy; + } + 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/StorageAccountsImpl.java b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountsImpl.java index df33dc4aa49a..e9b4942c0a70 100644 --- a/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountsImpl.java +++ b/storage/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/storage/v2018_07_01/implementation/StorageAccountsImpl.java @@ -179,6 +179,12 @@ public ListServiceSasResponse call(ListServiceSasResponseInner inner) { }); } + @Override + public Completable failoverAsync(String resourceGroupName, String accountName) { + StorageAccountsInner client = this.inner(); + return client.failoverAsync(resourceGroupName, accountName).toCompletable(); + } + @Override public Observable checkNameAvailabilityAsync(String name) { StorageAccountsInner client = this.inner(); 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..738bbd091aa0 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 @@ -18,6 +18,7 @@ import com.microsoft.azure.management.storage.v2018_07_01.ServiceSasParameters; import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountCheckNameAvailabilityParameters; import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountCreateParameters; +import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountExpand; import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountRegenerateKeyParameters; import com.microsoft.azure.management.storage.v2018_07_01.StorageAccountUpdateParameters; import com.microsoft.azure.Page; @@ -42,6 +43,10 @@ import retrofit2.Response; import rx.functions.Func1; import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; /** * An instance of this class provides access to all the operations defined @@ -87,7 +92,7 @@ interface StorageAccountsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.StorageAccounts getByResourceGroup" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}") - Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") StorageAccountExpand expand, @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.StorageAccounts update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}") @@ -117,6 +122,14 @@ interface StorageAccountsService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas") Observable> listServiceSAS(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body ServiceSasParameters parameters, @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.StorageAccounts failover" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover") + Observable> failover(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2018_07_01.StorageAccounts beginFailover" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover") + Observable> beginFailover(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** @@ -171,15 +184,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 +280,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 +355,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 +440,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 +525,90 @@ 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."); + final String apiVersion = "2018-07-01"; + final StorageAccountExpand expand = null; + return service.getByResourceGroup(resourceGroupName, accountName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @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 expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats. Possible values include: 'geoReplicationStats' + * @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 StorageAccountInner object if successful. + */ + public StorageAccountInner getByResourceGroup(String resourceGroupName, String accountName, StorageAccountExpand expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName, expand).toBlocking().single().body(); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @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 expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats. Possible values include: 'geoReplicationStats' + * @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 getByResourceGroupAsync(String resourceGroupName, String accountName, StorageAccountExpand expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName, expand), serviceCallback); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @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 expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats. Possible values include: 'geoReplicationStats' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName, StorageAccountExpand expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName, expand).map(new Func1, StorageAccountInner>() { + @Override + public StorageAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @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 expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats. Possible values include: 'geoReplicationStats' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountExpand expand) { + 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."); } - return service.getByResourceGroup(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-07-01"; + return service.getByResourceGroup(resourceGroupName, accountName, this.client.subscriptionId(), apiVersion, expand, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -613,11 +698,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 +773,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 +859,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 +948,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) { @@ -898,7 +975,7 @@ private ServiceResponse listKeysDelegate(Resp * * @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 keyName The name of storage keys that want to be regenerated, possible vaules are key1, key2. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2. * @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 @@ -913,7 +990,7 @@ public StorageAccountListKeysResultInner regenerateKey(String resourceGroupName, * * @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 keyName The name of storage keys that want to be regenerated, possible vaules are key1, key2. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -927,7 +1004,7 @@ public ServiceFuture regenerateKeyAsync(Strin * * @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 keyName The name of storage keys that want to be regenerated, possible vaules are key1, key2. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the StorageAccountListKeysResultInner object */ @@ -945,7 +1022,7 @@ public StorageAccountListKeysResultInner call(ServiceResponse> 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 +1132,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 +1224,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) { @@ -1176,4 +1247,154 @@ private ServiceResponse listServiceSASDelegate(Resp .build(response); } + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @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 failover(String resourceGroupName, String accountName) { + failoverWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().last().body(); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @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 failoverAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(failoverWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @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 + */ + public Observable failoverAsync(String resourceGroupName, String accountName) { + return failoverWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @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 + */ + public Observable> failoverWithServiceResponseAsync(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 apiVersion = "2018-07-01"; + Observable> observable = service.failover(resourceGroupName, accountName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @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 beginFailover(String resourceGroupName, String accountName) { + beginFailoverWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @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 beginFailoverAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginFailoverWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @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 beginFailoverAsync(String resourceGroupName, String accountName) { + return beginFailoverWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @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> beginFailoverWithServiceResponseAsync(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 apiVersion = "2018-07-01"; + return service.beginFailover(resourceGroupName, accountName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginFailoverDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginFailoverDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, 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/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..5fe21a7ac339 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,23 +51,11 @@ 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. */ + /** The preferred language for the response. */ private String acceptLanguage; /** - * Gets Gets or sets the preferred language for the response. + * Gets The preferred language for the response. * * @return the acceptLanguage value. */ @@ -76,7 +64,7 @@ public String acceptLanguage() { } /** - * Sets Gets or sets the preferred language for the response. + * Sets The preferred language for the response. * * @param acceptLanguage the acceptLanguage value. * @return the service client itself @@ -86,11 +74,11 @@ public StorageManagementClientImpl withAcceptLanguage(String acceptLanguage) { return this; } - /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ private int longRunningOperationRetryTimeout; /** - * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. * * @return the longRunningOperationRetryTimeout value. */ @@ -99,7 +87,7 @@ public int longRunningOperationRetryTimeout() { } /** - * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. * * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. * @return the service client itself @@ -109,11 +97,11 @@ public StorageManagementClientImpl withLongRunningOperationRetryTimeout(int long return this; } - /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ private boolean generateClientRequestId; /** - * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * * @return the generateClientRequestId value. */ @@ -122,7 +110,7 @@ public boolean generateClientRequestId() { } /** - * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * * @param generateClientRequestId the generateClientRequestId value. * @return the service client itself @@ -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, %s, auto-generated)", super.userAgent(), "StorageManagementClient", "2018-07-01"); } } 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) { diff --git a/storage/resource-manager/v2019_04_01/pom.xml b/storage/resource-manager/v2019_04_01/pom.xml new file mode 100644 index 000000000000..a9c1ce125116 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.storage.v2019_04_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-storage + 1.0.0-beta + jar + Microsoft Azure SDK for Storage Management + This package contains Microsoft Storage Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/AccessTier.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/AccessTier.java new file mode 100644 index 000000000000..6bb2e43473ae --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/AccessTier.java @@ -0,0 +1,53 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AccessTier. + */ +public enum AccessTier { + /** Enum value Hot. */ + HOT("Hot"), + + /** Enum value Cool. */ + COOL("Cool"); + + /** The actual serialized value for a AccessTier instance. */ + private String value; + + AccessTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccessTier instance. + * + * @param value the serialized value to parse. + * @return the parsed AccessTier object, or null if unable to parse. + */ + @JsonCreator + public static AccessTier fromString(String value) { + AccessTier[] items = AccessTier.values(); + for (AccessTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/AccountSasParameters.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/AccountSasParameters.java new file mode 100644 index 000000000000..ea5d217065d1 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/AccountSasParameters.java @@ -0,0 +1,236 @@ +/** + * 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.v2019_04_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters to list SAS credentials of a storage account. + */ +public class AccountSasParameters { + /** + * The signed services accessible with the account SAS. Possible values + * include: Blob (b), Queue (q), Table (t), File (f). Possible values + * include: 'b', 'q', 't', 'f'. + */ + @JsonProperty(value = "signedServices", required = true) + private Services services; + + /** + * The signed resource types that are accessible with the account SAS. + * Service (s): Access to service-level APIs; Container (c): Access to + * container-level APIs; Object (o): Access to object-level APIs for blobs, + * queue messages, table entities, and files. Possible values include: 's', + * 'c', 'o'. + */ + @JsonProperty(value = "signedResourceTypes", required = true) + private SignedResourceTypes resourceTypes; + + /** + * The signed permissions for the account SAS. Possible values include: + * Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update + * (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', + * 'c', 'u', 'p'. + */ + @JsonProperty(value = "signedPermission", required = true) + private Permissions permissions; + + /** + * An IP address or a range of IP addresses from which to accept requests. + */ + @JsonProperty(value = "signedIp") + private String iPAddressOrRange; + + /** + * The protocol permitted for a request made with the account SAS. Possible + * values include: 'https,http', 'https'. + */ + @JsonProperty(value = "signedProtocol") + private HttpProtocol protocols; + + /** + * The time at which the SAS becomes valid. + */ + @JsonProperty(value = "signedStart") + private DateTime sharedAccessStartTime; + + /** + * The time at which the shared access signature becomes invalid. + */ + @JsonProperty(value = "signedExpiry", required = true) + private DateTime sharedAccessExpiryTime; + + /** + * The key to sign the account SAS token with. + */ + @JsonProperty(value = "keyToSign") + private String keyToSign; + + /** + * Get the signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). Possible values include: 'b', 'q', 't', 'f'. + * + * @return the services value + */ + public Services services() { + return this.services; + } + + /** + * Set the signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). Possible values include: 'b', 'q', 't', 'f'. + * + * @param services the services value to set + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withServices(Services services) { + this.services = services; + return this; + } + + /** + * Get the signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. Possible values include: 's', 'c', 'o'. + * + * @return the resourceTypes value + */ + public SignedResourceTypes resourceTypes() { + return this.resourceTypes; + } + + /** + * Set the signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. Possible values include: 's', 'c', 'o'. + * + * @param resourceTypes the resourceTypes value to set + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withResourceTypes(SignedResourceTypes resourceTypes) { + this.resourceTypes = resourceTypes; + return this; + } + + /** + * Get the signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. + * + * @return the permissions value + */ + public Permissions permissions() { + return this.permissions; + } + + /** + * Set the signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. + * + * @param permissions the permissions value to set + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withPermissions(Permissions permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get an IP address or a range of IP addresses from which to accept requests. + * + * @return the iPAddressOrRange value + */ + public String iPAddressOrRange() { + return this.iPAddressOrRange; + } + + /** + * Set an IP address or a range of IP addresses from which to accept requests. + * + * @param iPAddressOrRange the iPAddressOrRange value to set + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withIPAddressOrRange(String iPAddressOrRange) { + this.iPAddressOrRange = iPAddressOrRange; + return this; + } + + /** + * Get the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. + * + * @return the protocols value + */ + public HttpProtocol protocols() { + return this.protocols; + } + + /** + * Set the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. + * + * @param protocols the protocols value to set + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withProtocols(HttpProtocol protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the time at which the SAS becomes valid. + * + * @return the sharedAccessStartTime value + */ + public DateTime sharedAccessStartTime() { + return this.sharedAccessStartTime; + } + + /** + * Set the time at which the SAS becomes valid. + * + * @param sharedAccessStartTime the sharedAccessStartTime value to set + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withSharedAccessStartTime(DateTime sharedAccessStartTime) { + this.sharedAccessStartTime = sharedAccessStartTime; + return this; + } + + /** + * Get the time at which the shared access signature becomes invalid. + * + * @return the sharedAccessExpiryTime value + */ + public DateTime sharedAccessExpiryTime() { + return this.sharedAccessExpiryTime; + } + + /** + * Set the time at which the shared access signature becomes invalid. + * + * @param sharedAccessExpiryTime the sharedAccessExpiryTime value to set + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withSharedAccessExpiryTime(DateTime sharedAccessExpiryTime) { + this.sharedAccessExpiryTime = sharedAccessExpiryTime; + return this; + } + + /** + * Get the key to sign the account SAS token with. + * + * @return the keyToSign value + */ + public String keyToSign() { + return this.keyToSign; + } + + /** + * Set the key to sign the account SAS token with. + * + * @param keyToSign the keyToSign value to set + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withKeyToSign(String keyToSign) { + this.keyToSign = keyToSign; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/AccountStatus.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/AccountStatus.java new file mode 100644 index 000000000000..3572ded314a8 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/AccountStatus.java @@ -0,0 +1,53 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AccountStatus. + */ +public enum AccountStatus { + /** Enum value available. */ + AVAILABLE("available"), + + /** Enum value unavailable. */ + UNAVAILABLE("unavailable"); + + /** The actual serialized value for a AccountStatus instance. */ + private String value; + + AccountStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccountStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed AccountStatus object, or null if unable to parse. + */ + @JsonCreator + public static AccountStatus fromString(String value) { + AccountStatus[] items = AccountStatus.values(); + for (AccountStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Action.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Action.java new file mode 100644 index 000000000000..e1f90b5ce97c --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Action.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Action. + */ +public enum Action { + /** Enum value Allow. */ + ALLOW("Allow"); + + /** The actual serialized value for a Action instance. */ + private String value; + + Action(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Action instance. + * + * @param value the serialized value to parse. + * @return the parsed Action object, or null if unable to parse. + */ + @JsonCreator + public static Action fromString(String value) { + Action[] items = Action.values(); + for (Action item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/AzureEntityResource.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/AzureEntityResource.java new file mode 100644 index 000000000000..37b859de4a79 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/AzureEntityResource.java @@ -0,0 +1,34 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The resource model definition for a Azure Resource Manager resource with an + * etag. + */ +public class AzureEntityResource extends ProxyResource { + /** + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get resource Etag. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/AzureFilesIdentityBasedAuthentication.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/AzureFilesIdentityBasedAuthentication.java new file mode 100644 index 000000000000..8288488aa382 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/AzureFilesIdentityBasedAuthentication.java @@ -0,0 +1,44 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Settings for Azure Files identity based authentication. + */ +public class AzureFilesIdentityBasedAuthentication { + /** + * Indicates the directory service used. Possible values include: 'None', + * 'AADDS'. + */ + @JsonProperty(value = "directoryServiceOptions", required = true) + private DirectoryServiceOptions directoryServiceOptions; + + /** + * Get indicates the directory service used. Possible values include: 'None', 'AADDS'. + * + * @return the directoryServiceOptions value + */ + public DirectoryServiceOptions directoryServiceOptions() { + return this.directoryServiceOptions; + } + + /** + * Set indicates the directory service used. Possible values include: 'None', 'AADDS'. + * + * @param directoryServiceOptions the directoryServiceOptions value to set + * @return the AzureFilesIdentityBasedAuthentication object itself. + */ + public AzureFilesIdentityBasedAuthentication withDirectoryServiceOptions(DirectoryServiceOptions directoryServiceOptions) { + this.directoryServiceOptions = directoryServiceOptions; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainer.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainer.java new file mode 100644 index 000000000000..ab159c61a94a --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainer.java @@ -0,0 +1,192 @@ +/** + * 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.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.BlobContainerInner; +import com.microsoft.azure.arm.model.Indexable; +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.v2019_04_01.implementation.StorageManager; +import java.util.Map; +import org.joda.time.DateTime; + +/** + * Type representing BlobContainer. + */ +public interface BlobContainer extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the hasImmutabilityPolicy value. + */ + Boolean hasImmutabilityPolicy(); + + /** + * @return the hasLegalHold value. + */ + Boolean hasLegalHold(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the immutabilityPolicy value. + */ + ImmutabilityPolicyProperties immutabilityPolicy(); + + /** + * @return the lastModifiedTime value. + */ + DateTime lastModifiedTime(); + + /** + * @return the leaseDuration value. + */ + LeaseDuration leaseDuration(); + + /** + * @return the leaseState value. + */ + LeaseState leaseState(); + + /** + * @return the leaseStatus value. + */ + LeaseStatus leaseStatus(); + + /** + * @return the legalHold value. + */ + LegalHoldProperties legalHold(); + + /** + * @return the metadata value. + */ + Map metadata(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the publicAccess value. + */ + PublicAccess publicAccess(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the BlobContainer definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithBlobService, DefinitionStages.WithPublicAccess, DefinitionStages.WithMetadata, DefinitionStages.WithCreate { + } + + /** + * Grouping of BlobContainer definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a BlobContainer definition. + */ + interface Blank extends WithBlobService { + } + + /** + * The stage of the blobcontainer definition allowing to specify BlobService. + */ + interface WithBlobService { + /** + * Specifies resourceGroupName, accountName. + * @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 + * @return the next definition stage + */ + WithPublicAccess withExistingBlobService(String resourceGroupName, String accountName); + } + + /** + * The stage of the blobcontainer definition allowing to specify PublicAccess. + */ + interface WithPublicAccess { + /** + * Specifies publicAccess. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @return the next definition stage + */ + WithMetadata withPublicAccess(PublicAccess publicAccess); + } + + /** + * The stage of the blobcontainer definition allowing to specify Metadata. + */ + interface WithMetadata { + /** + * Specifies metadata. + * @param metadata A name-value pair to associate with the container as metadata + * @return the next definition stage + */ + WithCreate withMetadata(Map metadata); + } + + /** + * 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 BlobContainer update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithPublicAccess, UpdateStages.WithMetadata { + } + + /** + * Grouping of BlobContainer update stages. + */ + interface UpdateStages { + /** + * The stage of the blobcontainer update allowing to specify PublicAccess. + */ + interface WithPublicAccess { + /** + * Specifies publicAccess. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @return the next update stage + */ + Update withPublicAccess(PublicAccess publicAccess); + } + + /** + * The stage of the blobcontainer update allowing to specify Metadata. + */ + interface WithMetadata { + /** + * Specifies metadata. + * @param metadata A name-value pair to associate with the container as metadata + * @return the next update stage + */ + Update withMetadata(Map metadata); + } + + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainers.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainers.java new file mode 100644 index 000000000000..7c72f750f51c --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainers.java @@ -0,0 +1,148 @@ +/** + * 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.v2019_04_01; + +import rx.Completable; +import rx.Observable; +import java.util.List; + +/** + * Type representing BlobContainers. + */ +public interface BlobContainers { + /** + * Begins definition for a new Container resource. + * @param name resource name. + * @return the first stage of the new Container definition. + */ + BlobContainer.DefinitionStages.Blank defineContainer(String name); + + /** + * Begins definition for a new ImmutabilityPolicy resource. + * @param name resource name. + * @return the first stage of the new ImmutabilityPolicy definition. + */ + ImmutabilityPolicy.DefinitionStages.Blank defineImmutabilityPolicy(String name); + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @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 listAsync(final String resourceGroupName, final String accountName); + + /** + * Gets properties of a specified container. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String containerName); + + /** + * Deletes specified container under its 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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String containerName); + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable setLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags); + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable clearLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags); + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable leaseAsync(String resourceGroupName, String accountName, String containerName); + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName); + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the container after deleting all blobs inside the container. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch); + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable lockImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch); + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable extendImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch, int immutabilityPeriodSinceCreationInDays); + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java new file mode 100644 index 000000000000..33f340cbe971 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for CreateOrUpdateImmutabilityPolicy operation. + */ +public class BlobContainersCreateOrUpdateImmutabilityPolicyHeaders { + /** + * The ETag HTTP response header. This is an opaque string. You can use it + * to detect whether the resource has changed between requests. In + * particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @param eTag the eTag value to set + * @return the BlobContainersCreateOrUpdateImmutabilityPolicyHeaders object itself. + */ + public BlobContainersCreateOrUpdateImmutabilityPolicyHeaders withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainersDeleteImmutabilityPolicyHeaders.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainersDeleteImmutabilityPolicyHeaders.java new file mode 100644 index 000000000000..e27f6f7b835f --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainersDeleteImmutabilityPolicyHeaders.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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for DeleteImmutabilityPolicy operation. + */ +public class BlobContainersDeleteImmutabilityPolicyHeaders { + /** + * The ETag HTTP response header. This is an opaque string. You can use it + * to detect whether the resource has changed between requests. In + * particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @param eTag the eTag value to set + * @return the BlobContainersDeleteImmutabilityPolicyHeaders object itself. + */ + public BlobContainersDeleteImmutabilityPolicyHeaders withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainersExtendImmutabilityPolicyHeaders.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainersExtendImmutabilityPolicyHeaders.java new file mode 100644 index 000000000000..ab5c7cb751bd --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainersExtendImmutabilityPolicyHeaders.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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for ExtendImmutabilityPolicy operation. + */ +public class BlobContainersExtendImmutabilityPolicyHeaders { + /** + * The ETag HTTP response header. This is an opaque string. You can use it + * to detect whether the resource has changed between requests. In + * particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @param eTag the eTag value to set + * @return the BlobContainersExtendImmutabilityPolicyHeaders object itself. + */ + public BlobContainersExtendImmutabilityPolicyHeaders withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainersGetImmutabilityPolicyHeaders.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainersGetImmutabilityPolicyHeaders.java new file mode 100644 index 000000000000..7fe8867ca9b4 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainersGetImmutabilityPolicyHeaders.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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for GetImmutabilityPolicy operation. + */ +public class BlobContainersGetImmutabilityPolicyHeaders { + /** + * The ETag HTTP response header. This is an opaque string. You can use it + * to detect whether the resource has changed between requests. In + * particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @param eTag the eTag value to set + * @return the BlobContainersGetImmutabilityPolicyHeaders object itself. + */ + public BlobContainersGetImmutabilityPolicyHeaders withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainersLockImmutabilityPolicyHeaders.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainersLockImmutabilityPolicyHeaders.java new file mode 100644 index 000000000000..bf101ab06427 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobContainersLockImmutabilityPolicyHeaders.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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for LockImmutabilityPolicy operation. + */ +public class BlobContainersLockImmutabilityPolicyHeaders { + /** + * The ETag HTTP response header. This is an opaque string. You can use it + * to detect whether the resource has changed between requests. In + * particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @param eTag the eTag value to set + * @return the BlobContainersLockImmutabilityPolicyHeaders object itself. + */ + public BlobContainersLockImmutabilityPolicyHeaders withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobServiceProperties.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobServiceProperties.java new file mode 100644 index 000000000000..fc6ae024781a --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobServiceProperties.java @@ -0,0 +1,204 @@ +/** + * 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.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_04_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.v2019_04_01.implementation.StorageManager; + +/** + * Type representing BlobServiceProperties. + */ +public interface BlobServiceProperties extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the automaticSnapshotPolicyEnabled value. + */ + Boolean automaticSnapshotPolicyEnabled(); + + /** + * @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. + * @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 + * @return the next definition stage + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the blobserviceproperties definition allowing to specify AutomaticSnapshotPolicyEnabled. + */ + interface WithAutomaticSnapshotPolicyEnabled { + /** + * Specifies automaticSnapshotPolicyEnabled. + * @param automaticSnapshotPolicyEnabled Automatic Snapshot is enabled if set to true + * @return the next definition stage + */ + WithCreate withAutomaticSnapshotPolicyEnabled(Boolean automaticSnapshotPolicyEnabled); + } + + /** + * The stage of the blobserviceproperties definition allowing to specify Cors. + */ + interface WithCors { + /** + * Specifies cors. + * @param cors 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 next definition stage + */ + WithCreate withCors(CorsRules cors); + } + + /** + * The stage of the blobserviceproperties definition allowing to specify DefaultServiceVersion. + */ + interface WithDefaultServiceVersion { + /** + * Specifies defaultServiceVersion. + * @param defaultServiceVersion 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 next definition stage + */ + WithCreate withDefaultServiceVersion(String defaultServiceVersion); + } + + /** + * The stage of the blobserviceproperties definition allowing to specify DeleteRetentionPolicy. + */ + interface WithDeleteRetentionPolicy { + /** + * Specifies deleteRetentionPolicy. + * @param deleteRetentionPolicy The blob service properties for soft delete + * @return the next definition stage + */ + 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.WithAutomaticSnapshotPolicyEnabled, 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.WithAutomaticSnapshotPolicyEnabled, UpdateStages.WithCors, UpdateStages.WithDefaultServiceVersion, UpdateStages.WithDeleteRetentionPolicy { + } + + /** + * Grouping of BlobServiceProperties update stages. + */ + interface UpdateStages { + /** + * The stage of the blobserviceproperties update allowing to specify AutomaticSnapshotPolicyEnabled. + */ + interface WithAutomaticSnapshotPolicyEnabled { + /** + * Specifies automaticSnapshotPolicyEnabled. + * @param automaticSnapshotPolicyEnabled Automatic Snapshot is enabled if set to true + * @return the next update stage + */ + Update withAutomaticSnapshotPolicyEnabled(Boolean automaticSnapshotPolicyEnabled); + } + + /** + * The stage of the blobserviceproperties update allowing to specify Cors. + */ + interface WithCors { + /** + * Specifies cors. + * @param cors 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 next update stage + */ + Update withCors(CorsRules cors); + } + + /** + * The stage of the blobserviceproperties update allowing to specify DefaultServiceVersion. + */ + interface WithDefaultServiceVersion { + /** + * Specifies defaultServiceVersion. + * @param defaultServiceVersion 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 next update stage + */ + Update withDefaultServiceVersion(String defaultServiceVersion); + } + + /** + * The stage of the blobserviceproperties update allowing to specify DeleteRetentionPolicy. + */ + interface WithDeleteRetentionPolicy { + /** + * Specifies deleteRetentionPolicy. + * @param deleteRetentionPolicy The blob service properties for soft delete + * @return the next update stage + */ + Update withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy); + } + + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobServices.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/BlobServices.java new file mode 100644 index 000000000000..5dab5537401e --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_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.v2019_04_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_04_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/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Bypass.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Bypass.java new file mode 100644 index 000000000000..549109aa7575 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Bypass.java @@ -0,0 +1,47 @@ +/** + * 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.v2019_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Bypass. + */ +public final class Bypass extends ExpandableStringEnum { + /** Static value None for Bypass. */ + public static final Bypass NONE = fromString("None"); + + /** Static value Logging for Bypass. */ + public static final Bypass LOGGING = fromString("Logging"); + + /** Static value Metrics for Bypass. */ + public static final Bypass METRICS = fromString("Metrics"); + + /** Static value AzureServices for Bypass. */ + public static final Bypass AZURE_SERVICES = fromString("AzureServices"); + + /** + * Creates or finds a Bypass from its string representation. + * @param name a name to look for + * @return the corresponding Bypass + */ + @JsonCreator + public static Bypass fromString(String name) { + return fromString(name, Bypass.class); + } + + /** + * @return known Bypass values + */ + public static Collection values() { + return values(Bypass.class); + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/CheckNameAvailabilityResult.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/CheckNameAvailabilityResult.java new file mode 100644 index 000000000000..63f9418ab936 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/CheckNameAvailabilityResult.java @@ -0,0 +1,35 @@ +/** + * 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.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.CheckNameAvailabilityResultInner; + +/** + * Type representing CheckNameAvailabilityResult. + */ +public interface CheckNameAvailabilityResult extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + Reason reason(); + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/CorsRule.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/CorsRule.java new file mode 100644 index 000000000000..88cd2d331498 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_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.v2019_04_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/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/CorsRules.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/CorsRules.java new file mode 100644 index 000000000000..0ddaed2c8cee --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_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.v2019_04_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/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/CustomDomain.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/CustomDomain.java new file mode 100644 index 000000000000..ee4ecf78159c --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/CustomDomain.java @@ -0,0 +1,72 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The custom domain assigned to this storage account. This can be set via + * Update. + */ +public class CustomDomain { + /** + * Gets or sets the custom domain name assigned to the storage account. + * Name is the CNAME source. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Indicates whether indirect CName validation is enabled. Default value is + * false. This should only be set on updates. + */ + @JsonProperty(value = "useSubDomainName") + private Boolean useSubDomainName; + + /** + * Get gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + * + * @param name the name value to set + * @return the CustomDomain object itself. + */ + public CustomDomain withName(String name) { + this.name = name; + return this; + } + + /** + * Get indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + * + * @return the useSubDomainName value + */ + public Boolean useSubDomainName() { + return this.useSubDomainName; + } + + /** + * Set indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + * + * @param useSubDomainName the useSubDomainName value to set + * @return the CustomDomain object itself. + */ + public CustomDomain withUseSubDomainName(Boolean useSubDomainName) { + this.useSubDomainName = useSubDomainName; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/DateAfterCreation.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/DateAfterCreation.java new file mode 100644 index 000000000000..9137170d3a3b --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/DateAfterCreation.java @@ -0,0 +1,43 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Object to define the number of days after creation. + */ +public class DateAfterCreation { + /** + * Value indicating the age in days after creation. + */ + @JsonProperty(value = "daysAfterCreationGreaterThan", required = true) + private double daysAfterCreationGreaterThan; + + /** + * Get value indicating the age in days after creation. + * + * @return the daysAfterCreationGreaterThan value + */ + public double daysAfterCreationGreaterThan() { + return this.daysAfterCreationGreaterThan; + } + + /** + * Set value indicating the age in days after creation. + * + * @param daysAfterCreationGreaterThan the daysAfterCreationGreaterThan value to set + * @return the DateAfterCreation object itself. + */ + public DateAfterCreation withDaysAfterCreationGreaterThan(double daysAfterCreationGreaterThan) { + this.daysAfterCreationGreaterThan = daysAfterCreationGreaterThan; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/DateAfterModification.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/DateAfterModification.java new file mode 100644 index 000000000000..a5e22b744d77 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/DateAfterModification.java @@ -0,0 +1,43 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Object to define the number of days after last modification. + */ +public class DateAfterModification { + /** + * Value indicating the age in days after last modification. + */ + @JsonProperty(value = "daysAfterModificationGreaterThan", required = true) + private double daysAfterModificationGreaterThan; + + /** + * Get value indicating the age in days after last modification. + * + * @return the daysAfterModificationGreaterThan value + */ + public double daysAfterModificationGreaterThan() { + return this.daysAfterModificationGreaterThan; + } + + /** + * Set value indicating the age in days after last modification. + * + * @param daysAfterModificationGreaterThan the daysAfterModificationGreaterThan value to set + * @return the DateAfterModification object itself. + */ + public DateAfterModification withDaysAfterModificationGreaterThan(double daysAfterModificationGreaterThan) { + this.daysAfterModificationGreaterThan = daysAfterModificationGreaterThan; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/DefaultAction.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/DefaultAction.java new file mode 100644 index 000000000000..5f52d855d198 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/DefaultAction.java @@ -0,0 +1,53 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DefaultAction. + */ +public enum DefaultAction { + /** Enum value Allow. */ + ALLOW("Allow"), + + /** Enum value Deny. */ + DENY("Deny"); + + /** The actual serialized value for a DefaultAction instance. */ + private String value; + + DefaultAction(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DefaultAction instance. + * + * @param value the serialized value to parse. + * @return the parsed DefaultAction object, or null if unable to parse. + */ + @JsonCreator + public static DefaultAction fromString(String value) { + DefaultAction[] items = DefaultAction.values(); + for (DefaultAction item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/DeleteRetentionPolicy.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/DeleteRetentionPolicy.java new file mode 100644 index 000000000000..9c42d9b71c0d --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_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.v2019_04_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/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Dimension.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Dimension.java new file mode 100644 index 000000000000..914aced5d33e --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Dimension.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Dimension of blobs, possibly be blob type or access tier. + */ +public class Dimension { + /** + * Display name of dimension. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display name of dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get display name of dimension. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set display name of dimension. + * + * @param name the name value to set + * @return the Dimension object itself. + */ + public Dimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get display name of dimension. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set display name of dimension. + * + * @param displayName the displayName value to set + * @return the Dimension object itself. + */ + public Dimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/DirectoryServiceOptions.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/DirectoryServiceOptions.java new file mode 100644 index 000000000000..9edcdeb415bf --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/DirectoryServiceOptions.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.v2019_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DirectoryServiceOptions. + */ +public final class DirectoryServiceOptions extends ExpandableStringEnum { + /** Static value None for DirectoryServiceOptions. */ + public static final DirectoryServiceOptions NONE = fromString("None"); + + /** Static value AADDS for DirectoryServiceOptions. */ + public static final DirectoryServiceOptions AADDS = fromString("AADDS"); + + /** + * Creates or finds a DirectoryServiceOptions from its string representation. + * @param name a name to look for + * @return the corresponding DirectoryServiceOptions + */ + @JsonCreator + public static DirectoryServiceOptions fromString(String name) { + return fromString(name, DirectoryServiceOptions.class); + } + + /** + * @return known DirectoryServiceOptions values + */ + public static Collection values() { + return values(DirectoryServiceOptions.class); + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Encryption.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Encryption.java new file mode 100644 index 000000000000..fa71e2ee00ad --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Encryption.java @@ -0,0 +1,97 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The encryption settings on the storage account. + */ +public class Encryption { + /** + * List of services which support encryption. + */ + @JsonProperty(value = "services") + private EncryptionServices services; + + /** + * The encryption keySource (provider). Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.Keyvault. Possible values include: + * 'Microsoft.Storage', 'Microsoft.Keyvault'. + */ + @JsonProperty(value = "keySource", required = true) + private KeySource keySource; + + /** + * Properties provided by key vault. + */ + @JsonProperty(value = "keyvaultproperties") + private KeyVaultProperties keyVaultProperties; + + /** + * Get list of services which support encryption. + * + * @return the services value + */ + public EncryptionServices services() { + return this.services; + } + + /** + * Set list of services which support encryption. + * + * @param services the services value to set + * @return the Encryption object itself. + */ + public Encryption withServices(EncryptionServices services) { + this.services = services; + return this; + } + + /** + * Get the encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + * + * @return the keySource value + */ + public KeySource keySource() { + return this.keySource; + } + + /** + * Set the encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + * + * @param keySource the keySource value to set + * @return the Encryption object itself. + */ + public Encryption withKeySource(KeySource keySource) { + this.keySource = keySource; + return this; + } + + /** + * Get properties provided by key vault. + * + * @return the keyVaultProperties value + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set properties provided by key vault. + * + * @param keyVaultProperties the keyVaultProperties value to set + * @return the Encryption object itself. + */ + public Encryption withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/EncryptionService.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/EncryptionService.java new file mode 100644 index 000000000000..ce02274b952e --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/EncryptionService.java @@ -0,0 +1,63 @@ +/** + * 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.v2019_04_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A service that allows server-side encryption to be used. + */ +public class EncryptionService { + /** + * A boolean indicating whether or not the service encrypts the data as it + * is stored. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Gets a rough estimate of the date/time when the encryption was last + * enabled by the user. Only returned when encryption is enabled. There + * might be some unencrypted blobs which were written after this time, as + * it is just a rough estimate. + */ + @JsonProperty(value = "lastEnabledTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastEnabledTime; + + /** + * Get a boolean indicating whether or not the service encrypts the data as it is stored. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set a boolean indicating whether or not the service encrypts the data as it is stored. + * + * @param enabled the enabled value to set + * @return the EncryptionService object itself. + */ + public EncryptionService withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get gets a rough estimate of the date/time when the encryption was last enabled by the user. Only returned when encryption is enabled. There might be some unencrypted blobs which were written after this time, as it is just a rough estimate. + * + * @return the lastEnabledTime value + */ + public DateTime lastEnabledTime() { + return this.lastEnabledTime; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/EncryptionServices.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/EncryptionServices.java new file mode 100644 index 000000000000..0e3e0c49218b --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/EncryptionServices.java @@ -0,0 +1,99 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A list of services that support encryption. + */ +public class EncryptionServices { + /** + * The encryption function of the blob storage service. + */ + @JsonProperty(value = "blob") + private EncryptionService blob; + + /** + * The encryption function of the file storage service. + */ + @JsonProperty(value = "file") + private EncryptionService file; + + /** + * The encryption function of the table storage service. + */ + @JsonProperty(value = "table", access = JsonProperty.Access.WRITE_ONLY) + private EncryptionService table; + + /** + * The encryption function of the queue storage service. + */ + @JsonProperty(value = "queue", access = JsonProperty.Access.WRITE_ONLY) + private EncryptionService queue; + + /** + * Get the encryption function of the blob storage service. + * + * @return the blob value + */ + public EncryptionService blob() { + return this.blob; + } + + /** + * Set the encryption function of the blob storage service. + * + * @param blob the blob value to set + * @return the EncryptionServices object itself. + */ + public EncryptionServices withBlob(EncryptionService blob) { + this.blob = blob; + return this; + } + + /** + * Get the encryption function of the file storage service. + * + * @return the file value + */ + public EncryptionService file() { + return this.file; + } + + /** + * Set the encryption function of the file storage service. + * + * @param file the file value to set + * @return the EncryptionServices object itself. + */ + public EncryptionServices withFile(EncryptionService file) { + this.file = file; + return this; + } + + /** + * Get the encryption function of the table storage service. + * + * @return the table value + */ + public EncryptionService table() { + return this.table; + } + + /** + * Get the encryption function of the queue storage service. + * + * @return the queue value + */ + public EncryptionService queue() { + return this.queue; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Endpoints.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Endpoints.java new file mode 100644 index 000000000000..2421a6344197 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Endpoints.java @@ -0,0 +1,108 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The URIs that are used to perform a retrieval of a public blob, queue, + * table, web or dfs object. + */ +public class Endpoints { + /** + * Gets the blob endpoint. + */ + @JsonProperty(value = "blob", access = JsonProperty.Access.WRITE_ONLY) + private String blob; + + /** + * Gets the queue endpoint. + */ + @JsonProperty(value = "queue", access = JsonProperty.Access.WRITE_ONLY) + private String queue; + + /** + * Gets the table endpoint. + */ + @JsonProperty(value = "table", access = JsonProperty.Access.WRITE_ONLY) + private String table; + + /** + * Gets the file endpoint. + */ + @JsonProperty(value = "file", access = JsonProperty.Access.WRITE_ONLY) + private String file; + + /** + * Gets the web endpoint. + */ + @JsonProperty(value = "web", access = JsonProperty.Access.WRITE_ONLY) + private String web; + + /** + * Gets the dfs endpoint. + */ + @JsonProperty(value = "dfs", access = JsonProperty.Access.WRITE_ONLY) + private String dfs; + + /** + * Get gets the blob endpoint. + * + * @return the blob value + */ + public String blob() { + return this.blob; + } + + /** + * Get gets the queue endpoint. + * + * @return the queue value + */ + public String queue() { + return this.queue; + } + + /** + * Get gets the table endpoint. + * + * @return the table value + */ + public String table() { + return this.table; + } + + /** + * Get gets the file endpoint. + * + * @return the file value + */ + public String file() { + return this.file; + } + + /** + * Get gets the web endpoint. + * + * @return the web value + */ + public String web() { + return this.web; + } + + /** + * Get gets the dfs endpoint. + * + * @return the dfs value + */ + public String dfs() { + return this.dfs; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/GeoReplicationStats.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/GeoReplicationStats.java new file mode 100644 index 000000000000..0ee40435fa0d --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/GeoReplicationStats.java @@ -0,0 +1,76 @@ +/** + * 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.v2019_04_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Statistics related to replication for storage account's Blob, Table, Queue + * and File services. It is only available when geo-redundant replication is + * enabled for the storage account. + */ +public class GeoReplicationStats { + /** + * The status of the secondary location. Possible values are: - Live: + * Indicates that the secondary location is active and operational. - + * Bootstrap: Indicates initial synchronization from the primary location + * to the secondary location is in progress.This typically occurs when + * replication is first enabled. - Unavailable: Indicates that the + * secondary location is temporarily unavailable. Possible values include: + * 'Live', 'Bootstrap', 'Unavailable'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private GeoReplicationStatus status; + + /** + * All primary writes preceding this UTC date/time value are guaranteed to + * be available for read operations. Primary writes following this point in + * time may or may not be available for reads. Element may be default value + * if value of LastSyncTime is not available, this can happen if secondary + * is offline or we are in bootstrap. + */ + @JsonProperty(value = "lastSyncTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastSyncTime; + + /** + * A boolean flag which indicates whether or not account failover is + * supported for the account. + */ + @JsonProperty(value = "canFailover", access = JsonProperty.Access.WRITE_ONLY) + private Boolean canFailover; + + /** + * Get the status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location is temporarily unavailable. Possible values include: 'Live', 'Bootstrap', 'Unavailable'. + * + * @return the status value + */ + public GeoReplicationStatus status() { + return this.status; + } + + /** + * Get all primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary writes following this point in time may or may not be available for reads. Element may be default value if value of LastSyncTime is not available, this can happen if secondary is offline or we are in bootstrap. + * + * @return the lastSyncTime value + */ + public DateTime lastSyncTime() { + return this.lastSyncTime; + } + + /** + * Get a boolean flag which indicates whether or not account failover is supported for the account. + * + * @return the canFailover value + */ + public Boolean canFailover() { + return this.canFailover; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/GeoReplicationStatus.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/GeoReplicationStatus.java new file mode 100644 index 000000000000..743665a4297c --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/GeoReplicationStatus.java @@ -0,0 +1,44 @@ +/** + * 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.v2019_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for GeoReplicationStatus. + */ +public final class GeoReplicationStatus extends ExpandableStringEnum { + /** Static value Live for GeoReplicationStatus. */ + public static final GeoReplicationStatus LIVE = fromString("Live"); + + /** Static value Bootstrap for GeoReplicationStatus. */ + public static final GeoReplicationStatus BOOTSTRAP = fromString("Bootstrap"); + + /** Static value Unavailable for GeoReplicationStatus. */ + public static final GeoReplicationStatus UNAVAILABLE = fromString("Unavailable"); + + /** + * Creates or finds a GeoReplicationStatus from its string representation. + * @param name a name to look for + * @return the corresponding GeoReplicationStatus + */ + @JsonCreator + public static GeoReplicationStatus fromString(String name) { + return fromString(name, GeoReplicationStatus.class); + } + + /** + * @return known GeoReplicationStatus values + */ + public static Collection values() { + return values(GeoReplicationStatus.class); + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/HttpProtocol.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/HttpProtocol.java new file mode 100644 index 000000000000..6ba8de2b8e4b --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/HttpProtocol.java @@ -0,0 +1,53 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for HttpProtocol. + */ +public enum HttpProtocol { + /** Enum value https,http. */ + HTTPSHTTP("https,http"), + + /** Enum value https. */ + HTTPS("https"); + + /** The actual serialized value for a HttpProtocol instance. */ + private String value; + + HttpProtocol(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a HttpProtocol instance. + * + * @param value the serialized value to parse. + * @return the parsed HttpProtocol object, or null if unable to parse. + */ + @JsonCreator + public static HttpProtocol fromString(String value) { + HttpProtocol[] items = HttpProtocol.values(); + for (HttpProtocol item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/IPRule.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/IPRule.java new file mode 100644 index 000000000000..283e70474698 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/IPRule.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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IP rule with specific IP or IP range in CIDR format. + */ +public class IPRule { + /** + * Specifies the IP or IP range in CIDR format. Only IPV4 address is + * allowed. + */ + @JsonProperty(value = "value", required = true) + private String iPAddressOrRange; + + /** + * The action of IP ACL rule. Possible values include: 'Allow'. + */ + @JsonProperty(value = "action") + private Action action; + + /** + * Get specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + * + * @return the iPAddressOrRange value + */ + public String iPAddressOrRange() { + return this.iPAddressOrRange; + } + + /** + * Set specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + * + * @param iPAddressOrRange the iPAddressOrRange value to set + * @return the IPRule object itself. + */ + public IPRule withIPAddressOrRange(String iPAddressOrRange) { + this.iPAddressOrRange = iPAddressOrRange; + return this; + } + + /** + * Get the action of IP ACL rule. Possible values include: 'Allow'. + * + * @return the action value + */ + public Action action() { + return this.action; + } + + /** + * Set the action of IP ACL rule. Possible values include: 'Allow'. + * + * @param action the action value to set + * @return the IPRule object itself. + */ + public IPRule withAction(Action action) { + this.action = action; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Identity.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Identity.java new file mode 100644 index 000000000000..13e1d0fede3b --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Identity.java @@ -0,0 +1,80 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Identity for the resource. + */ +public class Identity { + /** + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * The identity type. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of Identity class. + */ + public Identity() { + type = "SystemAssigned"; + } + + /** + * Get the principal ID of resource identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant ID of resource. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the identity type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the identity type. + * + * @param type the type value to set + * @return the Identity object itself. + */ + public Identity withType(String type) { + this.type = type; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ImmutabilityPolicy.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ImmutabilityPolicy.java new file mode 100644 index 000000000000..34b9c0b855d2 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ImmutabilityPolicy.java @@ -0,0 +1,152 @@ +/** + * 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.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.ImmutabilityPolicyInner; +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.v2019_04_01.implementation.StorageManager; + +/** + * Type representing ImmutabilityPolicy. + */ +public interface ImmutabilityPolicy extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the immutabilityPeriodSinceCreationInDays value. + */ + int immutabilityPeriodSinceCreationInDays(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the state value. + */ + ImmutabilityPolicyState state(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ImmutabilityPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithContainer, DefinitionStages.WithIfMatch, DefinitionStages.WithImmutabilityPeriodSinceCreationInDays, DefinitionStages.WithCreate { + } + + /** + * Grouping of ImmutabilityPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ImmutabilityPolicy definition. + */ + interface Blank extends WithContainer { + } + + /** + * The stage of the immutabilitypolicy definition allowing to specify Container. + */ + interface WithContainer { + /** + * Specifies resourceGroupName, accountName, containerName. + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number + * @return the next definition stage + */ + WithIfMatch withExistingContainer(String resourceGroupName, String accountName, String containerName); + } + + /** + * The stage of the immutabilitypolicy definition allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied + * @return the next definition stage + */ + WithImmutabilityPeriodSinceCreationInDays withIfMatch(String ifMatch); + } + + /** + * The stage of the immutabilitypolicy definition allowing to specify ImmutabilityPeriodSinceCreationInDays. + */ + interface WithImmutabilityPeriodSinceCreationInDays { + /** + * Specifies immutabilityPeriodSinceCreationInDays. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days + * @return the next definition stage + */ + WithCreate withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays); + } + + /** + * 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 ImmutabilityPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithIfMatch, UpdateStages.WithImmutabilityPeriodSinceCreationInDays { + } + + /** + * Grouping of ImmutabilityPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the immutabilitypolicy update allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied + * @return the next update stage + */ + Update withIfMatch(String ifMatch); + } + + /** + * The stage of the immutabilitypolicy update allowing to specify ImmutabilityPeriodSinceCreationInDays. + */ + interface WithImmutabilityPeriodSinceCreationInDays { + /** + * Specifies immutabilityPeriodSinceCreationInDays. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days + * @return the next update stage + */ + Update withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays); + } + + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ImmutabilityPolicyProperties.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ImmutabilityPolicyProperties.java new file mode 100644 index 000000000000..e280dcf5f486 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ImmutabilityPolicyProperties.java @@ -0,0 +1,94 @@ +/** + * 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.v2019_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The properties of an ImmutabilityPolicy of a blob container. + */ +@JsonFlatten +public class ImmutabilityPolicyProperties { + /** + * The immutability period for the blobs in the container since the policy + * creation, in days. + */ + @JsonProperty(value = "properties.immutabilityPeriodSinceCreationInDays", required = true) + private int immutabilityPeriodSinceCreationInDays; + + /** + * The ImmutabilityPolicy state of a blob container, possible values + * include: Locked and Unlocked. Possible values include: 'Locked', + * 'Unlocked'. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private ImmutabilityPolicyState state; + + /** + * ImmutabilityPolicy Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * The ImmutabilityPolicy update history of the blob container. + */ + @JsonProperty(value = "updateHistory", access = JsonProperty.Access.WRITE_ONLY) + private List updateHistory; + + /** + * Get the immutability period for the blobs in the container since the policy creation, in days. + * + * @return the immutabilityPeriodSinceCreationInDays value + */ + public int immutabilityPeriodSinceCreationInDays() { + return this.immutabilityPeriodSinceCreationInDays; + } + + /** + * Set the immutability period for the blobs in the container since the policy creation, in days. + * + * @param immutabilityPeriodSinceCreationInDays the immutabilityPeriodSinceCreationInDays value to set + * @return the ImmutabilityPolicyProperties object itself. + */ + public ImmutabilityPolicyProperties withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays) { + this.immutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays; + return this; + } + + /** + * Get the ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. Possible values include: 'Locked', 'Unlocked'. + * + * @return the state value + */ + public ImmutabilityPolicyState state() { + return this.state; + } + + /** + * Get immutabilityPolicy Etag. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get the ImmutabilityPolicy update history of the blob container. + * + * @return the updateHistory value + */ + public List updateHistory() { + return this.updateHistory; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ImmutabilityPolicyState.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ImmutabilityPolicyState.java new file mode 100644 index 000000000000..94aeefbb5924 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ImmutabilityPolicyState.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.v2019_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ImmutabilityPolicyState. + */ +public final class ImmutabilityPolicyState extends ExpandableStringEnum { + /** Static value Locked for ImmutabilityPolicyState. */ + public static final ImmutabilityPolicyState LOCKED = fromString("Locked"); + + /** Static value Unlocked for ImmutabilityPolicyState. */ + public static final ImmutabilityPolicyState UNLOCKED = fromString("Unlocked"); + + /** + * Creates or finds a ImmutabilityPolicyState from its string representation. + * @param name a name to look for + * @return the corresponding ImmutabilityPolicyState + */ + @JsonCreator + public static ImmutabilityPolicyState fromString(String name) { + return fromString(name, ImmutabilityPolicyState.class); + } + + /** + * @return known ImmutabilityPolicyState values + */ + public static Collection values() { + return values(ImmutabilityPolicyState.class); + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ImmutabilityPolicyUpdateType.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ImmutabilityPolicyUpdateType.java new file mode 100644 index 000000000000..85672f6526a0 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ImmutabilityPolicyUpdateType.java @@ -0,0 +1,44 @@ +/** + * 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.v2019_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ImmutabilityPolicyUpdateType. + */ +public final class ImmutabilityPolicyUpdateType extends ExpandableStringEnum { + /** Static value put for ImmutabilityPolicyUpdateType. */ + public static final ImmutabilityPolicyUpdateType PUT = fromString("put"); + + /** Static value lock for ImmutabilityPolicyUpdateType. */ + public static final ImmutabilityPolicyUpdateType LOCK = fromString("lock"); + + /** Static value extend for ImmutabilityPolicyUpdateType. */ + public static final ImmutabilityPolicyUpdateType EXTEND = fromString("extend"); + + /** + * Creates or finds a ImmutabilityPolicyUpdateType from its string representation. + * @param name a name to look for + * @return the corresponding ImmutabilityPolicyUpdateType + */ + @JsonCreator + public static ImmutabilityPolicyUpdateType fromString(String name) { + return fromString(name, ImmutabilityPolicyUpdateType.class); + } + + /** + * @return known ImmutabilityPolicyUpdateType values + */ + public static Collection values() { + return values(ImmutabilityPolicyUpdateType.class); + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/KeyPermission.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/KeyPermission.java new file mode 100644 index 000000000000..f08bf76a01f3 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/KeyPermission.java @@ -0,0 +1,53 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for KeyPermission. + */ +public enum KeyPermission { + /** Enum value Read. */ + READ("Read"), + + /** Enum value Full. */ + FULL("Full"); + + /** The actual serialized value for a KeyPermission instance. */ + private String value; + + KeyPermission(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a KeyPermission instance. + * + * @param value the serialized value to parse. + * @return the parsed KeyPermission object, or null if unable to parse. + */ + @JsonCreator + public static KeyPermission fromString(String value) { + KeyPermission[] items = KeyPermission.values(); + for (KeyPermission item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/KeySource.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/KeySource.java new file mode 100644 index 000000000000..b696c700cbd2 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/KeySource.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.v2019_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for KeySource. + */ +public final class KeySource extends ExpandableStringEnum { + /** Static value Microsoft.Storage for KeySource. */ + public static final KeySource MICROSOFT_STORAGE = fromString("Microsoft.Storage"); + + /** Static value Microsoft.Keyvault for KeySource. */ + public static final KeySource MICROSOFT_KEYVAULT = fromString("Microsoft.Keyvault"); + + /** + * Creates or finds a KeySource from its string representation. + * @param name a name to look for + * @return the corresponding KeySource + */ + @JsonCreator + public static KeySource fromString(String name) { + return fromString(name, KeySource.class); + } + + /** + * @return known KeySource values + */ + public static Collection values() { + return values(KeySource.class); + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/KeyVaultProperties.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/KeyVaultProperties.java new file mode 100644 index 000000000000..3a3ef3fd5f66 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/KeyVaultProperties.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of key vault. + */ +public class KeyVaultProperties { + /** + * The name of KeyVault key. + */ + @JsonProperty(value = "keyname") + private String keyName; + + /** + * The version of KeyVault key. + */ + @JsonProperty(value = "keyversion") + private String keyVersion; + + /** + * The Uri of KeyVault. + */ + @JsonProperty(value = "keyvaulturi") + private String keyVaultUri; + + /** + * Get the name of KeyVault key. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the name of KeyVault key. + * + * @param keyName the keyName value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the version of KeyVault key. + * + * @return the keyVersion value + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the version of KeyVault key. + * + * @param keyVersion the keyVersion value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Get the Uri of KeyVault. + * + * @return the keyVaultUri value + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the Uri of KeyVault. + * + * @param keyVaultUri the keyVaultUri value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Kind.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Kind.java new file mode 100644 index 000000000000..b0d31ccaba49 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Kind.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Kind. + */ +public final class Kind extends ExpandableStringEnum { + /** Static value Storage for Kind. */ + public static final Kind STORAGE = fromString("Storage"); + + /** Static value StorageV2 for Kind. */ + public static final Kind STORAGE_V2 = fromString("StorageV2"); + + /** Static value BlobStorage for Kind. */ + public static final Kind BLOB_STORAGE = fromString("BlobStorage"); + + /** Static value FileStorage for Kind. */ + public static final Kind FILE_STORAGE = fromString("FileStorage"); + + /** Static value BlockBlobStorage for Kind. */ + public static final Kind BLOCK_BLOB_STORAGE = fromString("BlockBlobStorage"); + + /** + * Creates or finds a Kind from its string representation. + * @param name a name to look for + * @return the corresponding Kind + */ + @JsonCreator + public static Kind fromString(String name) { + return fromString(name, Kind.class); + } + + /** + * @return known Kind values + */ + public static Collection values() { + return values(Kind.class); + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LeaseContainerRequest.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LeaseContainerRequest.java new file mode 100644 index 000000000000..846d84929b3d --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LeaseContainerRequest.java @@ -0,0 +1,152 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Lease Container request schema. + */ +public class LeaseContainerRequest { + /** + * Specifies the lease action. Can be one of the available actions. + * Possible values include: 'Acquire', 'Renew', 'Change', 'Release', + * 'Break'. + */ + @JsonProperty(value = "action", required = true) + private String action; + + /** + * Identifies the lease. Can be specified in any valid GUID string format. + */ + @JsonProperty(value = "leaseId") + private String leaseId; + + /** + * Optional. For a break action, proposed duration the lease should + * continue before it is broken, in seconds, between 0 and 60. + */ + @JsonProperty(value = "breakPeriod") + private Integer breakPeriod; + + /** + * Required for acquire. Specifies the duration of the lease, in seconds, + * or negative one (-1) for a lease that never expires. + */ + @JsonProperty(value = "leaseDuration") + private Integer leaseDuration; + + /** + * Optional for acquire, required for change. Proposed lease ID, in a GUID + * string format. + */ + @JsonProperty(value = "proposedLeaseId") + private String proposedLeaseId; + + /** + * Get specifies the lease action. Can be one of the available actions. Possible values include: 'Acquire', 'Renew', 'Change', 'Release', 'Break'. + * + * @return the action value + */ + public String action() { + return this.action; + } + + /** + * Set specifies the lease action. Can be one of the available actions. Possible values include: 'Acquire', 'Renew', 'Change', 'Release', 'Break'. + * + * @param action the action value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withAction(String action) { + this.action = action; + return this; + } + + /** + * Get identifies the lease. Can be specified in any valid GUID string format. + * + * @return the leaseId value + */ + public String leaseId() { + return this.leaseId; + } + + /** + * Set identifies the lease. Can be specified in any valid GUID string format. + * + * @param leaseId the leaseId value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withLeaseId(String leaseId) { + this.leaseId = leaseId; + return this; + } + + /** + * Get optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + * + * @return the breakPeriod value + */ + public Integer breakPeriod() { + return this.breakPeriod; + } + + /** + * Set optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + * + * @param breakPeriod the breakPeriod value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withBreakPeriod(Integer breakPeriod) { + this.breakPeriod = breakPeriod; + return this; + } + + /** + * Get required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + * + * @return the leaseDuration value + */ + public Integer leaseDuration() { + return this.leaseDuration; + } + + /** + * Set required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + * + * @param leaseDuration the leaseDuration value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withLeaseDuration(Integer leaseDuration) { + this.leaseDuration = leaseDuration; + return this; + } + + /** + * Get optional for acquire, required for change. Proposed lease ID, in a GUID string format. + * + * @return the proposedLeaseId value + */ + public String proposedLeaseId() { + return this.proposedLeaseId; + } + + /** + * Set optional for acquire, required for change. Proposed lease ID, in a GUID string format. + * + * @param proposedLeaseId the proposedLeaseId value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withProposedLeaseId(String proposedLeaseId) { + this.proposedLeaseId = proposedLeaseId; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LeaseContainerResponse.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LeaseContainerResponse.java new file mode 100644 index 000000000000..8b53e31da835 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LeaseContainerResponse.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.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.LeaseContainerResponseInner; + +/** + * Type representing LeaseContainerResponse. + */ +public interface LeaseContainerResponse extends HasInner, HasManager { + /** + * @return the leaseId value. + */ + String leaseId(); + + /** + * @return the leaseTimeSeconds value. + */ + String leaseTimeSeconds(); + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LeaseDuration.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LeaseDuration.java new file mode 100644 index 000000000000..326df3ec8633 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LeaseDuration.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.v2019_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LeaseDuration. + */ +public final class LeaseDuration extends ExpandableStringEnum { + /** Static value Infinite for LeaseDuration. */ + public static final LeaseDuration INFINITE = fromString("Infinite"); + + /** Static value Fixed for LeaseDuration. */ + public static final LeaseDuration FIXED = fromString("Fixed"); + + /** + * Creates or finds a LeaseDuration from its string representation. + * @param name a name to look for + * @return the corresponding LeaseDuration + */ + @JsonCreator + public static LeaseDuration fromString(String name) { + return fromString(name, LeaseDuration.class); + } + + /** + * @return known LeaseDuration values + */ + public static Collection values() { + return values(LeaseDuration.class); + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LeaseState.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LeaseState.java new file mode 100644 index 000000000000..9988dc39aef4 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LeaseState.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LeaseState. + */ +public final class LeaseState extends ExpandableStringEnum { + /** Static value Available for LeaseState. */ + public static final LeaseState AVAILABLE = fromString("Available"); + + /** Static value Leased for LeaseState. */ + public static final LeaseState LEASED = fromString("Leased"); + + /** Static value Expired for LeaseState. */ + public static final LeaseState EXPIRED = fromString("Expired"); + + /** Static value Breaking for LeaseState. */ + public static final LeaseState BREAKING = fromString("Breaking"); + + /** Static value Broken for LeaseState. */ + public static final LeaseState BROKEN = fromString("Broken"); + + /** + * Creates or finds a LeaseState from its string representation. + * @param name a name to look for + * @return the corresponding LeaseState + */ + @JsonCreator + public static LeaseState fromString(String name) { + return fromString(name, LeaseState.class); + } + + /** + * @return known LeaseState values + */ + public static Collection values() { + return values(LeaseState.class); + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LeaseStatus.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LeaseStatus.java new file mode 100644 index 000000000000..582f4b5aec7d --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LeaseStatus.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.v2019_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LeaseStatus. + */ +public final class LeaseStatus extends ExpandableStringEnum { + /** Static value Locked for LeaseStatus. */ + public static final LeaseStatus LOCKED = fromString("Locked"); + + /** Static value Unlocked for LeaseStatus. */ + public static final LeaseStatus UNLOCKED = fromString("Unlocked"); + + /** + * Creates or finds a LeaseStatus from its string representation. + * @param name a name to look for + * @return the corresponding LeaseStatus + */ + @JsonCreator + public static LeaseStatus fromString(String name) { + return fromString(name, LeaseStatus.class); + } + + /** + * @return known LeaseStatus values + */ + public static Collection values() { + return values(LeaseStatus.class); + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LegalHold.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LegalHold.java new file mode 100644 index 000000000000..fbfed281c300 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LegalHold.java @@ -0,0 +1,31 @@ +/** + * 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.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.LegalHoldInner; +import java.util.List; + +/** + * Type representing LegalHold. + */ +public interface LegalHold extends HasInner, HasManager { + /** + * @return the hasLegalHold value. + */ + Boolean hasLegalHold(); + + /** + * @return the tags value. + */ + List tags(); + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LegalHoldProperties.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LegalHoldProperties.java new file mode 100644 index 000000000000..48fb29bb46a3 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/LegalHoldProperties.java @@ -0,0 +1,63 @@ +/** + * 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.v2019_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The LegalHold property of a blob container. + */ +public class LegalHoldProperties { + /** + * The hasLegalHold public property is set to true by SRP if there are at + * least one existing tag. The hasLegalHold public property is set to false + * by SRP if all existing legal hold tags are cleared out. There can be a + * maximum of 1000 blob containers with hasLegalHold=true for a given + * account. + */ + @JsonProperty(value = "hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasLegalHold; + + /** + * The list of LegalHold tags of a blob container. + */ + @JsonProperty(value = "tags") + private List tags; + + /** + * Get the hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. + * + * @return the hasLegalHold value + */ + public Boolean hasLegalHold() { + return this.hasLegalHold; + } + + /** + * Get the list of LegalHold tags of a blob container. + * + * @return the tags value + */ + public List tags() { + return this.tags; + } + + /** + * Set the list of LegalHold tags of a blob container. + * + * @param tags the tags value to set + * @return the LegalHoldProperties object itself. + */ + public LegalHoldProperties withTags(List tags) { + this.tags = tags; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ListAccountSasResponse.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ListAccountSasResponse.java new file mode 100644 index 000000000000..8e9fa0a7f32d --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ListAccountSasResponse.java @@ -0,0 +1,25 @@ +/** + * 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.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.ListAccountSasResponseInner; + +/** + * Type representing ListAccountSasResponse. + */ +public interface ListAccountSasResponse extends HasInner, HasManager { + /** + * @return the accountSasToken value. + */ + String accountSasToken(); + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ListContainerItem.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ListContainerItem.java new file mode 100644 index 000000000000..379337c546e3 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ListContainerItem.java @@ -0,0 +1,92 @@ +/** + * 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.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.ListContainerItemInner; +import org.joda.time.DateTime; +import java.util.Map; + +/** + * Type representing ListContainerItem. + */ +public interface ListContainerItem extends HasInner, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the hasImmutabilityPolicy value. + */ + Boolean hasImmutabilityPolicy(); + + /** + * @return the hasLegalHold value. + */ + Boolean hasLegalHold(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the immutabilityPolicy value. + */ + ImmutabilityPolicyProperties immutabilityPolicy(); + + /** + * @return the lastModifiedTime value. + */ + DateTime lastModifiedTime(); + + /** + * @return the leaseDuration value. + */ + LeaseDuration leaseDuration(); + + /** + * @return the leaseState value. + */ + LeaseState leaseState(); + + /** + * @return the leaseStatus value. + */ + LeaseStatus leaseStatus(); + + /** + * @return the legalHold value. + */ + LegalHoldProperties legalHold(); + + /** + * @return the metadata value. + */ + Map metadata(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the publicAccess value. + */ + PublicAccess publicAccess(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ListContainerItems.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ListContainerItems.java new file mode 100644 index 000000000000..eac67e8ceb24 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ListContainerItems.java @@ -0,0 +1,31 @@ +/** + * 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.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.ListContainerItemsInner; +import java.util.List; + +/** + * Type representing ListContainerItems. + */ +public interface ListContainerItems extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ListServiceSasResponse.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ListServiceSasResponse.java new file mode 100644 index 000000000000..ac0ab1186665 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ListServiceSasResponse.java @@ -0,0 +1,25 @@ +/** + * 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.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.ListServiceSasResponseInner; + +/** + * Type representing ListServiceSasResponse. + */ +public interface ListServiceSasResponse extends HasInner, HasManager { + /** + * @return the serviceSasToken value. + */ + String serviceSasToken(); + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicies.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicies.java new file mode 100644 index 000000000000..e8c5457e9e00 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_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.v2019_04_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.ManagementPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ManagementPolicies. + */ +public interface ManagementPolicies extends SupportsCreating, HasInner { + /** + * Gets the managementpolicy 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 managementpolicy 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/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicy.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicy.java new file mode 100644 index 000000000000..26774bd362e9 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicy.java @@ -0,0 +1,124 @@ +/** + * 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.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.ManagementPolicyInner; +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.v2019_04_01.implementation.StorageManager; +import java.util.List; +import org.joda.time.DateTime; + +/** + * Type representing ManagementPolicy. + */ +public interface ManagementPolicy 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. + */ + ManagementPolicySchema policy(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ManagementPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithStorageAccount, DefinitionStages.WithPolicy, DefinitionStages.WithCreate { + } + + /** + * Grouping of ManagementPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ManagementPolicy definition. + */ + interface Blank extends WithStorageAccount { + } + + /** + * The stage of the managementpolicy definition allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies resourceGroupName, accountName. + * @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 + * @return the next definition stage + */ + WithPolicy withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the managementpolicy definition allowing to specify Policy. + */ + interface WithPolicy { + /** + * Specifies policy. + * @param policy The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts + * @return the next definition stage + */ + WithCreate withPolicy(ManagementPolicySchema policy); + } + + /** + * 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 ManagementPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithPolicy { + } + + /** + * Grouping of ManagementPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the managementpolicy update allowing to specify Policy. + */ + interface WithPolicy { + /** + * Specifies policy. + * @param policy The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts + * @return the next update stage + */ + Update withPolicy(ManagementPolicySchema policy); + } + + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicyAction.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicyAction.java new file mode 100644 index 000000000000..333177215c78 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicyAction.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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Actions are applied to the filtered blobs when the execution condition is + * met. + */ +public class ManagementPolicyAction { + /** + * The management policy action for base blob. + */ + @JsonProperty(value = "baseBlob") + private ManagementPolicyBaseBlob baseBlob; + + /** + * The management policy action for snapshot. + */ + @JsonProperty(value = "snapshot") + private ManagementPolicySnapShot snapshot; + + /** + * Get the management policy action for base blob. + * + * @return the baseBlob value + */ + public ManagementPolicyBaseBlob baseBlob() { + return this.baseBlob; + } + + /** + * Set the management policy action for base blob. + * + * @param baseBlob the baseBlob value to set + * @return the ManagementPolicyAction object itself. + */ + public ManagementPolicyAction withBaseBlob(ManagementPolicyBaseBlob baseBlob) { + this.baseBlob = baseBlob; + return this; + } + + /** + * Get the management policy action for snapshot. + * + * @return the snapshot value + */ + public ManagementPolicySnapShot snapshot() { + return this.snapshot; + } + + /** + * Set the management policy action for snapshot. + * + * @param snapshot the snapshot value to set + * @return the ManagementPolicyAction object itself. + */ + public ManagementPolicyAction withSnapshot(ManagementPolicySnapShot snapshot) { + this.snapshot = snapshot; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicyBaseBlob.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicyBaseBlob.java new file mode 100644 index 000000000000..336a5f2174d3 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicyBaseBlob.java @@ -0,0 +1,97 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Management policy action for base blob. + */ +public class ManagementPolicyBaseBlob { + /** + * The function to tier blobs to cool storage. Support blobs currently at + * Hot tier. + */ + @JsonProperty(value = "tierToCool") + private DateAfterModification tierToCool; + + /** + * The function to tier blobs to archive storage. Support blobs currently + * at Hot or Cool tier. + */ + @JsonProperty(value = "tierToArchive") + private DateAfterModification tierToArchive; + + /** + * The function to delete the blob. + */ + @JsonProperty(value = "delete") + private DateAfterModification delete; + + /** + * Get the function to tier blobs to cool storage. Support blobs currently at Hot tier. + * + * @return the tierToCool value + */ + public DateAfterModification tierToCool() { + return this.tierToCool; + } + + /** + * Set the function to tier blobs to cool storage. Support blobs currently at Hot tier. + * + * @param tierToCool the tierToCool value to set + * @return the ManagementPolicyBaseBlob object itself. + */ + public ManagementPolicyBaseBlob withTierToCool(DateAfterModification tierToCool) { + this.tierToCool = tierToCool; + return this; + } + + /** + * Get the function to tier blobs to archive storage. Support blobs currently at Hot or Cool tier. + * + * @return the tierToArchive value + */ + public DateAfterModification tierToArchive() { + return this.tierToArchive; + } + + /** + * Set the function to tier blobs to archive storage. Support blobs currently at Hot or Cool tier. + * + * @param tierToArchive the tierToArchive value to set + * @return the ManagementPolicyBaseBlob object itself. + */ + public ManagementPolicyBaseBlob withTierToArchive(DateAfterModification tierToArchive) { + this.tierToArchive = tierToArchive; + return this; + } + + /** + * Get the function to delete the blob. + * + * @return the delete value + */ + public DateAfterModification delete() { + return this.delete; + } + + /** + * Set the function to delete the blob. + * + * @param delete the delete value to set + * @return the ManagementPolicyBaseBlob object itself. + */ + public ManagementPolicyBaseBlob withDelete(DateAfterModification delete) { + this.delete = delete; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicyDefinition.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicyDefinition.java new file mode 100644 index 000000000000..5df8c6adf5f2 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicyDefinition.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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An object that defines the Lifecycle rule. Each definition is made up with a + * filters set and an actions set. + */ +public class ManagementPolicyDefinition { + /** + * An object that defines the action set. + */ + @JsonProperty(value = "actions", required = true) + private ManagementPolicyAction actions; + + /** + * An object that defines the filter set. + */ + @JsonProperty(value = "filters") + private ManagementPolicyFilter filters; + + /** + * Get an object that defines the action set. + * + * @return the actions value + */ + public ManagementPolicyAction actions() { + return this.actions; + } + + /** + * Set an object that defines the action set. + * + * @param actions the actions value to set + * @return the ManagementPolicyDefinition object itself. + */ + public ManagementPolicyDefinition withActions(ManagementPolicyAction actions) { + this.actions = actions; + return this; + } + + /** + * Get an object that defines the filter set. + * + * @return the filters value + */ + public ManagementPolicyFilter filters() { + return this.filters; + } + + /** + * Set an object that defines the filter set. + * + * @param filters the filters value to set + * @return the ManagementPolicyDefinition object itself. + */ + public ManagementPolicyDefinition withFilters(ManagementPolicyFilter filters) { + this.filters = filters; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicyFilter.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicyFilter.java new file mode 100644 index 000000000000..fa579adbea6f --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicyFilter.java @@ -0,0 +1,71 @@ +/** + * 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.v2019_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filters limit rule actions to a subset of blobs within the storage account. + * If multiple filters are defined, a logical AND is performed on all filters. + */ +public class ManagementPolicyFilter { + /** + * An array of strings for prefixes to be match. + */ + @JsonProperty(value = "prefixMatch") + private List prefixMatch; + + /** + * An array of predefined enum values. Only blockBlob is supported. + */ + @JsonProperty(value = "blobTypes", required = true) + private List blobTypes; + + /** + * Get an array of strings for prefixes to be match. + * + * @return the prefixMatch value + */ + public List prefixMatch() { + return this.prefixMatch; + } + + /** + * Set an array of strings for prefixes to be match. + * + * @param prefixMatch the prefixMatch value to set + * @return the ManagementPolicyFilter object itself. + */ + public ManagementPolicyFilter withPrefixMatch(List prefixMatch) { + this.prefixMatch = prefixMatch; + return this; + } + + /** + * Get an array of predefined enum values. Only blockBlob is supported. + * + * @return the blobTypes value + */ + public List blobTypes() { + return this.blobTypes; + } + + /** + * Set an array of predefined enum values. Only blockBlob is supported. + * + * @param blobTypes the blobTypes value to set + * @return the ManagementPolicyFilter object itself. + */ + public ManagementPolicyFilter withBlobTypes(List blobTypes) { + this.blobTypes = blobTypes; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicyRule.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicyRule.java new file mode 100644 index 000000000000..7e4085a8d600 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicyRule.java @@ -0,0 +1,132 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An object that wraps the Lifecycle rule. Each rule is uniquely defined by + * name. + */ +public class ManagementPolicyRule { + /** + * Rule is enabled if set to true. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * A rule name can contain any combination of alpha numeric characters. + * Rule name is case-sensitive. It must be unique within a policy. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The valid value is Lifecycle. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * An object that defines the Lifecycle rule. + */ + @JsonProperty(value = "definition", required = true) + private ManagementPolicyDefinition definition; + + /** + * Creates an instance of ManagementPolicyRule class. + * @param name a rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy. + * @param definition an object that defines the Lifecycle rule. + */ + public ManagementPolicyRule() { + type = "Lifecycle"; + } + + /** + * Get rule is enabled if set to true. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set rule is enabled if set to true. + * + * @param enabled the enabled value to set + * @return the ManagementPolicyRule object itself. + */ + public ManagementPolicyRule withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get a rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set a rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy. + * + * @param name the name value to set + * @return the ManagementPolicyRule object itself. + */ + public ManagementPolicyRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the valid value is Lifecycle. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the valid value is Lifecycle. + * + * @param type the type value to set + * @return the ManagementPolicyRule object itself. + */ + public ManagementPolicyRule withType(String type) { + this.type = type; + return this; + } + + /** + * Get an object that defines the Lifecycle rule. + * + * @return the definition value + */ + public ManagementPolicyDefinition definition() { + return this.definition; + } + + /** + * Set an object that defines the Lifecycle rule. + * + * @param definition the definition value to set + * @return the ManagementPolicyRule object itself. + */ + public ManagementPolicyRule withDefinition(ManagementPolicyDefinition definition) { + this.definition = definition; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicySchema.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicySchema.java new file mode 100644 index 000000000000..52af0fa001b2 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicySchema.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.v2019_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Storage Account ManagementPolicies Rules. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + */ +public class ManagementPolicySchema { + /** + * The Storage Account ManagementPolicies Rules. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + */ + @JsonProperty(value = "rules", required = true) + private List rules; + + /** + * Get the Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set the Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @param rules the rules value to set + * @return the ManagementPolicySchema object itself. + */ + public ManagementPolicySchema withRules(List rules) { + this.rules = rules; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicySnapShot.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicySnapShot.java new file mode 100644 index 000000000000..fbbd78755d56 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ManagementPolicySnapShot.java @@ -0,0 +1,43 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Management policy action for snapshot. + */ +public class ManagementPolicySnapShot { + /** + * The function to delete the blob snapshot. + */ + @JsonProperty(value = "delete") + private DateAfterCreation delete; + + /** + * Get the function to delete the blob snapshot. + * + * @return the delete value + */ + public DateAfterCreation delete() { + return this.delete; + } + + /** + * Set the function to delete the blob snapshot. + * + * @param delete the delete value to set + * @return the ManagementPolicySnapShot object itself. + */ + public ManagementPolicySnapShot withDelete(DateAfterCreation delete) { + this.delete = delete; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/MetricSpecification.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/MetricSpecification.java new file mode 100644 index 000000000000..01bce689beb3 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/MetricSpecification.java @@ -0,0 +1,252 @@ +/** + * 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.v2019_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metric specification of operation. + */ +public class MetricSpecification { + /** + * Name of metric specification. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display name of metric specification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Display description of metric specification. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /** + * Unit could be Bytes or Count. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Dimensions of blobs, including blob type and access tier. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Aggregation type could be Average. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /** + * The property to decide fill gap with zero or not. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /** + * The category this metric specification belong to, could be Capacity. + */ + @JsonProperty(value = "category") + private String category; + + /** + * Account Resource Id. + */ + @JsonProperty(value = "resourceIdDimensionNameOverride") + private String resourceIdDimensionNameOverride; + + /** + * Get name of metric specification. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of metric specification. + * + * @param name the name value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get display name of metric specification. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set display name of metric specification. + * + * @param displayName the displayName value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get display description of metric specification. + * + * @return the displayDescription value + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set display description of metric specification. + * + * @param displayDescription the displayDescription value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get unit could be Bytes or Count. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set unit could be Bytes or Count. + * + * @param unit the unit value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get dimensions of blobs, including blob type and access tier. + * + * @return the dimensions value + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set dimensions of blobs, including blob type and access tier. + * + * @param dimensions the dimensions value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get aggregation type could be Average. + * + * @return the aggregationType value + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set aggregation type could be Average. + * + * @param aggregationType the aggregationType value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the property to decide fill gap with zero or not. + * + * @return the fillGapWithZero value + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the property to decide fill gap with zero or not. + * + * @param fillGapWithZero the fillGapWithZero value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the category this metric specification belong to, could be Capacity. + * + * @return the category value + */ + public String category() { + return this.category; + } + + /** + * Set the category this metric specification belong to, could be Capacity. + * + * @param category the category value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get account Resource Id. + * + * @return the resourceIdDimensionNameOverride value + */ + public String resourceIdDimensionNameOverride() { + return this.resourceIdDimensionNameOverride; + } + + /** + * Set account Resource Id. + * + * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withResourceIdDimensionNameOverride(String resourceIdDimensionNameOverride) { + this.resourceIdDimensionNameOverride = resourceIdDimensionNameOverride; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/NetworkRuleSet.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/NetworkRuleSet.java new file mode 100644 index 000000000000..0f1f757b2a8d --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/NetworkRuleSet.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.v2019_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network rule set. + */ +public class NetworkRuleSet { + /** + * Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. + * Possible values are any combination of Logging|Metrics|AzureServices + * (For example, "Logging, Metrics"), or None to bypass none of those + * traffics. Possible values include: 'None', 'Logging', 'Metrics', + * 'AzureServices'. + */ + @JsonProperty(value = "bypass") + private Bypass bypass; + + /** + * Sets the virtual network rules. + */ + @JsonProperty(value = "virtualNetworkRules") + private List virtualNetworkRules; + + /** + * Sets the IP ACL rules. + */ + @JsonProperty(value = "ipRules") + private List ipRules; + + /** + * Specifies the default action of allow or deny when no other rules match. + * Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "defaultAction", required = true) + private DefaultAction defaultAction; + + /** + * Get specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. Possible values include: 'None', 'Logging', 'Metrics', 'AzureServices'. + * + * @return the bypass value + */ + public Bypass bypass() { + return this.bypass; + } + + /** + * Set specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. Possible values include: 'None', 'Logging', 'Metrics', 'AzureServices'. + * + * @param bypass the bypass value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withBypass(Bypass bypass) { + this.bypass = bypass; + return this; + } + + /** + * Get sets the virtual network rules. + * + * @return the virtualNetworkRules value + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set sets the virtual network rules. + * + * @param virtualNetworkRules the virtualNetworkRules value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withVirtualNetworkRules(List virtualNetworkRules) { + this.virtualNetworkRules = virtualNetworkRules; + return this; + } + + /** + * Get sets the IP ACL rules. + * + * @return the ipRules value + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set sets the IP ACL rules. + * + * @param ipRules the ipRules value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + + /** + * Get specifies the default action of allow or deny when no other rules match. Possible values include: 'Allow', 'Deny'. + * + * @return the defaultAction value + */ + public DefaultAction defaultAction() { + return this.defaultAction; + } + + /** + * Set specifies the default action of allow or deny when no other rules match. Possible values include: 'Allow', 'Deny'. + * + * @param defaultAction the defaultAction value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withDefaultAction(DefaultAction defaultAction) { + this.defaultAction = defaultAction; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Operation.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Operation.java new file mode 100644 index 000000000000..f04e58cc6c23 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Operation.java @@ -0,0 +1,40 @@ +/** + * 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.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the serviceSpecification value. + */ + ServiceSpecification serviceSpecification(); + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/OperationDisplay.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/OperationDisplay.java new file mode 100644 index 000000000000..a006232eab67 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Display metadata associated with the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft Storage. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Type of operation: get, read, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get service provider: Microsoft Storage. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set service provider: Microsoft Storage. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed etc. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get type of operation: get, read, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set type of operation: get, read, delete, etc. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the operation. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Operations.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Operations.java new file mode 100644 index 000000000000..75bd00644178 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Operations.java @@ -0,0 +1,27 @@ +/** + * 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.v2019_04_01; + +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Storage Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Permissions.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Permissions.java new file mode 100644 index 000000000000..37fa777f4660 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Permissions.java @@ -0,0 +1,59 @@ +/** + * 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.v2019_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Permissions. + */ +public final class Permissions extends ExpandableStringEnum { + /** Static value r for Permissions. */ + public static final Permissions R = fromString("r"); + + /** Static value d for Permissions. */ + public static final Permissions D = fromString("d"); + + /** Static value w for Permissions. */ + public static final Permissions W = fromString("w"); + + /** Static value l for Permissions. */ + public static final Permissions L = fromString("l"); + + /** Static value a for Permissions. */ + public static final Permissions A = fromString("a"); + + /** Static value c for Permissions. */ + public static final Permissions C = fromString("c"); + + /** Static value u for Permissions. */ + public static final Permissions U = fromString("u"); + + /** Static value p for Permissions. */ + public static final Permissions P = fromString("p"); + + /** + * Creates or finds a Permissions from its string representation. + * @param name a name to look for + * @return the corresponding Permissions + */ + @JsonCreator + public static Permissions fromString(String name) { + return fromString(name, Permissions.class); + } + + /** + * @return known Permissions values + */ + public static Collection values() { + return values(Permissions.class); + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ProvisioningState.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ProvisioningState.java new file mode 100644 index 000000000000..256e8930c533 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ProvisioningState.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ProvisioningState. + */ +public enum ProvisioningState { + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value ResolvingDNS. */ + RESOLVING_DNS("ResolvingDNS"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"); + + /** The actual serialized value for a ProvisioningState instance. */ + private String value; + + ProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed ProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static ProvisioningState fromString(String value) { + ProvisioningState[] items = ProvisioningState.values(); + for (ProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/PublicAccess.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/PublicAccess.java new file mode 100644 index 000000000000..9c8e837adb9c --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/PublicAccess.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for PublicAccess. + */ +public enum PublicAccess { + /** Enum value Container. */ + CONTAINER("Container"), + + /** Enum value Blob. */ + BLOB("Blob"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a PublicAccess instance. */ + private String value; + + PublicAccess(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PublicAccess instance. + * + * @param value the serialized value to parse. + * @return the parsed PublicAccess object, or null if unable to parse. + */ + @JsonCreator + public static PublicAccess fromString(String value) { + PublicAccess[] items = PublicAccess.values(); + for (PublicAccess item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Reason.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Reason.java new file mode 100644 index 000000000000..26a3ad063855 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Reason.java @@ -0,0 +1,53 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Reason. + */ +public enum Reason { + /** Enum value AccountNameInvalid. */ + ACCOUNT_NAME_INVALID("AccountNameInvalid"), + + /** Enum value AlreadyExists. */ + ALREADY_EXISTS("AlreadyExists"); + + /** The actual serialized value for a Reason instance. */ + private String value; + + Reason(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Reason instance. + * + * @param value the serialized value to parse. + * @return the parsed Reason object, or null if unable to parse. + */ + @JsonCreator + public static Reason fromString(String value) { + Reason[] items = Reason.values(); + for (Reason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ReasonCode.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ReasonCode.java new file mode 100644 index 000000000000..542b014393f8 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ReasonCode.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.v2019_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ReasonCode. + */ +public final class ReasonCode extends ExpandableStringEnum { + /** Static value QuotaId for ReasonCode. */ + public static final ReasonCode QUOTA_ID = fromString("QuotaId"); + + /** Static value NotAvailableForSubscription for ReasonCode. */ + public static final ReasonCode NOT_AVAILABLE_FOR_SUBSCRIPTION = fromString("NotAvailableForSubscription"); + + /** + * Creates or finds a ReasonCode from its string representation. + * @param name a name to look for + * @return the corresponding ReasonCode + */ + @JsonCreator + public static ReasonCode fromString(String name) { + return fromString(name, ReasonCode.class); + } + + /** + * @return known ReasonCode values + */ + public static Collection values() { + return values(ReasonCode.class); + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Restriction.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Restriction.java new file mode 100644 index 000000000000..e3577f8fdf53 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Restriction.java @@ -0,0 +1,80 @@ +/** + * 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.v2019_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The restriction because of which SKU cannot be used. + */ +public class Restriction { + /** + * The type of restrictions. As of now only possible value for this is + * location. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The value of restrictions. If the restriction type is set to location. + * This would be different locations where the SKU is restricted. + */ + @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) + private List values; + + /** + * The reason for the restriction. As of now this can be "QuotaId" or + * "NotAvailableForSubscription". Quota Id is set when the SKU has + * requiredQuotas parameter as the subscription does not belong to that + * quota. The "NotAvailableForSubscription" is related to capacity at DC. + * Possible values include: 'QuotaId', 'NotAvailableForSubscription'. + */ + @JsonProperty(value = "reasonCode") + private ReasonCode reasonCode; + + /** + * Get the type of restrictions. As of now only possible value for this is location. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Get the reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. + * + * @return the reasonCode value + */ + public ReasonCode reasonCode() { + return this.reasonCode; + } + + /** + * Set the reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. + * + * @param reasonCode the reasonCode value to set + * @return the Restriction object itself. + */ + public Restriction withReasonCode(ReasonCode reasonCode) { + this.reasonCode = reasonCode; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/SKUCapability.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/SKUCapability.java new file mode 100644 index 000000000000..0ab5476b0536 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/SKUCapability.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The capability information in the specified SKU, including file encryption, + * network ACLs, change notification, etc. + */ +public class SKUCapability { + /** + * The name of capability, The capability information in the specified SKU, + * including file encryption, network ACLs, change notification, etc. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * A string value to indicate states of given capability. Possibly 'true' + * or 'false'. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get the name of capability, The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get a string value to indicate states of given capability. Possibly 'true' or 'false'. + * + * @return the value value + */ + public String value() { + return this.value; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ServiceSasParameters.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ServiceSasParameters.java new file mode 100644 index 000000000000..ff54d3c2fde3 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ServiceSasParameters.java @@ -0,0 +1,493 @@ +/** + * 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.v2019_04_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters to list service SAS credentials of a specific resource. + */ +public class ServiceSasParameters { + /** + * The canonical path to the signed resource. + */ + @JsonProperty(value = "canonicalizedResource", required = true) + private String canonicalizedResource; + + /** + * The signed services accessible with the service SAS. Possible values + * include: Blob (b), Container (c), File (f), Share (s). Possible values + * include: 'b', 'c', 'f', 's'. + */ + @JsonProperty(value = "signedResource") + private SignedResource resource; + + /** + * The signed permissions for the service SAS. Possible values include: + * Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update + * (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', + * 'c', 'u', 'p'. + */ + @JsonProperty(value = "signedPermission") + private Permissions permissions; + + /** + * An IP address or a range of IP addresses from which to accept requests. + */ + @JsonProperty(value = "signedIp") + private String iPAddressOrRange; + + /** + * The protocol permitted for a request made with the account SAS. Possible + * values include: 'https,http', 'https'. + */ + @JsonProperty(value = "signedProtocol") + private HttpProtocol protocols; + + /** + * The time at which the SAS becomes valid. + */ + @JsonProperty(value = "signedStart") + private DateTime sharedAccessStartTime; + + /** + * The time at which the shared access signature becomes invalid. + */ + @JsonProperty(value = "signedExpiry") + private DateTime sharedAccessExpiryTime; + + /** + * A unique value up to 64 characters in length that correlates to an + * access policy specified for the container, queue, or table. + */ + @JsonProperty(value = "signedIdentifier") + private String identifier; + + /** + * The start of partition key. + */ + @JsonProperty(value = "startPk") + private String partitionKeyStart; + + /** + * The end of partition key. + */ + @JsonProperty(value = "endPk") + private String partitionKeyEnd; + + /** + * The start of row key. + */ + @JsonProperty(value = "startRk") + private String rowKeyStart; + + /** + * The end of row key. + */ + @JsonProperty(value = "endRk") + private String rowKeyEnd; + + /** + * The key to sign the account SAS token with. + */ + @JsonProperty(value = "keyToSign") + private String keyToSign; + + /** + * The response header override for cache control. + */ + @JsonProperty(value = "rscc") + private String cacheControl; + + /** + * The response header override for content disposition. + */ + @JsonProperty(value = "rscd") + private String contentDisposition; + + /** + * The response header override for content encoding. + */ + @JsonProperty(value = "rsce") + private String contentEncoding; + + /** + * The response header override for content language. + */ + @JsonProperty(value = "rscl") + private String contentLanguage; + + /** + * The response header override for content type. + */ + @JsonProperty(value = "rsct") + private String contentType; + + /** + * Get the canonical path to the signed resource. + * + * @return the canonicalizedResource value + */ + public String canonicalizedResource() { + return this.canonicalizedResource; + } + + /** + * Set the canonical path to the signed resource. + * + * @param canonicalizedResource the canonicalizedResource value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withCanonicalizedResource(String canonicalizedResource) { + this.canonicalizedResource = canonicalizedResource; + return this; + } + + /** + * Get the signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). Possible values include: 'b', 'c', 'f', 's'. + * + * @return the resource value + */ + public SignedResource resource() { + return this.resource; + } + + /** + * Set the signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). Possible values include: 'b', 'c', 'f', 's'. + * + * @param resource the resource value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withResource(SignedResource resource) { + this.resource = resource; + return this; + } + + /** + * Get the signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. + * + * @return the permissions value + */ + public Permissions permissions() { + return this.permissions; + } + + /** + * Set the signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. + * + * @param permissions the permissions value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withPermissions(Permissions permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get an IP address or a range of IP addresses from which to accept requests. + * + * @return the iPAddressOrRange value + */ + public String iPAddressOrRange() { + return this.iPAddressOrRange; + } + + /** + * Set an IP address or a range of IP addresses from which to accept requests. + * + * @param iPAddressOrRange the iPAddressOrRange value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withIPAddressOrRange(String iPAddressOrRange) { + this.iPAddressOrRange = iPAddressOrRange; + return this; + } + + /** + * Get the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. + * + * @return the protocols value + */ + public HttpProtocol protocols() { + return this.protocols; + } + + /** + * Set the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. + * + * @param protocols the protocols value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withProtocols(HttpProtocol protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the time at which the SAS becomes valid. + * + * @return the sharedAccessStartTime value + */ + public DateTime sharedAccessStartTime() { + return this.sharedAccessStartTime; + } + + /** + * Set the time at which the SAS becomes valid. + * + * @param sharedAccessStartTime the sharedAccessStartTime value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withSharedAccessStartTime(DateTime sharedAccessStartTime) { + this.sharedAccessStartTime = sharedAccessStartTime; + return this; + } + + /** + * Get the time at which the shared access signature becomes invalid. + * + * @return the sharedAccessExpiryTime value + */ + public DateTime sharedAccessExpiryTime() { + return this.sharedAccessExpiryTime; + } + + /** + * Set the time at which the shared access signature becomes invalid. + * + * @param sharedAccessExpiryTime the sharedAccessExpiryTime value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withSharedAccessExpiryTime(DateTime sharedAccessExpiryTime) { + this.sharedAccessExpiryTime = sharedAccessExpiryTime; + return this; + } + + /** + * Get a unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. + * + * @return the identifier value + */ + public String identifier() { + return this.identifier; + } + + /** + * Set a unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. + * + * @param identifier the identifier value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withIdentifier(String identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the start of partition key. + * + * @return the partitionKeyStart value + */ + public String partitionKeyStart() { + return this.partitionKeyStart; + } + + /** + * Set the start of partition key. + * + * @param partitionKeyStart the partitionKeyStart value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withPartitionKeyStart(String partitionKeyStart) { + this.partitionKeyStart = partitionKeyStart; + return this; + } + + /** + * Get the end of partition key. + * + * @return the partitionKeyEnd value + */ + public String partitionKeyEnd() { + return this.partitionKeyEnd; + } + + /** + * Set the end of partition key. + * + * @param partitionKeyEnd the partitionKeyEnd value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withPartitionKeyEnd(String partitionKeyEnd) { + this.partitionKeyEnd = partitionKeyEnd; + return this; + } + + /** + * Get the start of row key. + * + * @return the rowKeyStart value + */ + public String rowKeyStart() { + return this.rowKeyStart; + } + + /** + * Set the start of row key. + * + * @param rowKeyStart the rowKeyStart value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withRowKeyStart(String rowKeyStart) { + this.rowKeyStart = rowKeyStart; + return this; + } + + /** + * Get the end of row key. + * + * @return the rowKeyEnd value + */ + public String rowKeyEnd() { + return this.rowKeyEnd; + } + + /** + * Set the end of row key. + * + * @param rowKeyEnd the rowKeyEnd value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withRowKeyEnd(String rowKeyEnd) { + this.rowKeyEnd = rowKeyEnd; + return this; + } + + /** + * Get the key to sign the account SAS token with. + * + * @return the keyToSign value + */ + public String keyToSign() { + return this.keyToSign; + } + + /** + * Set the key to sign the account SAS token with. + * + * @param keyToSign the keyToSign value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withKeyToSign(String keyToSign) { + this.keyToSign = keyToSign; + return this; + } + + /** + * Get the response header override for cache control. + * + * @return the cacheControl value + */ + public String cacheControl() { + return this.cacheControl; + } + + /** + * Set the response header override for cache control. + * + * @param cacheControl the cacheControl value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withCacheControl(String cacheControl) { + this.cacheControl = cacheControl; + return this; + } + + /** + * Get the response header override for content disposition. + * + * @return the contentDisposition value + */ + public String contentDisposition() { + return this.contentDisposition; + } + + /** + * Set the response header override for content disposition. + * + * @param contentDisposition the contentDisposition value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withContentDisposition(String contentDisposition) { + this.contentDisposition = contentDisposition; + return this; + } + + /** + * Get the response header override for content encoding. + * + * @return the contentEncoding value + */ + public String contentEncoding() { + return this.contentEncoding; + } + + /** + * Set the response header override for content encoding. + * + * @param contentEncoding the contentEncoding value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withContentEncoding(String contentEncoding) { + this.contentEncoding = contentEncoding; + return this; + } + + /** + * Get the response header override for content language. + * + * @return the contentLanguage value + */ + public String contentLanguage() { + return this.contentLanguage; + } + + /** + * Set the response header override for content language. + * + * @param contentLanguage the contentLanguage value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withContentLanguage(String contentLanguage) { + this.contentLanguage = contentLanguage; + return this; + } + + /** + * Get the response header override for content type. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the response header override for content type. + * + * @param contentType the contentType value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withContentType(String contentType) { + this.contentType = contentType; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ServiceSpecification.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ServiceSpecification.java new file mode 100644 index 000000000000..dff308992681 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ServiceSpecification.java @@ -0,0 +1,44 @@ +/** + * 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.v2019_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * One property of operation, include metric specifications. + */ +public class ServiceSpecification { + /** + * Metric specifications of operation. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get metric specifications of operation. + * + * @return the metricSpecifications value + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set metric specifications of operation. + * + * @param metricSpecifications the metricSpecifications value to set + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Services.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Services.java new file mode 100644 index 000000000000..245f204876a5 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Services.java @@ -0,0 +1,47 @@ +/** + * 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.v2019_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Services. + */ +public final class Services extends ExpandableStringEnum { + /** Static value b for Services. */ + public static final Services B = fromString("b"); + + /** Static value q for Services. */ + public static final Services Q = fromString("q"); + + /** Static value t for Services. */ + public static final Services T = fromString("t"); + + /** Static value f for Services. */ + public static final Services F = fromString("f"); + + /** + * Creates or finds a Services from its string representation. + * @param name a name to look for + * @return the corresponding Services + */ + @JsonCreator + public static Services fromString(String name) { + return fromString(name, Services.class); + } + + /** + * @return known Services values + */ + public static Collection values() { + return values(Services.class); + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/SignedResource.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/SignedResource.java new file mode 100644 index 000000000000..81c2d41fdde3 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/SignedResource.java @@ -0,0 +1,47 @@ +/** + * 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.v2019_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SignedResource. + */ +public final class SignedResource extends ExpandableStringEnum { + /** Static value b for SignedResource. */ + public static final SignedResource B = fromString("b"); + + /** Static value c for SignedResource. */ + public static final SignedResource C = fromString("c"); + + /** Static value f for SignedResource. */ + public static final SignedResource F = fromString("f"); + + /** Static value s for SignedResource. */ + public static final SignedResource S = fromString("s"); + + /** + * Creates or finds a SignedResource from its string representation. + * @param name a name to look for + * @return the corresponding SignedResource + */ + @JsonCreator + public static SignedResource fromString(String name) { + return fromString(name, SignedResource.class); + } + + /** + * @return known SignedResource values + */ + public static Collection values() { + return values(SignedResource.class); + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/SignedResourceTypes.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/SignedResourceTypes.java new file mode 100644 index 000000000000..ad336f0390a5 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/SignedResourceTypes.java @@ -0,0 +1,44 @@ +/** + * 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.v2019_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SignedResourceTypes. + */ +public final class SignedResourceTypes extends ExpandableStringEnum { + /** Static value s for SignedResourceTypes. */ + public static final SignedResourceTypes S = fromString("s"); + + /** Static value c for SignedResourceTypes. */ + public static final SignedResourceTypes C = fromString("c"); + + /** Static value o for SignedResourceTypes. */ + public static final SignedResourceTypes O = fromString("o"); + + /** + * Creates or finds a SignedResourceTypes from its string representation. + * @param name a name to look for + * @return the corresponding SignedResourceTypes + */ + @JsonCreator + public static SignedResourceTypes fromString(String name) { + return fromString(name, SignedResourceTypes.class); + } + + /** + * @return known SignedResourceTypes values + */ + public static Collection values() { + return values(SignedResourceTypes.class); + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Sku.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Sku.java new file mode 100644 index 000000000000..f84cb612bf3a --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Sku.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.SkuInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.StorageManager; +import java.util.List; + +/** + * Type representing Sku. + */ +public interface Sku extends HasInner, HasManager { + /** + * @return the capabilities value. + */ + List capabilities(); + + /** + * @return the kind value. + */ + Kind kind(); + + /** + * @return the locations value. + */ + List locations(); + + /** + * @return the name value. + */ + SkuName name(); + + /** + * @return the resourceType value. + */ + String resourceType(); + + /** + * @return the restrictions value. + */ + List restrictions(); + + /** + * @return the tier value. + */ + SkuTier tier(); + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/SkuName.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/SkuName.java new file mode 100644 index 000000000000..6e64adb6dfe9 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/SkuName.java @@ -0,0 +1,59 @@ +/** + * 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.v2019_04_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuName. + */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Standard_LRS for SkuName. */ + public static final SkuName STANDARD_LRS = fromString("Standard_LRS"); + + /** Static value Standard_GRS for SkuName. */ + public static final SkuName STANDARD_GRS = fromString("Standard_GRS"); + + /** Static value Standard_RAGRS for SkuName. */ + public static final SkuName STANDARD_RAGRS = fromString("Standard_RAGRS"); + + /** Static value Standard_ZRS for SkuName. */ + public static final SkuName STANDARD_ZRS = fromString("Standard_ZRS"); + + /** Static value Premium_LRS for SkuName. */ + public static final SkuName PREMIUM_LRS = fromString("Premium_LRS"); + + /** Static value Premium_ZRS for SkuName. */ + public static final SkuName PREMIUM_ZRS = fromString("Premium_ZRS"); + + /** Static value Standard_GZRS for SkuName. */ + public static final SkuName STANDARD_GZRS = fromString("Standard_GZRS"); + + /** Static value Standard_RAGZRS for SkuName. */ + public static final SkuName STANDARD_RAGZRS = fromString("Standard_RAGZRS"); + + /** + * Creates or finds a SkuName from its string representation. + * @param name a name to look for + * @return the corresponding SkuName + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * @return known SkuName values + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/SkuTier.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/SkuTier.java new file mode 100644 index 000000000000..92395e5712b0 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/SkuTier.java @@ -0,0 +1,53 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SkuTier. + */ +public enum SkuTier { + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a SkuTier instance. */ + private String value; + + SkuTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuTier instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuTier object, or null if unable to parse. + */ + @JsonCreator + public static SkuTier fromString(String value) { + SkuTier[] items = SkuTier.values(); + for (SkuTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Skus.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Skus.java new file mode 100644 index 000000000000..160c9c3e124c --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Skus.java @@ -0,0 +1,19 @@ +/** + * 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.v2019_04_01; + +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.SkusInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Skus. + */ +public interface Skus extends SupportsListing, HasInner { +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/State.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/State.java new file mode 100644 index 000000000000..21f0f87ba3e5 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/State.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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for State. + */ +public enum State { + /** Enum value provisioning. */ + PROVISIONING("provisioning"), + + /** Enum value deprovisioning. */ + DEPROVISIONING("deprovisioning"), + + /** Enum value succeeded. */ + SUCCEEDED("succeeded"), + + /** Enum value failed. */ + FAILED("failed"), + + /** Enum value networkSourceDeleted. */ + NETWORK_SOURCE_DELETED("networkSourceDeleted"); + + /** The actual serialized value for a State instance. */ + private String value; + + State(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a State instance. + * + * @param value the serialized value to parse. + * @return the parsed State object, or null if unable to parse. + */ + @JsonCreator + public static State fromString(String value) { + State[] items = State.values(); + for (State item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccount.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccount.java new file mode 100644 index 000000000000..3f4800c32440 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccount.java @@ -0,0 +1,403 @@ +/** + * 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.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +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.v2019_04_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.SkuInner; +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.StorageAccountInner; + +/** + * Type representing StorageAccount. + */ +public interface StorageAccount extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the accessTier value. + */ + AccessTier accessTier(); + + /** + * @return the azureFilesIdentityBasedAuthentication value. + */ + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication(); + + /** + * @return the creationTime value. + */ + DateTime creationTime(); + + /** + * @return the customDomain value. + */ + CustomDomain customDomain(); + + /** + * @return the enableHttpsTrafficOnly value. + */ + Boolean enableHttpsTrafficOnly(); + + /** + * @return the encryption value. + */ + Encryption encryption(); + + /** + * @return the failoverInProgress value. + */ + Boolean failoverInProgress(); + + /** + * @return the geoReplicationStats value. + */ + GeoReplicationStats geoReplicationStats(); + + /** + * @return the identity value. + */ + Identity identity(); + + /** + * @return the isHnsEnabled value. + */ + Boolean isHnsEnabled(); + + /** + * @return the kind value. + */ + Kind kind(); + + /** + * @return the lastGeoFailoverTime value. + */ + DateTime lastGeoFailoverTime(); + + /** + * @return the networkRuleSet value. + */ + NetworkRuleSet networkRuleSet(); + + /** + * @return the primaryEndpoints value. + */ + Endpoints primaryEndpoints(); + + /** + * @return the primaryLocation value. + */ + String primaryLocation(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the secondaryEndpoints value. + */ + Endpoints secondaryEndpoints(); + + /** + * @return the secondaryLocation value. + */ + String secondaryLocation(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the statusOfPrimary value. + */ + AccountStatus statusOfPrimary(); + + /** + * @return the statusOfSecondary value. + */ + AccountStatus statusOfSecondary(); + + /** + * The entirety of the StorageAccount definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithKind, DefinitionStages.WithSku, DefinitionStages.WithCreate { + } + + /** + * Grouping of StorageAccount definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a StorageAccount definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the StorageAccount definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the storageaccount definition allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + * @param kind Required. Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + * @return the next definition stage +*/ + WithSku withKind(Kind kind); + } + + /** + * The stage of the storageaccount definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku Required. Gets or sets the SKU name + * @return the next definition stage +*/ + WithCreate withSku(SkuInner sku); + } + + /** + * The stage of the storageaccount definition allowing to specify AccessTier. + */ + interface WithAccessTier { + /** + * Specifies accessTier. + * @param accessTier Required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool' + * @return the next definition stage + */ + WithCreate withAccessTier(AccessTier accessTier); + } + + /** + * The stage of the storageaccount definition allowing to specify AzureFilesIdentityBasedAuthentication. + */ + interface WithAzureFilesIdentityBasedAuthentication { + /** + * Specifies azureFilesIdentityBasedAuthentication. + * @param azureFilesIdentityBasedAuthentication Provides the identity based authentication settings for Azure Files + * @return the next definition stage + */ + WithCreate withAzureFilesIdentityBasedAuthentication(AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication); + } + + /** + * The stage of the storageaccount definition allowing to specify CustomDomain. + */ + interface WithCustomDomain { + /** + * Specifies customDomain. + * @param customDomain User domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property + * @return the next definition stage + */ + WithCreate withCustomDomain(CustomDomain customDomain); + } + + /** + * The stage of the storageaccount definition allowing to specify EnableHttpsTrafficOnly. + */ + interface WithEnableHttpsTrafficOnly { + /** + * Specifies enableHttpsTrafficOnly. + * @param enableHttpsTrafficOnly Allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01 + * @return the next definition stage + */ + WithCreate withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly); + } + + /** + * The stage of the storageaccount definition allowing to specify Encryption. + */ + interface WithEncryption { + /** + * Specifies encryption. + * @param encryption Provides the encryption settings on the account. If left unspecified the account encryption settings will remain the same. The default setting is unencrypted + * @return the next definition stage + */ + WithCreate withEncryption(Encryption encryption); + } + + /** + * The stage of the storageaccount definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the resource + * @return the next definition stage + */ + WithCreate withIdentity(Identity identity); + } + + /** + * The stage of the storageaccount definition allowing to specify IsHnsEnabled. + */ + interface WithIsHnsEnabled { + /** + * Specifies isHnsEnabled. + * @param isHnsEnabled Account HierarchicalNamespace enabled if sets to true + * @return the next definition stage + */ + WithCreate withIsHnsEnabled(Boolean isHnsEnabled); + } + + /** + * The stage of the storageaccount definition allowing to specify NetworkRuleSet. + */ + interface WithNetworkRuleSet { + /** + * Specifies networkRuleSet. + * @param networkRuleSet Network rule set + * @return the next definition stage + */ + WithCreate withNetworkRuleSet(NetworkRuleSet networkRuleSet); + } + + /** + * 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, Resource.DefinitionWithTags, DefinitionStages.WithAccessTier, DefinitionStages.WithAzureFilesIdentityBasedAuthentication, DefinitionStages.WithCustomDomain, DefinitionStages.WithEnableHttpsTrafficOnly, DefinitionStages.WithEncryption, DefinitionStages.WithIdentity, DefinitionStages.WithIsHnsEnabled, DefinitionStages.WithNetworkRuleSet { + } + } + /** + * The template for a StorageAccount update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAccessTier, UpdateStages.WithAzureFilesIdentityBasedAuthentication, UpdateStages.WithCustomDomain, UpdateStages.WithEnableHttpsTrafficOnly, UpdateStages.WithEncryption, UpdateStages.WithIdentity, UpdateStages.WithKind, UpdateStages.WithNetworkRuleSet, UpdateStages.WithSku { + } + + /** + * Grouping of StorageAccount update stages. + */ + interface UpdateStages { + /** + * The stage of the storageaccount update allowing to specify AccessTier. + */ + interface WithAccessTier { + /** + * Specifies accessTier. + * @param accessTier Required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool' + * @return the next update stage + */ + Update withAccessTier(AccessTier accessTier); + } + + /** + * The stage of the storageaccount update allowing to specify AzureFilesIdentityBasedAuthentication. + */ + interface WithAzureFilesIdentityBasedAuthentication { + /** + * Specifies azureFilesIdentityBasedAuthentication. + * @param azureFilesIdentityBasedAuthentication Provides the identity based authentication settings for Azure Files + * @return the next update stage + */ + Update withAzureFilesIdentityBasedAuthentication(AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication); + } + + /** + * The stage of the storageaccount update allowing to specify CustomDomain. + */ + interface WithCustomDomain { + /** + * Specifies customDomain. + * @param customDomain Custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property + * @return the next update stage + */ + Update withCustomDomain(CustomDomain customDomain); + } + + /** + * The stage of the storageaccount update allowing to specify EnableHttpsTrafficOnly. + */ + interface WithEnableHttpsTrafficOnly { + /** + * Specifies enableHttpsTrafficOnly. + * @param enableHttpsTrafficOnly Allows https traffic only to storage service if sets to true + * @return the next update stage + */ + Update withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly); + } + + /** + * The stage of the storageaccount update allowing to specify Encryption. + */ + interface WithEncryption { + /** + * Specifies encryption. + * @param encryption Provides the encryption settings on the account. The default setting is unencrypted + * @return the next update stage + */ + Update withEncryption(Encryption encryption); + } + + /** + * The stage of the storageaccount update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the resource + * @return the next update stage + */ + Update withIdentity(Identity identity); + } + + /** + * The stage of the storageaccount update allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + * @param kind Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + * @return the next update stage + */ + Update withKind(Kind kind); + } + + /** + * The stage of the storageaccount update allowing to specify NetworkRuleSet. + */ + interface WithNetworkRuleSet { + /** + * Specifies networkRuleSet. + * @param networkRuleSet Network rule set + * @return the next update stage + */ + Update withNetworkRuleSet(NetworkRuleSet networkRuleSet); + } + + /** + * The stage of the storageaccount update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku Gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other value + * @return the next update stage + */ + Update withSku(SkuInner sku); + } + + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountCheckNameAvailabilityParameters.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountCheckNameAvailabilityParameters.java new file mode 100644 index 000000000000..2b2af66e6ecd --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountCheckNameAvailabilityParameters.java @@ -0,0 +1,77 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters used to check the availability of the storage account name. + */ +public class StorageAccountCheckNameAvailabilityParameters { + /** + * The storage account name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The type of resource, Microsoft.Storage/storageAccounts. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of StorageAccountCheckNameAvailabilityParameters class. + * @param name the storage account name. + */ + public StorageAccountCheckNameAvailabilityParameters() { + type = "Microsoft.Storage/storageAccounts"; + } + + /** + * Get the storage account name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the storage account name. + * + * @param name the name value to set + * @return the StorageAccountCheckNameAvailabilityParameters object itself. + */ + public StorageAccountCheckNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of resource, Microsoft.Storage/storageAccounts. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of resource, Microsoft.Storage/storageAccounts. + * + * @param type the type value to set + * @return the StorageAccountCheckNameAvailabilityParameters object itself. + */ + public StorageAccountCheckNameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountCreateParameters.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountCreateParameters.java new file mode 100644 index 000000000000..a060c5dfec60 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountCreateParameters.java @@ -0,0 +1,350 @@ +/** + * 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.v2019_04_01; + +import com.microsoft.azure.management.storage.v2019_04_01.implementation.SkuInner; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used when creating a storage account. + */ +@JsonFlatten +public class StorageAccountCreateParameters { + /** + * Required. Gets or sets the SKU name. + */ + @JsonProperty(value = "sku", required = true) + private SkuInner sku; + + /** + * Required. Indicates the type of storage account. Possible values + * include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage'. + */ + @JsonProperty(value = "kind", required = true) + private Kind kind; + + /** + * Required. Gets or sets the location of the resource. This will be one of + * the supported and registered Azure Geo Regions (e.g. West US, East US, + * Southeast Asia, etc.). The geo region of a resource cannot be changed + * once it is created, but if an identical geo region is specified on + * update, the request will succeed. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Gets or sets a list of key value pairs that describe the resource. These + * tags can be used for viewing and grouping this resource (across resource + * groups). A maximum of 15 tags can be provided for a resource. Each tag + * must have a key with a length no greater than 128 characters and a value + * with a length no greater than 256 characters. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /** + * User domain assigned to the storage account. Name is the CNAME source. + * Only one custom domain is supported per storage account at this time. To + * clear the existing custom domain, use an empty string for the custom + * domain name property. + */ + @JsonProperty(value = "properties.customDomain") + private CustomDomain customDomain; + + /** + * Provides the encryption settings on the account. If left unspecified the + * account encryption settings will remain the same. The default setting is + * unencrypted. + */ + @JsonProperty(value = "properties.encryption") + private Encryption encryption; + + /** + * Network rule set. + */ + @JsonProperty(value = "properties.networkAcls") + private NetworkRuleSet networkRuleSet; + + /** + * Required for storage accounts where kind = BlobStorage. The access tier + * used for billing. Possible values include: 'Hot', 'Cool'. + */ + @JsonProperty(value = "properties.accessTier") + private AccessTier accessTier; + + /** + * Provides the identity based authentication settings for Azure Files. + */ + @JsonProperty(value = "properties.azureFilesIdentityBasedAuthentication") + private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; + + /** + * Allows https traffic only to storage service if sets to true. The + * default value is true since API version 2019-04-01. + */ + @JsonProperty(value = "properties.supportsHttpsTrafficOnly") + private Boolean enableHttpsTrafficOnly; + + /** + * Account HierarchicalNamespace enabled if sets to true. + */ + @JsonProperty(value = "properties.isHnsEnabled") + private Boolean isHnsEnabled; + + /** + * Get required. Gets or sets the SKU name. + * + * @return the sku value + */ + public SkuInner sku() { + return this.sku; + } + + /** + * Set required. Gets or sets the SKU name. + * + * @param sku the sku value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withSku(SkuInner sku) { + this.sku = sku; + return this; + } + + /** + * Get required. Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + * + * @return the kind value + */ + public Kind kind() { + return this.kind; + } + + /** + * Set required. Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + * + * @param kind the kind value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withKind(Kind kind) { + this.kind = kind; + return this; + } + + /** + * Get required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. + * + * @param location the location value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. + * + * @param tags the tags value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity of the resource. + * + * @return the identity value + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity of the resource. + * + * @param identity the identity value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get user domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. + * + * @return the customDomain value + */ + public CustomDomain customDomain() { + return this.customDomain; + } + + /** + * Set user domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. + * + * @param customDomain the customDomain value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withCustomDomain(CustomDomain customDomain) { + this.customDomain = customDomain; + return this; + } + + /** + * Get provides the encryption settings on the account. If left unspecified the account encryption settings will remain the same. The default setting is unencrypted. + * + * @return the encryption value + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Set provides the encryption settings on the account. If left unspecified the account encryption settings will remain the same. The default setting is unencrypted. + * + * @param encryption the encryption value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withEncryption(Encryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get network rule set. + * + * @return the networkRuleSet value + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Set network rule set. + * + * @param networkRuleSet the networkRuleSet value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + this.networkRuleSet = networkRuleSet; + return this; + } + + /** + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. + * + * @return the accessTier value + */ + public AccessTier accessTier() { + return this.accessTier; + } + + /** + * Set required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. + * + * @param accessTier the accessTier value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAccessTier(AccessTier accessTier) { + this.accessTier = accessTier; + return this; + } + + /** + * Get provides the identity based authentication settings for Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value + */ + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.azureFilesIdentityBasedAuthentication; + } + + /** + * Set provides the identity based authentication settings for Azure Files. + * + * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAzureFilesIdentityBasedAuthentication(AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + this.azureFilesIdentityBasedAuthentication = azureFilesIdentityBasedAuthentication; + return this; + } + + /** + * Get allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01. + * + * @return the enableHttpsTrafficOnly value + */ + public Boolean enableHttpsTrafficOnly() { + return this.enableHttpsTrafficOnly; + } + + /** + * Set allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; + return this; + } + + /** + * Get account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value + */ + public Boolean isHnsEnabled() { + return this.isHnsEnabled; + } + + /** + * Set account HierarchicalNamespace enabled if sets to true. + * + * @param isHnsEnabled the isHnsEnabled value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withIsHnsEnabled(Boolean isHnsEnabled) { + this.isHnsEnabled = isHnsEnabled; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountExpand.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountExpand.java new file mode 100644 index 000000000000..c6ff2ba3bffd --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountExpand.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StorageAccountExpand. + */ +public enum StorageAccountExpand { + /** Enum value geoReplicationStats. */ + GEO_REPLICATION_STATS("geoReplicationStats"); + + /** The actual serialized value for a StorageAccountExpand instance. */ + private String value; + + StorageAccountExpand(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StorageAccountExpand instance. + * + * @param value the serialized value to parse. + * @return the parsed StorageAccountExpand object, or null if unable to parse. + */ + @JsonCreator + public static StorageAccountExpand fromString(String value) { + StorageAccountExpand[] items = StorageAccountExpand.values(); + for (StorageAccountExpand item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountKey.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountKey.java new file mode 100644 index 000000000000..4607794e9b85 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountKey.java @@ -0,0 +1,63 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An access key for the storage account. + */ +public class StorageAccountKey { + /** + * Name of the key. + */ + @JsonProperty(value = "keyName", access = JsonProperty.Access.WRITE_ONLY) + private String keyName; + + /** + * Base 64-encoded value of the key. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Permissions for the key -- read-only or full permissions. Possible + * values include: 'Read', 'Full'. + */ + @JsonProperty(value = "permissions", access = JsonProperty.Access.WRITE_ONLY) + private KeyPermission permissions; + + /** + * Get name of the key. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Get base 64-encoded value of the key. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Get permissions for the key -- read-only or full permissions. Possible values include: 'Read', 'Full'. + * + * @return the permissions value + */ + public KeyPermission permissions() { + return this.permissions; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountListKeysResult.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountListKeysResult.java new file mode 100644 index 000000000000..c8ed93da6c61 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountListKeysResult.java @@ -0,0 +1,26 @@ +/** + * 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.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.StorageAccountListKeysResultInner; +import java.util.List; + +/** + * Type representing StorageAccountListKeysResult. + */ +public interface StorageAccountListKeysResult extends HasInner, HasManager { + /** + * @return the keys value. + */ + List keys(); + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountRegenerateKeyParameters.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountRegenerateKeyParameters.java new file mode 100644 index 000000000000..502d03a48816 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountRegenerateKeyParameters.java @@ -0,0 +1,44 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters used to regenerate the storage account key. + */ +public class StorageAccountRegenerateKeyParameters { + /** + * The name of storage keys that want to be regenerated, possible values + * are key1, key2. + */ + @JsonProperty(value = "keyName", required = true) + private String keyName; + + /** + * Get the name of storage keys that want to be regenerated, possible values are key1, key2. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the name of storage keys that want to be regenerated, possible values are key1, key2. + * + * @param keyName the keyName value to set + * @return the StorageAccountRegenerateKeyParameters object itself. + */ + public StorageAccountRegenerateKeyParameters withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountUpdateParameters.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountUpdateParameters.java new file mode 100644 index 000000000000..14180711401f --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountUpdateParameters.java @@ -0,0 +1,295 @@ +/** + * 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.v2019_04_01; + +import com.microsoft.azure.management.storage.v2019_04_01.implementation.SkuInner; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters that can be provided when updating the storage account + * properties. + */ +@JsonFlatten +public class StorageAccountUpdateParameters { + /** + * Gets or sets the SKU name. Note that the SKU name cannot be updated to + * Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU + * names be updated to any other value. + */ + @JsonProperty(value = "sku") + private SkuInner sku; + + /** + * Gets or sets a list of key value pairs that describe the resource. These + * tags can be used in viewing and grouping this resource (across resource + * groups). A maximum of 15 tags can be provided for a resource. Each tag + * must have a key no greater in length than 128 characters and a value no + * greater in length than 256 characters. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /** + * Custom domain assigned to the storage account by the user. Name is the + * CNAME source. Only one custom domain is supported per storage account at + * this time. To clear the existing custom domain, use an empty string for + * the custom domain name property. + */ + @JsonProperty(value = "properties.customDomain") + private CustomDomain customDomain; + + /** + * Provides the encryption settings on the account. The default setting is + * unencrypted. + */ + @JsonProperty(value = "properties.encryption") + private Encryption encryption; + + /** + * Required for storage accounts where kind = BlobStorage. The access tier + * used for billing. Possible values include: 'Hot', 'Cool'. + */ + @JsonProperty(value = "properties.accessTier") + private AccessTier accessTier; + + /** + * Provides the identity based authentication settings for Azure Files. + */ + @JsonProperty(value = "properties.azureFilesIdentityBasedAuthentication") + private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; + + /** + * Allows https traffic only to storage service if sets to true. + */ + @JsonProperty(value = "properties.supportsHttpsTrafficOnly") + private Boolean enableHttpsTrafficOnly; + + /** + * Network rule set. + */ + @JsonProperty(value = "properties.networkAcls") + private NetworkRuleSet networkRuleSet; + + /** + * Optional. Indicates the type of storage account. Currently only + * StorageV2 value supported by server. Possible values include: 'Storage', + * 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + */ + @JsonProperty(value = "kind") + private Kind kind; + + /** + * Get gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other value. + * + * @return the sku value + */ + public SkuInner sku() { + return this.sku; + } + + /** + * Set gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other value. + * + * @param sku the sku value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withSku(SkuInner sku) { + this.sku = sku; + return this; + } + + /** + * Get gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. + * + * @param tags the tags value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity of the resource. + * + * @return the identity value + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity of the resource. + * + * @param identity the identity value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. + * + * @return the customDomain value + */ + public CustomDomain customDomain() { + return this.customDomain; + } + + /** + * Set custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. + * + * @param customDomain the customDomain value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withCustomDomain(CustomDomain customDomain) { + this.customDomain = customDomain; + return this; + } + + /** + * Get provides the encryption settings on the account. The default setting is unencrypted. + * + * @return the encryption value + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Set provides the encryption settings on the account. The default setting is unencrypted. + * + * @param encryption the encryption value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withEncryption(Encryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. + * + * @return the accessTier value + */ + public AccessTier accessTier() { + return this.accessTier; + } + + /** + * Set required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. + * + * @param accessTier the accessTier value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAccessTier(AccessTier accessTier) { + this.accessTier = accessTier; + return this; + } + + /** + * Get provides the identity based authentication settings for Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value + */ + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.azureFilesIdentityBasedAuthentication; + } + + /** + * Set provides the identity based authentication settings for Azure Files. + * + * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAzureFilesIdentityBasedAuthentication(AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + this.azureFilesIdentityBasedAuthentication = azureFilesIdentityBasedAuthentication; + return this; + } + + /** + * Get allows https traffic only to storage service if sets to true. + * + * @return the enableHttpsTrafficOnly value + */ + public Boolean enableHttpsTrafficOnly() { + return this.enableHttpsTrafficOnly; + } + + /** + * Set allows https traffic only to storage service if sets to true. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; + return this; + } + + /** + * Get network rule set. + * + * @return the networkRuleSet value + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Set network rule set. + * + * @param networkRuleSet the networkRuleSet value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + this.networkRuleSet = networkRuleSet; + return this; + } + + /** + * Get optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + * + * @return the kind value + */ + public Kind kind() { + return this.kind; + } + + /** + * Set optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + * + * @param kind the kind value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withKind(Kind kind) { + this.kind = kind; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccounts.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccounts.java new file mode 100644 index 000000000000..a460ead84461 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccounts.java @@ -0,0 +1,98 @@ +/** + * 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.v2019_04_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.StorageAccountsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StorageAccounts. + */ +public interface StorageAccounts extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Lists the access keys for 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 listKeysAsync(String resourceGroupName, String accountName); + + /** + * Regenerates one of the access keys for 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 keyName The name of storage keys that want to be regenerated, possible values are key1, key2. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeyAsync(String resourceGroupName, String accountName, String keyName); + + /** + * List SAS credentials of a 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 parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAccountSASAsync(String resourceGroupName, String accountName, AccountSasParameters parameters); + + /** + * List service SAS credentials of a specific resource. + * + * @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 parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listServiceSASAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters); + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @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 failoverAsync(String resourceGroupName, String accountName); + + /** + * Revoke user delegation keys. + * + * @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 revokeUserDelegationKeysAsync(String resourceGroupName, String accountName); + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param name The storage account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String name); + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/TagProperty.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/TagProperty.java new file mode 100644 index 000000000000..5542ad6a255e --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/TagProperty.java @@ -0,0 +1,94 @@ +/** + * 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.v2019_04_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A tag of the LegalHold of a blob container. + */ +public class TagProperty { + /** + * The tag value. + */ + @JsonProperty(value = "tag", access = JsonProperty.Access.WRITE_ONLY) + private String tag; + + /** + * Returns the date and time the tag was added. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime timestamp; + + /** + * Returns the Object ID of the user who added the tag. + */ + @JsonProperty(value = "objectIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String objectIdentifier; + + /** + * Returns the Tenant ID that issued the token for the user who added the + * tag. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * Returns the User Principal Name of the user who added the tag. + */ + @JsonProperty(value = "upn", access = JsonProperty.Access.WRITE_ONLY) + private String upn; + + /** + * Get the tag value. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Get returns the date and time the tag was added. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + + /** + * Get returns the Object ID of the user who added the tag. + * + * @return the objectIdentifier value + */ + public String objectIdentifier() { + return this.objectIdentifier; + } + + /** + * Get returns the Tenant ID that issued the token for the user who added the tag. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get returns the User Principal Name of the user who added the tag. + * + * @return the upn value + */ + public String upn() { + return this.upn; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/UpdateHistoryProperty.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/UpdateHistoryProperty.java new file mode 100644 index 000000000000..eb6006c3952d --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/UpdateHistoryProperty.java @@ -0,0 +1,113 @@ +/** + * 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.v2019_04_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An update history of the ImmutabilityPolicy of a blob container. + */ +public class UpdateHistoryProperty { + /** + * The ImmutabilityPolicy update type of a blob container, possible values + * include: put, lock and extend. Possible values include: 'put', 'lock', + * 'extend'. + */ + @JsonProperty(value = "update", access = JsonProperty.Access.WRITE_ONLY) + private ImmutabilityPolicyUpdateType update; + + /** + * The immutability period for the blobs in the container since the policy + * creation, in days. + */ + @JsonProperty(value = "immutabilityPeriodSinceCreationInDays", access = JsonProperty.Access.WRITE_ONLY) + private Integer immutabilityPeriodSinceCreationInDays; + + /** + * Returns the date and time the ImmutabilityPolicy was updated. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime timestamp; + + /** + * Returns the Object ID of the user who updated the ImmutabilityPolicy. + */ + @JsonProperty(value = "objectIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String objectIdentifier; + + /** + * Returns the Tenant ID that issued the token for the user who updated the + * ImmutabilityPolicy. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * Returns the User Principal Name of the user who updated the + * ImmutabilityPolicy. + */ + @JsonProperty(value = "upn", access = JsonProperty.Access.WRITE_ONLY) + private String upn; + + /** + * Get the ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend. Possible values include: 'put', 'lock', 'extend'. + * + * @return the update value + */ + public ImmutabilityPolicyUpdateType update() { + return this.update; + } + + /** + * Get the immutability period for the blobs in the container since the policy creation, in days. + * + * @return the immutabilityPeriodSinceCreationInDays value + */ + public Integer immutabilityPeriodSinceCreationInDays() { + return this.immutabilityPeriodSinceCreationInDays; + } + + /** + * Get returns the date and time the ImmutabilityPolicy was updated. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + + /** + * Get returns the Object ID of the user who updated the ImmutabilityPolicy. + * + * @return the objectIdentifier value + */ + public String objectIdentifier() { + return this.objectIdentifier; + } + + /** + * Get returns the Tenant ID that issued the token for the user who updated the ImmutabilityPolicy. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get returns the User Principal Name of the user who updated the ImmutabilityPolicy. + * + * @return the upn value + */ + public String upn() { + return this.upn; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Usage.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Usage.java new file mode 100644 index 000000000000..b2230a0ace1a --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Usage.java @@ -0,0 +1,40 @@ +/** + * 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.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.UsageInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.StorageManager; + +/** + * Type representing Usage. + */ +public interface Usage extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Integer currentValue(); + + /** + * @return the limit value. + */ + Integer limit(); + + /** + * @return the name value. + */ + UsageName name(); + + /** + * @return the unit value. + */ + UsageUnit unit(); + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/UsageName.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/UsageName.java new file mode 100644 index 000000000000..c27cfae92b04 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/UsageName.java @@ -0,0 +1,47 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The usage names that can be used; currently limited to StorageAccount. + */ +public class UsageName { + /** + * Gets a string describing the resource name. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Gets a localized string describing the resource name. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /** + * Get gets a string describing the resource name. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Get gets a localized string describing the resource name. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/UsageUnit.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/UsageUnit.java new file mode 100644 index 000000000000..f582a2360a2e --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/UsageUnit.java @@ -0,0 +1,65 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for UsageUnit. + */ +public enum UsageUnit { + /** Enum value Count. */ + COUNT("Count"), + + /** Enum value Bytes. */ + BYTES("Bytes"), + + /** Enum value Seconds. */ + SECONDS("Seconds"), + + /** Enum value Percent. */ + PERCENT("Percent"), + + /** Enum value CountsPerSecond. */ + COUNTS_PER_SECOND("CountsPerSecond"), + + /** Enum value BytesPerSecond. */ + BYTES_PER_SECOND("BytesPerSecond"); + + /** The actual serialized value for a UsageUnit instance. */ + private String value; + + UsageUnit(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a UsageUnit instance. + * + * @param value the serialized value to parse. + * @return the parsed UsageUnit object, or null if unable to parse. + */ + @JsonCreator + public static UsageUnit fromString(String value) { + UsageUnit[] items = UsageUnit.values(); + for (UsageUnit item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Usages.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Usages.java new file mode 100644 index 000000000000..2e183af192cb --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/Usages.java @@ -0,0 +1,28 @@ +/** + * 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.v2019_04_01; + +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_04_01.implementation.UsagesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Usages. + */ +public interface Usages extends HasInner { + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByLocationAsync(String location); + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/VirtualNetworkRule.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/VirtualNetworkRule.java new file mode 100644 index 000000000000..1e0221cd9980 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/VirtualNetworkRule.java @@ -0,0 +1,98 @@ +/** + * 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.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Virtual Network rule. + */ +public class VirtualNetworkRule { + /** + * Resource ID of a subnet, for example: + * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + */ + @JsonProperty(value = "id", required = true) + private String virtualNetworkResourceId; + + /** + * The action of virtual network rule. Possible values include: 'Allow'. + */ + @JsonProperty(value = "action") + private Action action; + + /** + * Gets the state of virtual network rule. Possible values include: + * 'provisioning', 'deprovisioning', 'succeeded', 'failed', + * 'networkSourceDeleted'. + */ + @JsonProperty(value = "state") + private State state; + + /** + * Get resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + * + * @return the virtualNetworkResourceId value + */ + public String virtualNetworkResourceId() { + return this.virtualNetworkResourceId; + } + + /** + * Set resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + * + * @param virtualNetworkResourceId the virtualNetworkResourceId value to set + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withVirtualNetworkResourceId(String virtualNetworkResourceId) { + this.virtualNetworkResourceId = virtualNetworkResourceId; + return this; + } + + /** + * Get the action of virtual network rule. Possible values include: 'Allow'. + * + * @return the action value + */ + public Action action() { + return this.action; + } + + /** + * Set the action of virtual network rule. Possible values include: 'Allow'. + * + * @param action the action value to set + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withAction(Action action) { + this.action = action; + return this; + } + + /** + * Get gets the state of virtual network rule. Possible values include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', 'networkSourceDeleted'. + * + * @return the state value + */ + public State state() { + return this.state; + } + + /** + * Set gets the state of virtual network rule. Possible values include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', 'networkSourceDeleted'. + * + * @param state the state value to set + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withState(State state) { + this.state = state; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobContainerImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobContainerImpl.java new file mode 100644 index 000000000000..fe925cd2e7e5 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobContainerImpl.java @@ -0,0 +1,181 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.BlobContainer; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_04_01.PublicAccess; +import java.util.Map; +import com.microsoft.azure.management.storage.v2019_04_01.ImmutabilityPolicyProperties; +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_04_01.LeaseDuration; +import com.microsoft.azure.management.storage.v2019_04_01.LeaseState; +import com.microsoft.azure.management.storage.v2019_04_01.LeaseStatus; +import com.microsoft.azure.management.storage.v2019_04_01.LegalHoldProperties; + +class BlobContainerImpl extends CreatableUpdatableImpl implements BlobContainer, BlobContainer.Definition, BlobContainer.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private String containerName; + private PublicAccess cpublicAccess; + private Map cmetadata; + private PublicAccess upublicAccess; + private Map umetadata; + + BlobContainerImpl(String name, StorageManager manager) { + super(name, new BlobContainerInner()); + this.manager = manager; + // Set resource name + this.containerName = name; + // + } + + BlobContainerImpl(BlobContainerInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.containerName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + this.containerName = IdParsingUtils.getValueFromIdByName(inner.id(), "containers"); + // + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + BlobContainersInner client = this.manager().inner().blobContainers(); + return client.createAsync(this.resourceGroupName, this.accountName, this.containerName, this.cpublicAccess, this.cmetadata) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + BlobContainersInner client = this.manager().inner().blobContainers(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.containerName, this.upublicAccess, this.umetadata) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + BlobContainersInner client = this.manager().inner().blobContainers(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Boolean hasImmutabilityPolicy() { + return this.inner().hasImmutabilityPolicy(); + } + + @Override + public Boolean hasLegalHold() { + return this.inner().hasLegalHold(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public ImmutabilityPolicyProperties immutabilityPolicy() { + return this.inner().immutabilityPolicy(); + } + + @Override + public DateTime lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public LeaseDuration leaseDuration() { + return this.inner().leaseDuration(); + } + + @Override + public LeaseState leaseState() { + return this.inner().leaseState(); + } + + @Override + public LeaseStatus leaseStatus() { + return this.inner().leaseStatus(); + } + + @Override + public LegalHoldProperties legalHold() { + return this.inner().legalHold(); + } + + @Override + public Map metadata() { + return this.inner().metadata(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PublicAccess publicAccess() { + return this.inner().publicAccess(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public BlobContainerImpl withExistingBlobService(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public BlobContainerImpl withPublicAccess(PublicAccess publicAccess) { + if (isInCreateMode()) { + this.cpublicAccess = publicAccess; + } else { + this.upublicAccess = publicAccess; + } + return this; + } + + @Override + public BlobContainerImpl withMetadata(Map metadata) { + if (isInCreateMode()) { + this.cmetadata = metadata; + } else { + this.umetadata = metadata; + } + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobContainerInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobContainerInner.java new file mode 100644 index 000000000000..12b31264ee8d --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobContainerInner.java @@ -0,0 +1,213 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.PublicAccess; +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_04_01.LeaseStatus; +import com.microsoft.azure.management.storage.v2019_04_01.LeaseState; +import com.microsoft.azure.management.storage.v2019_04_01.LeaseDuration; +import java.util.Map; +import com.microsoft.azure.management.storage.v2019_04_01.ImmutabilityPolicyProperties; +import com.microsoft.azure.management.storage.v2019_04_01.LegalHoldProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.storage.v2019_04_01.AzureEntityResource; + +/** + * Properties of the blob container, including Id, resource name, resource + * type, Etag. + */ +@JsonFlatten +public class BlobContainerInner extends AzureEntityResource { + /** + * Specifies whether data in the container may be accessed publicly and the + * level of access. Possible values include: 'Container', 'Blob', 'None'. + */ + @JsonProperty(value = "properties.publicAccess") + private PublicAccess publicAccess; + + /** + * Returns the date and time the container was last modified. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * The lease status of the container. Possible values include: 'Locked', + * 'Unlocked'. + */ + @JsonProperty(value = "properties.leaseStatus", access = JsonProperty.Access.WRITE_ONLY) + private LeaseStatus leaseStatus; + + /** + * Lease state of the container. Possible values include: 'Available', + * 'Leased', 'Expired', 'Breaking', 'Broken'. + */ + @JsonProperty(value = "properties.leaseState", access = JsonProperty.Access.WRITE_ONLY) + private LeaseState leaseState; + + /** + * Specifies whether the lease on a container is of infinite or fixed + * duration, only when the container is leased. Possible values include: + * 'Infinite', 'Fixed'. + */ + @JsonProperty(value = "properties.leaseDuration", access = JsonProperty.Access.WRITE_ONLY) + private LeaseDuration leaseDuration; + + /** + * A name-value pair to associate with the container as metadata. + */ + @JsonProperty(value = "properties.metadata") + private Map metadata; + + /** + * The ImmutabilityPolicy property of the container. + */ + @JsonProperty(value = "properties.immutabilityPolicy", access = JsonProperty.Access.WRITE_ONLY) + private ImmutabilityPolicyProperties immutabilityPolicy; + + /** + * The LegalHold property of the container. + */ + @JsonProperty(value = "properties.legalHold", access = JsonProperty.Access.WRITE_ONLY) + private LegalHoldProperties legalHold; + + /** + * The hasLegalHold public property is set to true by SRP if there are at + * least one existing tag. The hasLegalHold public property is set to false + * by SRP if all existing legal hold tags are cleared out. There can be a + * maximum of 1000 blob containers with hasLegalHold=true for a given + * account. + */ + @JsonProperty(value = "properties.hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasLegalHold; + + /** + * The hasImmutabilityPolicy public property is set to true by SRP if + * ImmutabilityPolicy has been created for this container. The + * hasImmutabilityPolicy public property is set to false by SRP if + * ImmutabilityPolicy has not been created for this container. + */ + @JsonProperty(value = "properties.hasImmutabilityPolicy", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasImmutabilityPolicy; + + /** + * Get specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None'. + * + * @return the publicAccess value + */ + public PublicAccess publicAccess() { + return this.publicAccess; + } + + /** + * Set specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None'. + * + * @param publicAccess the publicAccess value to set + * @return the BlobContainerInner object itself. + */ + public BlobContainerInner withPublicAccess(PublicAccess publicAccess) { + this.publicAccess = publicAccess; + return this; + } + + /** + * Get returns the date and time the container was last modified. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the lease status of the container. Possible values include: 'Locked', 'Unlocked'. + * + * @return the leaseStatus value + */ + public LeaseStatus leaseStatus() { + return this.leaseStatus; + } + + /** + * Get lease state of the container. Possible values include: 'Available', 'Leased', 'Expired', 'Breaking', 'Broken'. + * + * @return the leaseState value + */ + public LeaseState leaseState() { + return this.leaseState; + } + + /** + * Get specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. Possible values include: 'Infinite', 'Fixed'. + * + * @return the leaseDuration value + */ + public LeaseDuration leaseDuration() { + return this.leaseDuration; + } + + /** + * Get a name-value pair to associate with the container as metadata. + * + * @return the metadata value + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set a name-value pair to associate with the container as metadata. + * + * @param metadata the metadata value to set + * @return the BlobContainerInner object itself. + */ + public BlobContainerInner withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the ImmutabilityPolicy property of the container. + * + * @return the immutabilityPolicy value + */ + public ImmutabilityPolicyProperties immutabilityPolicy() { + return this.immutabilityPolicy; + } + + /** + * Get the LegalHold property of the container. + * + * @return the legalHold value + */ + public LegalHoldProperties legalHold() { + return this.legalHold; + } + + /** + * Get the hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. + * + * @return the hasLegalHold value + */ + public Boolean hasLegalHold() { + return this.hasLegalHold; + } + + /** + * Get the hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container. + * + * @return the hasImmutabilityPolicy value + */ + public Boolean hasImmutabilityPolicy() { + return this.hasImmutabilityPolicy; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobContainersImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobContainersImpl.java new file mode 100644 index 000000000000..bdc7bae3606d --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobContainersImpl.java @@ -0,0 +1,185 @@ +/** + * 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. + * abc + */ + +package com.microsoft.azure.management.storage.v2019_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_04_01.BlobContainers; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.storage.v2019_04_01.ListContainerItem; +import com.microsoft.azure.management.storage.v2019_04_01.BlobContainer; +import com.microsoft.azure.management.storage.v2019_04_01.LegalHold; +import com.microsoft.azure.management.storage.v2019_04_01.LeaseContainerResponse; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_04_01.ImmutabilityPolicy; + +class BlobContainersImpl extends WrapperImpl implements BlobContainers { + private final StorageManager manager; + + BlobContainersImpl(StorageManager manager) { + super(manager.inner().blobContainers()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public BlobContainerImpl defineContainer(String name) { + return wrapContainerModel(name); + } + + @Override + public ImmutabilityPolicyImpl defineImmutabilityPolicy(String name) { + return wrapImmutabilityPolicyModel(name); + } + + private BlobContainerImpl wrapContainerModel(String name) { + return new BlobContainerImpl(name, this.manager()); + } + + private ImmutabilityPolicyImpl wrapImmutabilityPolicyModel(String name) { + return new ImmutabilityPolicyImpl(name, this.manager()); + } + + private BlobContainerImpl wrapBlobContainerModel(BlobContainerInner inner) { + return new BlobContainerImpl(inner, manager()); + } + + private ImmutabilityPolicyImpl wrapImmutabilityPolicyModel(ImmutabilityPolicyInner inner) { + return new ImmutabilityPolicyImpl(inner, manager()); + } + + private Observable getImmutabilityPolicyInnerUsingBlobContainersInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String accountName = IdParsingUtils.getValueFromIdByName(id, "storageAccounts"); + String containerName = IdParsingUtils.getValueFromIdByName(id, "containers"); + BlobContainersInner client = this.inner(); + return client.getImmutabilityPolicyAsync(resourceGroupName, accountName, containerName); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + BlobContainersInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ListContainerItem call(ListContainerItemInner inner) { + return new ListContainerItemImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String containerName) { + BlobContainersInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, containerName) + .map(new Func1() { + @Override + public BlobContainer call(BlobContainerInner inner) { + return new BlobContainerImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String containerName) { + BlobContainersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, containerName).toCompletable(); + } + + @Override + public Observable setLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags) { + BlobContainersInner client = this.inner(); + return client.setLegalHoldAsync(resourceGroupName, accountName, containerName, tags) + .map(new Func1() { + @Override + public LegalHold call(LegalHoldInner inner) { + return new LegalHoldImpl(inner, manager()); + } + }); + } + + @Override + public Observable clearLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags) { + BlobContainersInner client = this.inner(); + return client.clearLegalHoldAsync(resourceGroupName, accountName, containerName, tags) + .map(new Func1() { + @Override + public LegalHold call(LegalHoldInner inner) { + return new LegalHoldImpl(inner, manager()); + } + }); + } + + @Override + public Observable leaseAsync(String resourceGroupName, String accountName, String containerName) { + BlobContainersInner client = this.inner(); + return client.leaseAsync(resourceGroupName, accountName, containerName) + .map(new Func1() { + @Override + public LeaseContainerResponse call(LeaseContainerResponseInner inner) { + return new LeaseContainerResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable getImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName) { + BlobContainersInner client = this.inner(); + return client.getImmutabilityPolicyAsync(resourceGroupName, accountName, containerName) + .map(new Func1() { + @Override + public ImmutabilityPolicy call(ImmutabilityPolicyInner inner) { + return wrapImmutabilityPolicyModel(inner); + } + }); + } + + @Override + public Completable deleteImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch) { + BlobContainersInner client = this.inner(); + return client.deleteImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch).toCompletable(); + } + + @Override + public Observable lockImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch) { + BlobContainersInner client = this.inner(); + return client.lockImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch) + .map(new Func1() { + @Override + public ImmutabilityPolicy call(ImmutabilityPolicyInner inner) { + return new ImmutabilityPolicyImpl(inner, manager()); + } + }); + } + + @Override + public Observable extendImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch, int immutabilityPeriodSinceCreationInDays) { + BlobContainersInner client = this.inner(); + return client.extendImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays) + .map(new Func1() { + @Override + public ImmutabilityPolicy call(ImmutabilityPolicyInner inner) { + return new ImmutabilityPolicyImpl(inner, manager()); + } + }); + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobContainersInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobContainersInner.java new file mode 100644 index 000000000000..b527290a0e2e --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobContainersInner.java @@ -0,0 +1,2162 @@ +/** + * 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.v2019_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.storage.v2019_04_01.BlobContainersCreateOrUpdateImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.v2019_04_01.BlobContainersDeleteImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.v2019_04_01.BlobContainersExtendImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.v2019_04_01.BlobContainersGetImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.v2019_04_01.BlobContainersLockImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.v2019_04_01.LeaseContainerRequest; +import com.microsoft.azure.management.storage.v2019_04_01.PublicAccess; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +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.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BlobContainers. + */ +public class BlobContainersInner { + /** The Retrofit service to perform REST calls. */ + private BlobContainersService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of BlobContainersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BlobContainersInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(BlobContainersService.class); + this.client = client; + } + + /** + * The interface defining all the services for BlobContainers to be + * used by Retrofit to perform actually REST calls. + */ + interface BlobContainersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.BlobContainers list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$skipToken") String skipToken, @Query("$maxpagesize") String maxpagesize, @Query("$filter") String filter, @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.v2019_04_01.BlobContainers create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BlobContainerInner blobContainer, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.BlobContainers update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BlobContainerInner blobContainer, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.BlobContainers get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.BlobContainers delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.BlobContainers setLegalHold" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold") + Observable> setLegalHold(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LegalHoldInner legalHold, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.BlobContainers clearLegalHold" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold") + Observable> clearLegalHold(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LegalHoldInner legalHold, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.BlobContainers createOrUpdateImmutabilityPolicy" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}") + Observable> createOrUpdateImmutabilityPolicy(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("immutabilityPolicyName") String immutabilityPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Header("accept-language") String acceptLanguage, @Body ImmutabilityPolicyInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.BlobContainers getImmutabilityPolicy" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}") + Observable> getImmutabilityPolicy(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("immutabilityPolicyName") String immutabilityPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @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.v2019_04_01.BlobContainers deleteImmutabilityPolicy" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}", method = "DELETE", hasBody = true) + Observable> deleteImmutabilityPolicy(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("immutabilityPolicyName") String immutabilityPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @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.v2019_04_01.BlobContainers lockImmutabilityPolicy" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock") + Observable> lockImmutabilityPolicy(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @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.v2019_04_01.BlobContainers extendImmutabilityPolicy" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend") + Observable> extendImmutabilityPolicy(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Header("accept-language") String acceptLanguage, @Body ImmutabilityPolicyInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.BlobContainers lease" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease") + Observable> lease(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body LeaseContainerRequest 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.v2019_04_01.BlobContainers listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @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 PagedList<ListContainerItemInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @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> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @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 PagedList<ListContainerItemInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @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 PagedList<ListContainerItemInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @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 PagedList<ListContainerItemInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String skipToken = null; + final String maxpagesize = null; + final String filter = null; + return service.list(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), skipToken, maxpagesize, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @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 skipToken Optional. Continuation token for the list operation. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @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 PagedList<ListContainerItemInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String skipToken, final String maxpagesize, final String filter) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, skipToken, maxpagesize, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @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 skipToken Optional. Continuation token for the list operation. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @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> listAsync(final String resourceGroupName, final String accountName, final String skipToken, final String maxpagesize, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, skipToken, maxpagesize, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @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 skipToken Optional. Continuation token for the list operation. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ListContainerItemInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String skipToken, final String maxpagesize, final String filter) { + return listWithServiceResponseAsync(resourceGroupName, accountName, skipToken, maxpagesize, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @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 skipToken Optional. Continuation token for the list operation. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ListContainerItemInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String skipToken, final String maxpagesize, final String filter) { + return listSinglePageAsync(resourceGroupName, accountName, skipToken, maxpagesize, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + ServiceResponse> * @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. + ServiceResponse> * @param skipToken Optional. Continuation token for the list operation. + ServiceResponse> * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + ServiceResponse> * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ListContainerItemInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String skipToken, final String maxpagesize, final String filter) { + 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 (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(), skipToken, maxpagesize, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @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 BlobContainerInner object if successful. + */ + public BlobContainerInner create(String resourceGroupName, String accountName, String containerName) { + return createWithServiceResponseAsync(resourceGroupName, accountName, containerName).toBlocking().single().body(); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @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 createAsync(String resourceGroupName, String accountName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, containerName), serviceCallback); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String containerName) { + return createWithServiceResponseAsync(resourceGroupName, accountName, containerName).map(new Func1, BlobContainerInner>() { + @Override + public BlobContainerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @param metadata A name-value pair to associate with the container as metadata. + * @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 BlobContainerInner object if successful. + */ + public BlobContainerInner create(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map metadata) { + return createWithServiceResponseAsync(resourceGroupName, accountName, containerName, publicAccess, metadata).toBlocking().single().body(); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @param metadata A name-value pair to associate with the container as metadata. + * @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 createAsync(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map metadata, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, containerName, publicAccess, metadata), serviceCallback); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @param metadata A name-value pair to associate with the container as metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map metadata) { + return createWithServiceResponseAsync(resourceGroupName, accountName, containerName, publicAccess, metadata).map(new Func1, BlobContainerInner>() { + @Override + public BlobContainerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @param metadata A name-value pair to associate with the container as metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map metadata) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(metadata); + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @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 BlobContainerInner object if successful. + */ + public BlobContainerInner update(String resourceGroupName, String accountName, String containerName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, containerName).toBlocking().single().body(); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, containerName), serviceCallback); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String containerName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, containerName).map(new Func1, BlobContainerInner>() { + @Override + public BlobContainerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @param metadata A name-value pair to associate with the container as metadata. + * @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 BlobContainerInner object if successful. + */ + public BlobContainerInner update(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map metadata) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, containerName, publicAccess, metadata).toBlocking().single().body(); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @param metadata A name-value pair to associate with the container as metadata. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map metadata, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, containerName, publicAccess, metadata), serviceCallback); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @param metadata A name-value pair to associate with the container as metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map metadata) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, containerName, publicAccess, metadata).map(new Func1, BlobContainerInner>() { + @Override + public BlobContainerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @param metadata A name-value pair to associate with the container as metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map metadata) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(metadata); + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(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 properties of a specified container. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @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 BlobContainerInner object if successful. + */ + public BlobContainerInner get(String resourceGroupName, String accountName, String containerName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, containerName).toBlocking().single().body(); + } + + /** + * Gets properties of a specified container. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @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, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, containerName), serviceCallback); + } + + /** + * Gets properties of a specified container. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String containerName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, containerName).map(new Func1, BlobContainerInner>() { + @Override + public BlobContainerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets properties of a specified container. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (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()) + .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); + } + + /** + * Deletes specified container under its 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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @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, String containerName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, containerName).toBlocking().single().body(); + } + + /** + * Deletes specified container under its 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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @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, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, containerName), serviceCallback); + } + + /** + * Deletes specified container under its 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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String containerName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, containerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes specified container under its 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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (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()) + .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); + } + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @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 LegalHoldInner object if successful. + */ + public LegalHoldInner setLegalHold(String resourceGroupName, String accountName, String containerName, List tags) { + return setLegalHoldWithServiceResponseAsync(resourceGroupName, accountName, containerName, tags).toBlocking().single().body(); + } + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @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 setLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setLegalHoldWithServiceResponseAsync(resourceGroupName, accountName, containerName, tags), serviceCallback); + } + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LegalHoldInner object + */ + public Observable setLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags) { + return setLegalHoldWithServiceResponseAsync(resourceGroupName, accountName, containerName, tags).map(new Func1, LegalHoldInner>() { + @Override + public LegalHoldInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LegalHoldInner object + */ + public Observable> setLegalHoldWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, List tags) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (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); + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setLegalHoldDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse setLegalHoldDelegate(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); + } + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @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 LegalHoldInner object if successful. + */ + public LegalHoldInner clearLegalHold(String resourceGroupName, String accountName, String containerName, List tags) { + return clearLegalHoldWithServiceResponseAsync(resourceGroupName, accountName, containerName, tags).toBlocking().single().body(); + } + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @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 clearLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(clearLegalHoldWithServiceResponseAsync(resourceGroupName, accountName, containerName, tags), serviceCallback); + } + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LegalHoldInner object + */ + public Observable clearLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags) { + return clearLegalHoldWithServiceResponseAsync(resourceGroupName, accountName, containerName, tags).map(new Func1, LegalHoldInner>() { + @Override + public LegalHoldInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LegalHoldInner object + */ + public Observable> clearLegalHoldWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, List tags) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (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); + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = clearLegalHoldDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse clearLegalHoldDelegate(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); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @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 ImmutabilityPolicyInner object if successful. + */ + public ImmutabilityPolicyInner createOrUpdateImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, int immutabilityPeriodSinceCreationInDays) { + return createOrUpdateImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, immutabilityPeriodSinceCreationInDays).toBlocking().single().body(); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @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 createOrUpdateImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, int immutabilityPeriodSinceCreationInDays, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createOrUpdateImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, immutabilityPeriodSinceCreationInDays), serviceCallback); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable createOrUpdateImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, int immutabilityPeriodSinceCreationInDays) { + return createOrUpdateImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, immutabilityPeriodSinceCreationInDays).map(new Func1, ImmutabilityPolicyInner>() { + @Override + public ImmutabilityPolicyInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable> createOrUpdateImmutabilityPolicyWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, int immutabilityPeriodSinceCreationInDays) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String immutabilityPolicyName = "default"; + final String ifMatch = null; + ImmutabilityPolicyInner parameters = new ImmutabilityPolicyInner(); + parameters.withImmutabilityPeriodSinceCreationInDays(immutabilityPeriodSinceCreationInDays); + return service.createOrUpdateImmutabilityPolicy(resourceGroupName, accountName, containerName, immutabilityPolicyName, this.client.subscriptionId(), this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = createOrUpdateImmutabilityPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @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 ImmutabilityPolicyInner object if successful. + */ + public ImmutabilityPolicyInner createOrUpdateImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, int immutabilityPeriodSinceCreationInDays, String ifMatch) { + return createOrUpdateImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, immutabilityPeriodSinceCreationInDays, ifMatch).toBlocking().single().body(); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @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 createOrUpdateImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, int immutabilityPeriodSinceCreationInDays, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createOrUpdateImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, immutabilityPeriodSinceCreationInDays, ifMatch), serviceCallback); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable createOrUpdateImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, int immutabilityPeriodSinceCreationInDays, String ifMatch) { + return createOrUpdateImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, immutabilityPeriodSinceCreationInDays, ifMatch).map(new Func1, ImmutabilityPolicyInner>() { + @Override + public ImmutabilityPolicyInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable> createOrUpdateImmutabilityPolicyWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, int immutabilityPeriodSinceCreationInDays, String ifMatch) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String immutabilityPolicyName = "default"; + ImmutabilityPolicyInner parameters = new ImmutabilityPolicyInner(); + parameters.withImmutabilityPeriodSinceCreationInDays(immutabilityPeriodSinceCreationInDays); + return service.createOrUpdateImmutabilityPolicy(resourceGroupName, accountName, containerName, immutabilityPolicyName, this.client.subscriptionId(), this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = createOrUpdateImmutabilityPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders createOrUpdateImmutabilityPolicyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.class); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @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 ImmutabilityPolicyInner object if successful. + */ + public ImmutabilityPolicyInner getImmutabilityPolicy(String resourceGroupName, String accountName, String containerName) { + return getImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName).toBlocking().single().body(); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @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 getImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(getImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName), serviceCallback); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable getImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName) { + return getImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName).map(new Func1, ImmutabilityPolicyInner>() { + @Override + public ImmutabilityPolicyInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable> getImmutabilityPolicyWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String immutabilityPolicyName = "default"; + final String ifMatch = null; + return service.getImmutabilityPolicy(resourceGroupName, accountName, containerName, immutabilityPolicyName, this.client.subscriptionId(), this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = getImmutabilityPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @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 ImmutabilityPolicyInner object if successful. + */ + public ImmutabilityPolicyInner getImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, String ifMatch) { + return getImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch).toBlocking().single().body(); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @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 getImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(getImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch), serviceCallback); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable getImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch) { + return getImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch).map(new Func1, ImmutabilityPolicyInner>() { + @Override + public ImmutabilityPolicyInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable> getImmutabilityPolicyWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, String ifMatch) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String immutabilityPolicyName = "default"; + return service.getImmutabilityPolicy(resourceGroupName, accountName, containerName, immutabilityPolicyName, this.client.subscriptionId(), this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = getImmutabilityPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders getImmutabilityPolicyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, BlobContainersGetImmutabilityPolicyHeaders.class); + } + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the container after deleting all blobs inside the container. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @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 ImmutabilityPolicyInner object if successful. + */ + public ImmutabilityPolicyInner deleteImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, String ifMatch) { + return deleteImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch).toBlocking().single().body(); + } + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the container after deleting all blobs inside the container. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @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 deleteImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch), serviceCallback); + } + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the container after deleting all blobs inside the container. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable deleteImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch) { + return deleteImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch).map(new Func1, ImmutabilityPolicyInner>() { + @Override + public ImmutabilityPolicyInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, only way is to delete the container after deleting all blobs inside the container. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable> deleteImmutabilityPolicyWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, String ifMatch) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (ifMatch == null) { + throw new IllegalArgumentException("Parameter ifMatch is required and cannot be null."); + } + final String immutabilityPolicyName = "default"; + return service.deleteImmutabilityPolicy(resourceGroupName, accountName, containerName, immutabilityPolicyName, this.client.subscriptionId(), this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = deleteImmutabilityPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders deleteImmutabilityPolicyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, BlobContainersDeleteImmutabilityPolicyHeaders.class); + } + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @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 ImmutabilityPolicyInner object if successful. + */ + public ImmutabilityPolicyInner lockImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, String ifMatch) { + return lockImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch).toBlocking().single().body(); + } + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @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 lockImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(lockImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch), serviceCallback); + } + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable lockImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch) { + return lockImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch).map(new Func1, ImmutabilityPolicyInner>() { + @Override + public ImmutabilityPolicyInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable> lockImmutabilityPolicyWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, String ifMatch) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (ifMatch == null) { + throw new IllegalArgumentException("Parameter ifMatch is required and cannot be null."); + } + return service.lockImmutabilityPolicy(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = lockImmutabilityPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders lockImmutabilityPolicyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, BlobContainersLockImmutabilityPolicyHeaders.class); + } + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @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 ImmutabilityPolicyInner object if successful. + */ + public ImmutabilityPolicyInner extendImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, String ifMatch, int immutabilityPeriodSinceCreationInDays) { + return extendImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays).toBlocking().single().body(); + } + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @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 extendImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch, int immutabilityPeriodSinceCreationInDays, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(extendImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays), serviceCallback); + } + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable extendImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch, int immutabilityPeriodSinceCreationInDays) { + return extendImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays).map(new Func1, ImmutabilityPolicyInner>() { + @Override + public ImmutabilityPolicyInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable> extendImmutabilityPolicyWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, String ifMatch, int immutabilityPeriodSinceCreationInDays) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (ifMatch == null) { + throw new IllegalArgumentException("Parameter ifMatch is required and cannot be null."); + } + ImmutabilityPolicyInner parameters = new ImmutabilityPolicyInner(); + parameters.withImmutabilityPeriodSinceCreationInDays(immutabilityPeriodSinceCreationInDays); + return service.extendImmutabilityPolicy(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = extendImmutabilityPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders extendImmutabilityPolicyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, BlobContainersExtendImmutabilityPolicyHeaders.class); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @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 LeaseContainerResponseInner object if successful. + */ + public LeaseContainerResponseInner lease(String resourceGroupName, String accountName, String containerName) { + return leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName).toBlocking().single().body(); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @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 leaseAsync(String resourceGroupName, String accountName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName), serviceCallback); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LeaseContainerResponseInner object + */ + public Observable leaseAsync(String resourceGroupName, String accountName, String containerName) { + return leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName).map(new Func1, LeaseContainerResponseInner>() { + @Override + public LeaseContainerResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LeaseContainerResponseInner object + */ + public Observable> leaseWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName) { + 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final LeaseContainerRequest parameters = null; + return service.lease(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = leaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @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 LeaseContainerResponseInner object if successful. + */ + public LeaseContainerResponseInner lease(String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters) { + return leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName, parameters).toBlocking().single().body(); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @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 leaseAsync(String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName, parameters), serviceCallback); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LeaseContainerResponseInner object + */ + public Observable leaseAsync(String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters) { + return leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName, parameters).map(new Func1, LeaseContainerResponseInner>() { + @Override + public LeaseContainerResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @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 containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LeaseContainerResponseInner object + */ + public Observable> leaseWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, LeaseContainerRequest 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 (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.lease(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = leaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse leaseDelegate(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); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<ListContainerItemInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ListContainerItemInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ListContainerItemInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ListContainerItemInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobServicePropertiesImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobServicePropertiesImpl.java new file mode 100644 index 000000000000..25f23ab3643f --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobServicePropertiesImpl.java @@ -0,0 +1,138 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.BlobServiceProperties; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_04_01.CorsRules; +import com.microsoft.azure.management.storage.v2019_04_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(); + // set resource ancestor and positional variables + 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 Boolean automaticSnapshotPolicyEnabled() { + return this.inner().automaticSnapshotPolicyEnabled(); + } + + @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 withAutomaticSnapshotPolicyEnabled(Boolean automaticSnapshotPolicyEnabled) { + this.inner().withAutomaticSnapshotPolicyEnabled(automaticSnapshotPolicyEnabled); + 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/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobServicePropertiesInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobServicePropertiesInner.java new file mode 100644 index 000000000000..4d0b9929076f --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobServicePropertiesInner.java @@ -0,0 +1,131 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.CorsRules; +import com.microsoft.azure.management.storage.v2019_04_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; + + /** + * Automatic Snapshot is enabled if set to true. + */ + @JsonProperty(value = "properties.automaticSnapshotPolicyEnabled") + private Boolean automaticSnapshotPolicyEnabled; + + /** + * 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; + } + + /** + * Get automatic Snapshot is enabled if set to true. + * + * @return the automaticSnapshotPolicyEnabled value + */ + public Boolean automaticSnapshotPolicyEnabled() { + return this.automaticSnapshotPolicyEnabled; + } + + /** + * Set automatic Snapshot is enabled if set to true. + * + * @param automaticSnapshotPolicyEnabled the automaticSnapshotPolicyEnabled value to set + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withAutomaticSnapshotPolicyEnabled(Boolean automaticSnapshotPolicyEnabled) { + this.automaticSnapshotPolicyEnabled = automaticSnapshotPolicyEnabled; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobServicesImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobServicesImpl.java new file mode 100644 index 000000000000..bb720d96318f --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_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.v2019_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_04_01.BlobServices; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.storage.v2019_04_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/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobServicesInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobServicesInner.java new file mode 100644 index 000000000000..38b4a08e46b1 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/BlobServicesInner.java @@ -0,0 +1,249 @@ +/** + * 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.v2019_04_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.v2019_04_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.v2019_04_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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() 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"; + return service.setServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), blobServicesName, this.client.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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String blobServicesName = "default"; + return service.getServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), blobServicesName, this.client.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/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/CheckNameAvailabilityResultImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/CheckNameAvailabilityResultImpl.java new file mode 100644 index 000000000000..173aaf9fcbe3 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/CheckNameAvailabilityResultImpl.java @@ -0,0 +1,42 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.CheckNameAvailabilityResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_04_01.Reason; + +class CheckNameAvailabilityResultImpl extends WrapperImpl implements CheckNameAvailabilityResult { + private final StorageManager manager; + CheckNameAvailabilityResultImpl(CheckNameAvailabilityResultInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public Reason reason() { + return this.inner().reason(); + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/CheckNameAvailabilityResultInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/CheckNameAvailabilityResultInner.java new file mode 100644 index 000000000000..fdd64a96d524 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/CheckNameAvailabilityResultInner.java @@ -0,0 +1,67 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.Reason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CheckNameAvailability operation response. + */ +public class CheckNameAvailabilityResultInner { + /** + * Gets a boolean value that indicates whether the name is available for + * you to use. If true, the name is available. If false, the name has + * already been taken or is invalid and cannot be used. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /** + * Gets the reason that a storage account name could not be used. The + * Reason element is only returned if NameAvailable is false. Possible + * values include: 'AccountNameInvalid', 'AlreadyExists'. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private Reason reason; + + /** + * Gets an error message explaining the Reason value in more detail. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'AccountNameInvalid', 'AlreadyExists'. + * + * @return the reason value + */ + public Reason reason() { + return this.reason; + } + + /** + * Get gets an error message explaining the Reason value in more detail. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/IdParsingUtils.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..62e4ee48673c --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * 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.v2019_04_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ImmutabilityPolicyImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ImmutabilityPolicyImpl.java new file mode 100644 index 000000000000..61cf943fe2c7 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ImmutabilityPolicyImpl.java @@ -0,0 +1,135 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.ImmutabilityPolicy; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_04_01.ImmutabilityPolicyState; + +class ImmutabilityPolicyImpl extends CreatableUpdatableImpl implements ImmutabilityPolicy, ImmutabilityPolicy.Definition, ImmutabilityPolicy.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private String containerName; + private String cifMatch; + private int cimmutabilityPeriodSinceCreationInDays; + private String uifMatch; + private int uimmutabilityPeriodSinceCreationInDays; + + ImmutabilityPolicyImpl(String name, StorageManager manager) { + super(name, new ImmutabilityPolicyInner()); + this.manager = manager; + // Set resource name + this.containerName = name; + // + } + + ImmutabilityPolicyImpl(ImmutabilityPolicyInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.containerName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + this.containerName = IdParsingUtils.getValueFromIdByName(inner.id(), "containers"); + // + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + BlobContainersInner client = this.manager().inner().blobContainers(); + return client.createOrUpdateImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName, this.cimmutabilityPeriodSinceCreationInDays, this.cifMatch) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + BlobContainersInner client = this.manager().inner().blobContainers(); + return client.createOrUpdateImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName, this.uimmutabilityPeriodSinceCreationInDays, this.uifMatch) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + BlobContainersInner client = this.manager().inner().blobContainers(); + return client.getImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public int immutabilityPeriodSinceCreationInDays() { + return this.inner().immutabilityPeriodSinceCreationInDays(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ImmutabilityPolicyState state() { + return this.inner().state(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ImmutabilityPolicyImpl withExistingContainer(String resourceGroupName, String accountName, String containerName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.containerName = containerName; + return this; + } + + @Override + public ImmutabilityPolicyImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.cifMatch = ifMatch; + } else { + this.uifMatch = ifMatch; + } + return this; + } + + @Override + public ImmutabilityPolicyImpl withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays) { + if (isInCreateMode()) { + this.cimmutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays; + } else { + this.uimmutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays; + } + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ImmutabilityPolicyInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ImmutabilityPolicyInner.java new file mode 100644 index 000000000000..06a0fd97582d --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ImmutabilityPolicyInner.java @@ -0,0 +1,66 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.ImmutabilityPolicyState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.storage.v2019_04_01.AzureEntityResource; + +/** + * The ImmutabilityPolicy property of a blob container, including Id, resource + * name, resource type, Etag. + */ +@JsonFlatten +public class ImmutabilityPolicyInner extends AzureEntityResource { + /** + * The immutability period for the blobs in the container since the policy + * creation, in days. + */ + @JsonProperty(value = "properties.immutabilityPeriodSinceCreationInDays", required = true) + private int immutabilityPeriodSinceCreationInDays; + + /** + * The ImmutabilityPolicy state of a blob container, possible values + * include: Locked and Unlocked. Possible values include: 'Locked', + * 'Unlocked'. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private ImmutabilityPolicyState state; + + /** + * Get the immutability period for the blobs in the container since the policy creation, in days. + * + * @return the immutabilityPeriodSinceCreationInDays value + */ + public int immutabilityPeriodSinceCreationInDays() { + return this.immutabilityPeriodSinceCreationInDays; + } + + /** + * Set the immutability period for the blobs in the container since the policy creation, in days. + * + * @param immutabilityPeriodSinceCreationInDays the immutabilityPeriodSinceCreationInDays value to set + * @return the ImmutabilityPolicyInner object itself. + */ + public ImmutabilityPolicyInner withImmutabilityPeriodSinceCreationInDays(int immutabilityPeriodSinceCreationInDays) { + this.immutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays; + return this; + } + + /** + * Get the ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. Possible values include: 'Locked', 'Unlocked'. + * + * @return the state value + */ + public ImmutabilityPolicyState state() { + return this.state; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/LeaseContainerResponseImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/LeaseContainerResponseImpl.java new file mode 100644 index 000000000000..92db5e75902e --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/LeaseContainerResponseImpl.java @@ -0,0 +1,36 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.LeaseContainerResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class LeaseContainerResponseImpl extends WrapperImpl implements LeaseContainerResponse { + private final StorageManager manager; + LeaseContainerResponseImpl(LeaseContainerResponseInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String leaseId() { + return this.inner().leaseId(); + } + + @Override + public String leaseTimeSeconds() { + return this.inner().leaseTimeSeconds(); + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/LeaseContainerResponseInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/LeaseContainerResponseInner.java new file mode 100644 index 000000000000..daaad7189407 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/LeaseContainerResponseInner.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.v2019_04_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Lease Container response schema. + */ +public class LeaseContainerResponseInner { + /** + * Returned unique lease ID that must be included with any request to + * delete the container, or to renew, change, or release the lease. + */ + @JsonProperty(value = "leaseId") + private String leaseId; + + /** + * Approximate time remaining in the lease period, in seconds. + */ + @JsonProperty(value = "leaseTimeSeconds") + private String leaseTimeSeconds; + + /** + * Get returned unique lease ID that must be included with any request to delete the container, or to renew, change, or release the lease. + * + * @return the leaseId value + */ + public String leaseId() { + return this.leaseId; + } + + /** + * Set returned unique lease ID that must be included with any request to delete the container, or to renew, change, or release the lease. + * + * @param leaseId the leaseId value to set + * @return the LeaseContainerResponseInner object itself. + */ + public LeaseContainerResponseInner withLeaseId(String leaseId) { + this.leaseId = leaseId; + return this; + } + + /** + * Get approximate time remaining in the lease period, in seconds. + * + * @return the leaseTimeSeconds value + */ + public String leaseTimeSeconds() { + return this.leaseTimeSeconds; + } + + /** + * Set approximate time remaining in the lease period, in seconds. + * + * @param leaseTimeSeconds the leaseTimeSeconds value to set + * @return the LeaseContainerResponseInner object itself. + */ + public LeaseContainerResponseInner withLeaseTimeSeconds(String leaseTimeSeconds) { + this.leaseTimeSeconds = leaseTimeSeconds; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/LegalHoldImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/LegalHoldImpl.java new file mode 100644 index 000000000000..032f53e66b75 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/LegalHoldImpl.java @@ -0,0 +1,37 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.LegalHold; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class LegalHoldImpl extends WrapperImpl implements LegalHold { + private final StorageManager manager; + LegalHoldImpl(LegalHoldInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Boolean hasLegalHold() { + return this.inner().hasLegalHold(); + } + + @Override + public List tags() { + return this.inner().tags(); + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/LegalHoldInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/LegalHoldInner.java new file mode 100644 index 000000000000..5fdb4dd870ab --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/LegalHoldInner.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.v2019_04_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The LegalHold property of a blob container. + */ +public class LegalHoldInner { + /** + * The hasLegalHold public property is set to true by SRP if there are at + * least one existing tag. The hasLegalHold public property is set to false + * by SRP if all existing legal hold tags are cleared out. There can be a + * maximum of 1000 blob containers with hasLegalHold=true for a given + * account. + */ + @JsonProperty(value = "hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasLegalHold; + + /** + * Each tag should be 3 to 23 alphanumeric characters and is normalized to + * lower case at SRP. + */ + @JsonProperty(value = "tags", required = true) + private List tags; + + /** + * Get the hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. + * + * @return the hasLegalHold value + */ + public Boolean hasLegalHold() { + return this.hasLegalHold; + } + + /** + * Get each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * + * @return the tags value + */ + public List tags() { + return this.tags; + } + + /** + * Set each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * + * @param tags the tags value to set + * @return the LegalHoldInner object itself. + */ + public LegalHoldInner withTags(List tags) { + this.tags = tags; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListAccountSasResponseImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListAccountSasResponseImpl.java new file mode 100644 index 000000000000..6281c206e9ec --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListAccountSasResponseImpl.java @@ -0,0 +1,31 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.ListAccountSasResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ListAccountSasResponseImpl extends WrapperImpl implements ListAccountSasResponse { + private final StorageManager manager; + ListAccountSasResponseImpl(ListAccountSasResponseInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String accountSasToken() { + return this.inner().accountSasToken(); + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListAccountSasResponseInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListAccountSasResponseInner.java new file mode 100644 index 000000000000..98d7def40615 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListAccountSasResponseInner.java @@ -0,0 +1,32 @@ +/** + * 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.v2019_04_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The List SAS credentials operation response. + */ +public class ListAccountSasResponseInner { + /** + * List SAS credentials of storage account. + */ + @JsonProperty(value = "accountSasToken", access = JsonProperty.Access.WRITE_ONLY) + private String accountSasToken; + + /** + * Get list SAS credentials of storage account. + * + * @return the accountSasToken value + */ + public String accountSasToken() { + return this.accountSasToken; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListContainerItemImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListContainerItemImpl.java new file mode 100644 index 000000000000..369b9e8f3af4 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListContainerItemImpl.java @@ -0,0 +1,104 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.ListContainerItem; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_04_01.ImmutabilityPolicyProperties; +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_04_01.LeaseDuration; +import com.microsoft.azure.management.storage.v2019_04_01.LeaseState; +import com.microsoft.azure.management.storage.v2019_04_01.LeaseStatus; +import com.microsoft.azure.management.storage.v2019_04_01.LegalHoldProperties; +import java.util.Map; +import com.microsoft.azure.management.storage.v2019_04_01.PublicAccess; + +class ListContainerItemImpl extends WrapperImpl implements ListContainerItem { + private final StorageManager manager; + ListContainerItemImpl(ListContainerItemInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Boolean hasImmutabilityPolicy() { + return this.inner().hasImmutabilityPolicy(); + } + + @Override + public Boolean hasLegalHold() { + return this.inner().hasLegalHold(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public ImmutabilityPolicyProperties immutabilityPolicy() { + return this.inner().immutabilityPolicy(); + } + + @Override + public DateTime lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public LeaseDuration leaseDuration() { + return this.inner().leaseDuration(); + } + + @Override + public LeaseState leaseState() { + return this.inner().leaseState(); + } + + @Override + public LeaseStatus leaseStatus() { + return this.inner().leaseStatus(); + } + + @Override + public LegalHoldProperties legalHold() { + return this.inner().legalHold(); + } + + @Override + public Map metadata() { + return this.inner().metadata(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PublicAccess publicAccess() { + return this.inner().publicAccess(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListContainerItemInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListContainerItemInner.java new file mode 100644 index 000000000000..958611c63ad8 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListContainerItemInner.java @@ -0,0 +1,212 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.PublicAccess; +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_04_01.LeaseStatus; +import com.microsoft.azure.management.storage.v2019_04_01.LeaseState; +import com.microsoft.azure.management.storage.v2019_04_01.LeaseDuration; +import java.util.Map; +import com.microsoft.azure.management.storage.v2019_04_01.ImmutabilityPolicyProperties; +import com.microsoft.azure.management.storage.v2019_04_01.LegalHoldProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.storage.v2019_04_01.AzureEntityResource; + +/** + * The blob container properties be listed out. + */ +@JsonFlatten +public class ListContainerItemInner extends AzureEntityResource { + /** + * Specifies whether data in the container may be accessed publicly and the + * level of access. Possible values include: 'Container', 'Blob', 'None'. + */ + @JsonProperty(value = "properties.publicAccess") + private PublicAccess publicAccess; + + /** + * Returns the date and time the container was last modified. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * The lease status of the container. Possible values include: 'Locked', + * 'Unlocked'. + */ + @JsonProperty(value = "properties.leaseStatus", access = JsonProperty.Access.WRITE_ONLY) + private LeaseStatus leaseStatus; + + /** + * Lease state of the container. Possible values include: 'Available', + * 'Leased', 'Expired', 'Breaking', 'Broken'. + */ + @JsonProperty(value = "properties.leaseState", access = JsonProperty.Access.WRITE_ONLY) + private LeaseState leaseState; + + /** + * Specifies whether the lease on a container is of infinite or fixed + * duration, only when the container is leased. Possible values include: + * 'Infinite', 'Fixed'. + */ + @JsonProperty(value = "properties.leaseDuration", access = JsonProperty.Access.WRITE_ONLY) + private LeaseDuration leaseDuration; + + /** + * A name-value pair to associate with the container as metadata. + */ + @JsonProperty(value = "properties.metadata") + private Map metadata; + + /** + * The ImmutabilityPolicy property of the container. + */ + @JsonProperty(value = "properties.immutabilityPolicy", access = JsonProperty.Access.WRITE_ONLY) + private ImmutabilityPolicyProperties immutabilityPolicy; + + /** + * The LegalHold property of the container. + */ + @JsonProperty(value = "properties.legalHold", access = JsonProperty.Access.WRITE_ONLY) + private LegalHoldProperties legalHold; + + /** + * The hasLegalHold public property is set to true by SRP if there are at + * least one existing tag. The hasLegalHold public property is set to false + * by SRP if all existing legal hold tags are cleared out. There can be a + * maximum of 1000 blob containers with hasLegalHold=true for a given + * account. + */ + @JsonProperty(value = "properties.hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasLegalHold; + + /** + * The hasImmutabilityPolicy public property is set to true by SRP if + * ImmutabilityPolicy has been created for this container. The + * hasImmutabilityPolicy public property is set to false by SRP if + * ImmutabilityPolicy has not been created for this container. + */ + @JsonProperty(value = "properties.hasImmutabilityPolicy", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasImmutabilityPolicy; + + /** + * Get specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None'. + * + * @return the publicAccess value + */ + public PublicAccess publicAccess() { + return this.publicAccess; + } + + /** + * Set specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None'. + * + * @param publicAccess the publicAccess value to set + * @return the ListContainerItemInner object itself. + */ + public ListContainerItemInner withPublicAccess(PublicAccess publicAccess) { + this.publicAccess = publicAccess; + return this; + } + + /** + * Get returns the date and time the container was last modified. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the lease status of the container. Possible values include: 'Locked', 'Unlocked'. + * + * @return the leaseStatus value + */ + public LeaseStatus leaseStatus() { + return this.leaseStatus; + } + + /** + * Get lease state of the container. Possible values include: 'Available', 'Leased', 'Expired', 'Breaking', 'Broken'. + * + * @return the leaseState value + */ + public LeaseState leaseState() { + return this.leaseState; + } + + /** + * Get specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. Possible values include: 'Infinite', 'Fixed'. + * + * @return the leaseDuration value + */ + public LeaseDuration leaseDuration() { + return this.leaseDuration; + } + + /** + * Get a name-value pair to associate with the container as metadata. + * + * @return the metadata value + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set a name-value pair to associate with the container as metadata. + * + * @param metadata the metadata value to set + * @return the ListContainerItemInner object itself. + */ + public ListContainerItemInner withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the ImmutabilityPolicy property of the container. + * + * @return the immutabilityPolicy value + */ + public ImmutabilityPolicyProperties immutabilityPolicy() { + return this.immutabilityPolicy; + } + + /** + * Get the LegalHold property of the container. + * + * @return the legalHold value + */ + public LegalHoldProperties legalHold() { + return this.legalHold; + } + + /** + * Get the hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. + * + * @return the hasLegalHold value + */ + public Boolean hasLegalHold() { + return this.hasLegalHold; + } + + /** + * Get the hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container. + * + * @return the hasImmutabilityPolicy value + */ + public Boolean hasImmutabilityPolicy() { + return this.hasImmutabilityPolicy; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListContainerItemsImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListContainerItemsImpl.java new file mode 100644 index 000000000000..24cf62f95737 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListContainerItemsImpl.java @@ -0,0 +1,38 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.ListContainerItems; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_04_01.ListContainerItem; + +class ListContainerItemsImpl extends WrapperImpl implements ListContainerItems { + private final StorageManager manager; + ListContainerItemsImpl(ListContainerItemsInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListContainerItemsInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListContainerItemsInner.java new file mode 100644 index 000000000000..d07ba5e0fad0 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListContainerItemsInner.java @@ -0,0 +1,51 @@ +/** + * 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.v2019_04_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.storage.v2019_04_01.ListContainerItem; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response schema. Contains list of blobs returned, and if paging is requested + * or required, a URL to next page of containers. + */ +public class ListContainerItemsInner { + /** + * List of blobs containers returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Request URL that can be used to query next page of containers. Returned + * when total number of requested containers exceed maximum page size. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get list of blobs containers returned. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Get request URL that can be used to query next page of containers. Returned when total number of requested containers exceed maximum page size. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListServiceSasResponseImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListServiceSasResponseImpl.java new file mode 100644 index 000000000000..b7c90197719b --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListServiceSasResponseImpl.java @@ -0,0 +1,31 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.ListServiceSasResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ListServiceSasResponseImpl extends WrapperImpl implements ListServiceSasResponse { + private final StorageManager manager; + ListServiceSasResponseImpl(ListServiceSasResponseInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String serviceSasToken() { + return this.inner().serviceSasToken(); + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListServiceSasResponseInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListServiceSasResponseInner.java new file mode 100644 index 000000000000..d52369c499f0 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ListServiceSasResponseInner.java @@ -0,0 +1,32 @@ +/** + * 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.v2019_04_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The List service SAS credentials operation response. + */ +public class ListServiceSasResponseInner { + /** + * List service SAS credentials of specific resource. + */ + @JsonProperty(value = "serviceSasToken", access = JsonProperty.Access.WRITE_ONLY) + private String serviceSasToken; + + /** + * Get list service SAS credentials of specific resource. + * + * @return the serviceSasToken value + */ + public String serviceSasToken() { + return this.serviceSasToken; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ManagementPoliciesImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ManagementPoliciesImpl.java new file mode 100644 index 000000000000..f52913c12083 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_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.v2019_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_04_01.ManagementPolicies; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.storage.v2019_04_01.ManagementPolicy; + +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 ManagementPolicyImpl define(String name) { + return wrapModel(name); + } + + private ManagementPolicyImpl wrapModel(ManagementPolicyInner inner) { + return new ManagementPolicyImpl(inner, manager()); + } + + private ManagementPolicyImpl wrapModel(String name) { + return new ManagementPolicyImpl(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 ManagementPolicy call(ManagementPolicyInner 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/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ManagementPoliciesInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ManagementPoliciesInner.java new file mode 100644 index 000000000000..26ee4642425f --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ManagementPoliciesInner.java @@ -0,0 +1,345 @@ +/** + * 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.v2019_04_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.v2019_04_01.ManagementPolicySchema; +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.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.v2019_04_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.v2019_04_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 ManagementPolicyInner properties, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_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 managementpolicy 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 ManagementPolicyInner object if successful. + */ + public ManagementPolicyInner get(String resourceGroupName, String accountName) { + return getWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets the managementpolicy 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 managementpolicy 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 ManagementPolicyInner object + */ + public Observable getAsync(String resourceGroupName, String accountName) { + return getWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, ManagementPolicyInner>() { + @Override + public ManagementPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the managementpolicy 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 ManagementPolicyInner 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String managementPolicyName = "default"; + return service.get(resourceGroupName, accountName, this.client.subscriptionId(), managementPolicyName, this.client.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 managementpolicy to 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 ManagementPolicy, 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 ManagementPolicyInner object if successful. + */ + public ManagementPolicyInner createOrUpdate(String resourceGroupName, String accountName, ManagementPolicySchema policy) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, policy).toBlocking().single().body(); + } + + /** + * Sets the managementpolicy to 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 ManagementPolicy, 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, ManagementPolicySchema policy, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, policy), serviceCallback); + } + + /** + * Sets the managementpolicy to 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 ManagementPolicy, 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 ManagementPolicyInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, ManagementPolicySchema policy) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, policy).map(new Func1, ManagementPolicyInner>() { + @Override + public ManagementPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the managementpolicy to 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 ManagementPolicy, 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 ManagementPolicyInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, ManagementPolicySchema 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (policy == null) { + throw new IllegalArgumentException("Parameter policy is required and cannot be null."); + } + Validator.validate(policy); + final String managementPolicyName = "default"; + ManagementPolicyInner properties = new ManagementPolicyInner(); + properties.withPolicy(policy); + return service.createOrUpdate(resourceGroupName, accountName, this.client.subscriptionId(), managementPolicyName, this.client.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 managementpolicy 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 managementpolicy 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 managementpolicy 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 managementpolicy 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String managementPolicyName = "default"; + return service.delete(resourceGroupName, accountName, this.client.subscriptionId(), managementPolicyName, this.client.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/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ManagementPolicyImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ManagementPolicyImpl.java new file mode 100644 index 000000000000..408f69f8b685 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ManagementPolicyImpl.java @@ -0,0 +1,140 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.ManagementPolicy; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_04_01.ManagementPolicySchema; +import java.util.List; +import org.joda.time.DateTime; +import rx.functions.Func1; + +class ManagementPolicyImpl extends CreatableUpdatableImpl implements ManagementPolicy, ManagementPolicy.Definition, ManagementPolicy.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private ManagementPolicySchema cpolicy; + private ManagementPolicySchema upolicy; + + ManagementPolicyImpl(String name, StorageManager manager) { + super(name, new ManagementPolicyInner()); + this.manager = manager; + // Set resource name + this.accountName = name; + // + this.cpolicy = new ManagementPolicySchema(); + this.upolicy = new ManagementPolicySchema(); + } + + ManagementPolicyImpl(ManagementPolicyInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.accountName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + // + this.cpolicy = new ManagementPolicySchema(); + this.upolicy = new ManagementPolicySchema(); + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ManagementPoliciesInner client = this.manager().inner().managementPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.cpolicy) + .map(new Func1() { + @Override + public ManagementPolicyInner call(ManagementPolicyInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ManagementPoliciesInner client = this.manager().inner().managementPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.upolicy) + .map(new Func1() { + @Override + public ManagementPolicyInner call(ManagementPolicyInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .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; + } + + private void resetCreateUpdateParameters() { + this.cpolicy = new ManagementPolicySchema(); + this.upolicy = new ManagementPolicySchema(); + } + + @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 ManagementPolicySchema policy() { + return this.inner().policy(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ManagementPolicyImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public ManagementPolicyImpl withPolicy(ManagementPolicySchema policy) { + if (isInCreateMode()) { + this.cpolicy = policy; + } else { + this.upolicy = policy; + } + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ManagementPolicyInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ManagementPolicyInner.java new file mode 100644 index 000000000000..44b4519e4117 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/ManagementPolicyInner.java @@ -0,0 +1,65 @@ +/** + * 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.v2019_04_01.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_04_01.ManagementPolicySchema; +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 ManagementPolicyInner extends ProxyResource { + /** + * Returns the date and time the ManagementPolicies was last modified. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * The Storage Account ManagementPolicy, in JSON format. See more details + * in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + */ + @JsonProperty(value = "properties.policy", required = true) + private ManagementPolicySchema policy; + + /** + * Get returns the date and time the ManagementPolicies was last modified. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the Storage Account ManagementPolicy, 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 ManagementPolicySchema policy() { + return this.policy; + } + + /** + * Set the Storage Account ManagementPolicy, 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 ManagementPolicyInner object itself. + */ + public ManagementPolicyInner withPolicy(ManagementPolicySchema policy) { + this.policy = policy; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/OperationImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/OperationImpl.java new file mode 100644 index 000000000000..8b258c26029c --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/OperationImpl.java @@ -0,0 +1,48 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_04_01.OperationDisplay; +import com.microsoft.azure.management.storage.v2019_04_01.ServiceSpecification; + +class OperationImpl extends WrapperImpl implements Operation { + private final StorageManager manager; + OperationImpl(OperationInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public ServiceSpecification serviceSpecification() { + return this.inner().serviceSpecification(); + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/OperationInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/OperationInner.java new file mode 100644 index 000000000000..4d97bc61d40b --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/OperationInner.java @@ -0,0 +1,125 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.OperationDisplay; +import com.microsoft.azure.management.storage.v2019_04_01.ServiceSpecification; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Storage REST API operation definition. + */ +@JsonFlatten +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display metadata associated with the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * The origin of operations. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * One property of operation, include metric specifications. + */ + @JsonProperty(value = "properties.serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get display metadata associated with the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set display metadata associated with the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin of operations. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin of operations. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get one property of operation, include metric specifications. + * + * @return the serviceSpecification value + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set one property of operation, include metric specifications. + * + * @param serviceSpecification the serviceSpecification value to set + * @return the OperationInner object itself. + */ + public OperationInner withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/OperationsImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/OperationsImpl.java new file mode 100644 index 000000000000..d24141c149bd --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/OperationsImpl.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. + * abc + */ + +package com.microsoft.azure.management.storage.v2019_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_04_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_04_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final StorageManager manager; + + OperationsImpl(StorageManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/OperationsInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/OperationsInner.java new file mode 100644 index 000000000000..9317d03c6205 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/OperationsInner.java @@ -0,0 +1,134 @@ +/** + * 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.v2019_04_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 java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +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 Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.Operations list" }) + @GET("providers/Microsoft.Storage/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @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 List<OperationInner> object if successful. + */ + public List list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @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> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/PageImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/PageImpl.java new file mode 100644 index 000000000000..db8216b06bd2 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * 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.v2019_04_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/PageImpl1.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/PageImpl1.java new file mode 100644 index 000000000000..5210ec3ea4c6 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/PageImpl1.java @@ -0,0 +1,75 @@ +/** + * 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.v2019_04_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/SkuImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/SkuImpl.java new file mode 100644 index 000000000000..00f8566c8758 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/SkuImpl.java @@ -0,0 +1,72 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.Sku; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_04_01.SKUCapability; +import com.microsoft.azure.management.storage.v2019_04_01.Kind; +import com.microsoft.azure.management.storage.v2019_04_01.SkuName; +import com.microsoft.azure.management.storage.v2019_04_01.Restriction; +import com.microsoft.azure.management.storage.v2019_04_01.SkuTier; + +class SkuImpl extends WrapperImpl implements Sku { + private final StorageManager manager; + + SkuImpl(SkuInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + + + @Override + public List capabilities() { + return this.inner().capabilities(); + } + + @Override + public Kind kind() { + return this.inner().kind(); + } + + @Override + public List locations() { + return this.inner().locations(); + } + + @Override + public SkuName name() { + return this.inner().name(); + } + + @Override + public String resourceType() { + return this.inner().resourceType(); + } + + @Override + public List restrictions() { + return this.inner().restrictions(); + } + + @Override + public SkuTier tier() { + return this.inner().tier(); + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/SkuInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/SkuInner.java new file mode 100644 index 000000000000..3f5a0f78d379 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/SkuInner.java @@ -0,0 +1,161 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.SkuName; +import com.microsoft.azure.management.storage.v2019_04_01.SkuTier; +import com.microsoft.azure.management.storage.v2019_04_01.Kind; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_04_01.SKUCapability; +import com.microsoft.azure.management.storage.v2019_04_01.Restriction; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SKU of the storage account. + */ +public class SkuInner { + /** + * Gets or sets the SKU name. Required for account creation; optional for + * update. Note that in older versions, SKU name was called accountType. + * Possible values include: 'Standard_LRS', 'Standard_GRS', + * 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS', + * 'Standard_GZRS', 'Standard_RAGZRS'. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /** + * Gets the SKU tier. This is based on the SKU name. Possible values + * include: 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private SkuTier tier; + + /** + * The type of the resource, usually it is 'storageAccounts'. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /** + * Indicates the type of storage account. Possible values include: + * 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage'. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private Kind kind; + + /** + * The set of locations that the SKU is available. This will be supported + * and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, + * etc.). + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /** + * The capability information in the specified SKU, including file + * encryption, network ACLs, change notification, etc. + */ + @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) + private List capabilities; + + /** + * The restrictions because of which SKU cannot be used. This is empty if + * there are no restrictions. + */ + @JsonProperty(value = "restrictions") + private List restrictions; + + /** + * Get gets or sets the SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'. + * + * @return the name value + */ + public SkuName name() { + return this.name; + } + + /** + * Set gets or sets the SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'. + * + * @param name the name value to set + * @return the SkuInner object itself. + */ + public SkuInner withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get gets the SKU tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium'. + * + * @return the tier value + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Get the type of the resource, usually it is 'storageAccounts'. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + * + * @return the kind value + */ + public Kind kind() { + return this.kind; + } + + /** + * Get the set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + + /** + * Get the capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. + * + * @return the capabilities value + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Get the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + * + * @return the restrictions value + */ + public List restrictions() { + return this.restrictions; + } + + /** + * Set the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + * + * @param restrictions the restrictions value to set + * @return the SkuInner object itself. + */ + public SkuInner withRestrictions(List restrictions) { + this.restrictions = restrictions; + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/SkusImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/SkusImpl.java new file mode 100644 index 000000000000..528fe67fef46 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/SkusImpl.java @@ -0,0 +1,68 @@ +/** + * 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. + * jkl + */ + +package com.microsoft.azure.management.storage.v2019_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_04_01.Skus; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.arm.utils.PagedListConverter; +import com.microsoft.azure.management.storage.v2019_04_01.Sku; + +class SkusImpl extends WrapperImpl implements Skus { + private PagedListConverter converter; + private final StorageManager manager; + + SkusImpl(StorageManager manager) { + super(manager.inner().skus()); + this.manager = manager; + this.converter = new PagedListConverter() { + @Override + public Observable typeConvertAsync(SkuInner inner) { + return Observable.just((Sku) wrapModel(inner)); + } + }; + } + + public StorageManager manager() { + return this.manager; + } + + private SkuImpl wrapModel(SkuInner inner) { + return new SkuImpl(inner, manager()); + } + + @Override + public PagedList list() { + SkusInner client = this.inner(); + return converter.convert(client.list()); + } + + @Override + public Observable listAsync() { + SkusInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public Sku call(SkuInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/SkusInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/SkusInner.java new file mode 100644 index 000000000000..d11e0ad737e0 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/SkusInner.java @@ -0,0 +1,144 @@ +/** + * 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.v2019_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +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 Skus. + */ +public class SkusInner { + /** The Retrofit service to perform REST calls. */ + private SkusService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of SkusInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SkusInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(SkusService.class); + this.client = client; + } + + /** + * The interface defining all the services for Skus to be + * used by Retrofit to perform actually REST calls. + */ + interface SkusService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.Skus list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @return the observable to the List<SkuInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @return the observable to the List<SkuInner> object + */ + 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()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountImpl.java new file mode 100644 index 000000000000..9c14e2f82761 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountImpl.java @@ -0,0 +1,292 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.storage.v2019_04_01.StorageAccount; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_04_01.StorageAccountUpdateParameters; +import com.microsoft.azure.management.storage.v2019_04_01.StorageAccountCreateParameters; +import com.microsoft.azure.management.storage.v2019_04_01.AccessTier; +import com.microsoft.azure.management.storage.v2019_04_01.AzureFilesIdentityBasedAuthentication; +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_04_01.CustomDomain; +import com.microsoft.azure.management.storage.v2019_04_01.Encryption; +import com.microsoft.azure.management.storage.v2019_04_01.GeoReplicationStats; +import com.microsoft.azure.management.storage.v2019_04_01.Identity; +import com.microsoft.azure.management.storage.v2019_04_01.Kind; +import com.microsoft.azure.management.storage.v2019_04_01.NetworkRuleSet; +import com.microsoft.azure.management.storage.v2019_04_01.Endpoints; +import com.microsoft.azure.management.storage.v2019_04_01.ProvisioningState; +import com.microsoft.azure.management.storage.v2019_04_01.Sku; +import com.microsoft.azure.management.storage.v2019_04_01.AccountStatus; +import rx.functions.Func1; + +class StorageAccountImpl extends GroupableResourceCoreImpl implements StorageAccount, StorageAccount.Definition, StorageAccount.Update { + private StorageAccountCreateParameters createParameter; + private StorageAccountUpdateParameters updateParameter; + StorageAccountImpl(String name, StorageAccountInner inner, StorageManager manager) { + super(name, inner, manager); + this.createParameter = new StorageAccountCreateParameters(); + this.updateParameter = new StorageAccountUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + StorageAccountsInner client = this.manager().inner().storageAccounts(); + this.createParameter.withLocation(inner().location()); + this.createParameter.withTags(inner().getTags()); + return client.createAsync(this.resourceGroupName(), this.name(), this.createParameter) + .map(new Func1() { + @Override + public StorageAccountInner call(StorageAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + StorageAccountsInner client = this.manager().inner().storageAccounts(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public StorageAccountInner call(StorageAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + StorageAccountsInner client = this.manager().inner().storageAccounts(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new StorageAccountCreateParameters(); + this.updateParameter = new StorageAccountUpdateParameters(); + } + + @Override + public AccessTier accessTier() { + return this.inner().accessTier(); + } + + @Override + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.inner().azureFilesIdentityBasedAuthentication(); + } + + @Override + public DateTime creationTime() { + return this.inner().creationTime(); + } + + @Override + public CustomDomain customDomain() { + return this.inner().customDomain(); + } + + @Override + public Boolean enableHttpsTrafficOnly() { + return this.inner().enableHttpsTrafficOnly(); + } + + @Override + public Encryption encryption() { + return this.inner().encryption(); + } + + @Override + public Boolean failoverInProgress() { + return this.inner().failoverInProgress(); + } + + @Override + public GeoReplicationStats geoReplicationStats() { + return this.inner().geoReplicationStats(); + } + + @Override + public Identity identity() { + return this.inner().identity(); + } + + @Override + public Boolean isHnsEnabled() { + return this.inner().isHnsEnabled(); + } + + @Override + public Kind kind() { + return this.inner().kind(); + } + + @Override + public DateTime lastGeoFailoverTime() { + return this.inner().lastGeoFailoverTime(); + } + + @Override + public NetworkRuleSet networkRuleSet() { + return this.inner().networkRuleSet(); + } + + @Override + public Endpoints primaryEndpoints() { + return this.inner().primaryEndpoints(); + } + + @Override + public String primaryLocation() { + return this.inner().primaryLocation(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Endpoints secondaryEndpoints() { + return this.inner().secondaryEndpoints(); + } + + @Override + public String secondaryLocation() { + return this.inner().secondaryLocation(); + } + + @Override + public Sku sku() { + SkuInner inner = this.inner().sku(); + if (inner != null) { + return new SkuImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public AccountStatus statusOfPrimary() { + return this.inner().statusOfPrimary(); + } + + @Override + public AccountStatus statusOfSecondary() { + return this.inner().statusOfSecondary(); + } + + @Override + public StorageAccountImpl withIsHnsEnabled(Boolean isHnsEnabled) { + this.createParameter.withIsHnsEnabled(isHnsEnabled); + return this; + } + + @Override + public StorageAccountImpl withKind(Kind kind) { + if (isInCreateMode()) { + this.createParameter.withKind(kind); + } else { + this.updateParameter.withKind(kind); + } + return this; + } + + @Override + public StorageAccountImpl withSku(SkuInner sku) { + if (isInCreateMode()) { + this.createParameter.withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + + @Override + public StorageAccountImpl withAccessTier(AccessTier accessTier) { + if (isInCreateMode()) { + this.createParameter.withAccessTier(accessTier); + } else { + this.updateParameter.withAccessTier(accessTier); + } + return this; + } + + @Override + public StorageAccountImpl withAzureFilesIdentityBasedAuthentication(AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + if (isInCreateMode()) { + this.createParameter.withAzureFilesIdentityBasedAuthentication(azureFilesIdentityBasedAuthentication); + } else { + this.updateParameter.withAzureFilesIdentityBasedAuthentication(azureFilesIdentityBasedAuthentication); + } + return this; + } + + @Override + public StorageAccountImpl withCustomDomain(CustomDomain customDomain) { + if (isInCreateMode()) { + this.createParameter.withCustomDomain(customDomain); + } else { + this.updateParameter.withCustomDomain(customDomain); + } + return this; + } + + @Override + public StorageAccountImpl withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + if (isInCreateMode()) { + this.createParameter.withEnableHttpsTrafficOnly(enableHttpsTrafficOnly); + } else { + this.updateParameter.withEnableHttpsTrafficOnly(enableHttpsTrafficOnly); + } + return this; + } + + @Override + public StorageAccountImpl withEncryption(Encryption encryption) { + if (isInCreateMode()) { + this.createParameter.withEncryption(encryption); + } else { + this.updateParameter.withEncryption(encryption); + } + return this; + } + + @Override + public StorageAccountImpl withIdentity(Identity identity) { + if (isInCreateMode()) { + this.createParameter.withIdentity(identity); + } else { + this.updateParameter.withIdentity(identity); + } + return this; + } + + @Override + public StorageAccountImpl withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + if (isInCreateMode()) { + this.createParameter.withNetworkRuleSet(networkRuleSet); + } else { + this.updateParameter.withNetworkRuleSet(networkRuleSet); + } + return this; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountInner.java new file mode 100644 index 000000000000..a18bb10bd43d --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountInner.java @@ -0,0 +1,411 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.Kind; +import com.microsoft.azure.management.storage.v2019_04_01.Identity; +import com.microsoft.azure.management.storage.v2019_04_01.ProvisioningState; +import com.microsoft.azure.management.storage.v2019_04_01.Endpoints; +import com.microsoft.azure.management.storage.v2019_04_01.AccountStatus; +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_04_01.CustomDomain; +import com.microsoft.azure.management.storage.v2019_04_01.Encryption; +import com.microsoft.azure.management.storage.v2019_04_01.AccessTier; +import com.microsoft.azure.management.storage.v2019_04_01.AzureFilesIdentityBasedAuthentication; +import com.microsoft.azure.management.storage.v2019_04_01.NetworkRuleSet; +import com.microsoft.azure.management.storage.v2019_04_01.GeoReplicationStats; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * The storage account. + */ +@JsonFlatten +public class StorageAccountInner extends Resource { + /** + * Gets the SKU. + */ + @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) + private SkuInner sku; + + /** + * Gets the Kind. Possible values include: 'Storage', 'StorageV2', + * 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private Kind kind; + + /** + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /** + * Gets the status of the storage account at the time the operation was + * called. Possible values include: 'Creating', 'ResolvingDNS', + * 'Succeeded'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Gets the URLs that are used to perform a retrieval of a public blob, + * queue, or table object. Note that Standard_ZRS and Premium_LRS accounts + * only return the blob endpoint. + */ + @JsonProperty(value = "properties.primaryEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private Endpoints primaryEndpoints; + + /** + * Gets the location of the primary data center for the storage account. + */ + @JsonProperty(value = "properties.primaryLocation", access = JsonProperty.Access.WRITE_ONLY) + private String primaryLocation; + + /** + * Gets the status indicating whether the primary location of the storage + * account is available or unavailable. Possible values include: + * 'available', 'unavailable'. + */ + @JsonProperty(value = "properties.statusOfPrimary", access = JsonProperty.Access.WRITE_ONLY) + private AccountStatus statusOfPrimary; + + /** + * Gets the timestamp of the most recent instance of a failover to the + * secondary location. Only the most recent timestamp is retained. This + * element is not returned if there has never been a failover instance. + * Only available if the accountType is Standard_GRS or Standard_RAGRS. + */ + @JsonProperty(value = "properties.lastGeoFailoverTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastGeoFailoverTime; + + /** + * Gets the location of the geo-replicated secondary for the storage + * account. Only available if the accountType is Standard_GRS or + * Standard_RAGRS. + */ + @JsonProperty(value = "properties.secondaryLocation", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryLocation; + + /** + * Gets the status indicating whether the secondary location of the storage + * account is available or unavailable. Only available if the SKU name is + * Standard_GRS or Standard_RAGRS. Possible values include: 'available', + * 'unavailable'. + */ + @JsonProperty(value = "properties.statusOfSecondary", access = JsonProperty.Access.WRITE_ONLY) + private AccountStatus statusOfSecondary; + + /** + * Gets the creation date and time of the storage account in UTC. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationTime; + + /** + * Gets the custom domain the user assigned to this storage account. + */ + @JsonProperty(value = "properties.customDomain", access = JsonProperty.Access.WRITE_ONLY) + private CustomDomain customDomain; + + /** + * Gets the URLs that are used to perform a retrieval of a public blob, + * queue, or table object from the secondary location of the storage + * account. Only available if the SKU name is Standard_RAGRS. + */ + @JsonProperty(value = "properties.secondaryEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private Endpoints secondaryEndpoints; + + /** + * Gets the encryption settings on the account. If unspecified, the account + * is unencrypted. + */ + @JsonProperty(value = "properties.encryption", access = JsonProperty.Access.WRITE_ONLY) + private Encryption encryption; + + /** + * Required for storage accounts where kind = BlobStorage. The access tier + * used for billing. Possible values include: 'Hot', 'Cool'. + */ + @JsonProperty(value = "properties.accessTier", access = JsonProperty.Access.WRITE_ONLY) + private AccessTier accessTier; + + /** + * Provides the identity based authentication settings for Azure Files. + */ + @JsonProperty(value = "properties.azureFilesIdentityBasedAuthentication") + private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; + + /** + * Allows https traffic only to storage service if sets to true. + */ + @JsonProperty(value = "properties.supportsHttpsTrafficOnly") + private Boolean enableHttpsTrafficOnly; + + /** + * Network rule set. + */ + @JsonProperty(value = "properties.networkAcls", access = JsonProperty.Access.WRITE_ONLY) + private NetworkRuleSet networkRuleSet; + + /** + * Account HierarchicalNamespace enabled if sets to true. + */ + @JsonProperty(value = "properties.isHnsEnabled") + private Boolean isHnsEnabled; + + /** + * Geo Replication Stats. + */ + @JsonProperty(value = "properties.geoReplicationStats", access = JsonProperty.Access.WRITE_ONLY) + private GeoReplicationStats geoReplicationStats; + + /** + * If the failover is in progress, the value will be true, otherwise, it + * will be null. + */ + @JsonProperty(value = "properties.failoverInProgress", access = JsonProperty.Access.WRITE_ONLY) + private Boolean failoverInProgress; + + /** + * Get gets the SKU. + * + * @return the sku value + */ + public SkuInner sku() { + return this.sku; + } + + /** + * Get gets the Kind. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + * + * @return the kind value + */ + public Kind kind() { + return this.kind; + } + + /** + * Get the identity of the resource. + * + * @return the identity value + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity of the resource. + * + * @param identity the identity value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get gets the status of the storage account at the time the operation was called. Possible values include: 'Creating', 'ResolvingDNS', 'Succeeded'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint. + * + * @return the primaryEndpoints value + */ + public Endpoints primaryEndpoints() { + return this.primaryEndpoints; + } + + /** + * Get gets the location of the primary data center for the storage account. + * + * @return the primaryLocation value + */ + public String primaryLocation() { + return this.primaryLocation; + } + + /** + * Get gets the status indicating whether the primary location of the storage account is available or unavailable. Possible values include: 'available', 'unavailable'. + * + * @return the statusOfPrimary value + */ + public AccountStatus statusOfPrimary() { + return this.statusOfPrimary; + } + + /** + * Get gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp is retained. This element is not returned if there has never been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS. + * + * @return the lastGeoFailoverTime value + */ + public DateTime lastGeoFailoverTime() { + return this.lastGeoFailoverTime; + } + + /** + * Get gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS or Standard_RAGRS. + * + * @return the secondaryLocation value + */ + public String secondaryLocation() { + return this.secondaryLocation; + } + + /** + * Get gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible values include: 'available', 'unavailable'. + * + * @return the statusOfSecondary value + */ + public AccountStatus statusOfSecondary() { + return this.statusOfSecondary; + } + + /** + * Get gets the creation date and time of the storage account in UTC. + * + * @return the creationTime value + */ + public DateTime creationTime() { + return this.creationTime; + } + + /** + * Get gets the custom domain the user assigned to this storage account. + * + * @return the customDomain value + */ + public CustomDomain customDomain() { + return this.customDomain; + } + + /** + * Get gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location of the storage account. Only available if the SKU name is Standard_RAGRS. + * + * @return the secondaryEndpoints value + */ + public Endpoints secondaryEndpoints() { + return this.secondaryEndpoints; + } + + /** + * Get gets the encryption settings on the account. If unspecified, the account is unencrypted. + * + * @return the encryption value + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. + * + * @return the accessTier value + */ + public AccessTier accessTier() { + return this.accessTier; + } + + /** + * Get provides the identity based authentication settings for Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value + */ + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.azureFilesIdentityBasedAuthentication; + } + + /** + * Set provides the identity based authentication settings for Azure Files. + * + * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withAzureFilesIdentityBasedAuthentication(AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + this.azureFilesIdentityBasedAuthentication = azureFilesIdentityBasedAuthentication; + return this; + } + + /** + * Get allows https traffic only to storage service if sets to true. + * + * @return the enableHttpsTrafficOnly value + */ + public Boolean enableHttpsTrafficOnly() { + return this.enableHttpsTrafficOnly; + } + + /** + * Set allows https traffic only to storage service if sets to true. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; + return this; + } + + /** + * Get network rule set. + * + * @return the networkRuleSet value + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Get account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value + */ + public Boolean isHnsEnabled() { + return this.isHnsEnabled; + } + + /** + * Set account HierarchicalNamespace enabled if sets to true. + * + * @param isHnsEnabled the isHnsEnabled value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withIsHnsEnabled(Boolean isHnsEnabled) { + this.isHnsEnabled = isHnsEnabled; + return this; + } + + /** + * Get geo Replication Stats. + * + * @return the geoReplicationStats value + */ + public GeoReplicationStats geoReplicationStats() { + return this.geoReplicationStats; + } + + /** + * Get if the failover is in progress, the value will be true, otherwise, it will be null. + * + * @return the failoverInProgress value + */ + public Boolean failoverInProgress() { + return this.failoverInProgress; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountListKeysResultImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountListKeysResultImpl.java new file mode 100644 index 000000000000..29aa54f09e96 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountListKeysResultImpl.java @@ -0,0 +1,33 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.StorageAccountListKeysResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_04_01.StorageAccountKey; + +class StorageAccountListKeysResultImpl extends WrapperImpl implements StorageAccountListKeysResult { + private final StorageManager manager; + StorageAccountListKeysResultImpl(StorageAccountListKeysResultInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public List keys() { + return this.inner().keys(); + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountListKeysResultInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountListKeysResultInner.java new file mode 100644 index 000000000000..0ff0619395bb --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountListKeysResultInner.java @@ -0,0 +1,35 @@ +/** + * 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.v2019_04_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.storage.v2019_04_01.StorageAccountKey; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response from the ListKeys operation. + */ +public class StorageAccountListKeysResultInner { + /** + * Gets the list of storage account keys and their properties for the + * specified storage account. + */ + @JsonProperty(value = "keys", access = JsonProperty.Access.WRITE_ONLY) + private List keys; + + /** + * Get gets the list of storage account keys and their properties for the specified storage account. + * + * @return the keys value + */ + public List keys() { + return this.keys; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountsImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountsImpl.java new file mode 100644 index 000000000000..c49c2ea9aa3a --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountsImpl.java @@ -0,0 +1,216 @@ +/** + * 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. + * def + */ + +package com.microsoft.azure.management.storage.v2019_04_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.storage.v2019_04_01.StorageAccounts; +import com.microsoft.azure.management.storage.v2019_04_01.StorageAccount; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.storage.v2019_04_01.StorageAccountListKeysResult; +import com.microsoft.azure.management.storage.v2019_04_01.ListAccountSasResponse; +import com.microsoft.azure.management.storage.v2019_04_01.ListServiceSasResponse; +import com.microsoft.azure.management.storage.v2019_04_01.CheckNameAvailabilityResult; +import com.microsoft.azure.management.storage.v2019_04_01.AccountSasParameters; +import com.microsoft.azure.management.storage.v2019_04_01.ServiceSasParameters; + +class StorageAccountsImpl extends GroupableResourcesCoreImpl implements StorageAccounts { + protected StorageAccountsImpl(StorageManager manager) { + super(manager.inner().storageAccounts(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + StorageAccountsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + StorageAccountsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + StorageAccountsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + StorageAccountsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public StorageAccount call(StorageAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + StorageAccountsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + StorageAccountsInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public StorageAccount call(StorageAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public StorageAccountImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String accountName) { + StorageAccountsInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public StorageAccountListKeysResult call(StorageAccountListKeysResultInner inner) { + return new StorageAccountListKeysResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeyAsync(String resourceGroupName, String accountName, String keyName) { + StorageAccountsInner client = this.inner(); + return client.regenerateKeyAsync(resourceGroupName, accountName, keyName) + .map(new Func1() { + @Override + public StorageAccountListKeysResult call(StorageAccountListKeysResultInner inner) { + return new StorageAccountListKeysResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAccountSASAsync(String resourceGroupName, String accountName, AccountSasParameters parameters) { + StorageAccountsInner client = this.inner(); + return client.listAccountSASAsync(resourceGroupName, accountName, parameters) + .map(new Func1() { + @Override + public ListAccountSasResponse call(ListAccountSasResponseInner inner) { + return new ListAccountSasResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable listServiceSASAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters) { + StorageAccountsInner client = this.inner(); + return client.listServiceSASAsync(resourceGroupName, accountName, parameters) + .map(new Func1() { + @Override + public ListServiceSasResponse call(ListServiceSasResponseInner inner) { + return new ListServiceSasResponseImpl(inner, manager()); + } + }); + } + + @Override + public Completable failoverAsync(String resourceGroupName, String accountName) { + StorageAccountsInner client = this.inner(); + return client.failoverAsync(resourceGroupName, accountName).toCompletable(); + } + + @Override + public Completable revokeUserDelegationKeysAsync(String resourceGroupName, String accountName) { + StorageAccountsInner client = this.inner(); + return client.revokeUserDelegationKeysAsync(resourceGroupName, accountName).toCompletable(); + } + + @Override + public Observable checkNameAvailabilityAsync(String name) { + StorageAccountsInner client = this.inner(); + return client.checkNameAvailabilityAsync(name) + .map(new Func1() { + @Override + public CheckNameAvailabilityResult call(CheckNameAvailabilityResultInner inner) { + return new CheckNameAvailabilityResultImpl(inner, manager()); + } + }); + } + + @Override + protected StorageAccountImpl wrapModel(StorageAccountInner inner) { + return new StorageAccountImpl(inner.name(), inner, manager()); + } + + @Override + protected StorageAccountImpl wrapModel(String name) { + return new StorageAccountImpl(name, new StorageAccountInner(), this.manager()); + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountsInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountsInner.java new file mode 100644 index 000000000000..7174b750f392 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountsInner.java @@ -0,0 +1,1519 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.storage.v2019_04_01.AccountSasParameters; +import com.microsoft.azure.management.storage.v2019_04_01.ServiceSasParameters; +import com.microsoft.azure.management.storage.v2019_04_01.StorageAccountCheckNameAvailabilityParameters; +import com.microsoft.azure.management.storage.v2019_04_01.StorageAccountCreateParameters; +import com.microsoft.azure.management.storage.v2019_04_01.StorageAccountExpand; +import com.microsoft.azure.management.storage.v2019_04_01.StorageAccountRegenerateKeyParameters; +import com.microsoft.azure.management.storage.v2019_04_01.StorageAccountUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +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 java.util.List; +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.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in StorageAccounts. + */ +public class StorageAccountsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private StorageAccountsService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of StorageAccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StorageAccountsInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(StorageAccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for StorageAccounts to be + * used by Retrofit to perform actually REST calls. + */ + interface StorageAccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.StorageAccounts checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StorageAccountCheckNameAvailabilityParameters accountName, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.StorageAccounts create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body StorageAccountCreateParameters parameters, @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.v2019_04_01.StorageAccounts beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}") + Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body StorageAccountCreateParameters parameters, @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.v2019_04_01.StorageAccounts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.StorageAccounts getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") StorageAccountExpand expand, @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.v2019_04_01.StorageAccounts update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body StorageAccountUpdateParameters parameters, @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.v2019_04_01.StorageAccounts list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.StorageAccounts listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.StorageAccounts listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.StorageAccounts regenerateKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey") + Observable> regenerateKey(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StorageAccountRegenerateKeyParameters regenerateKey, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.StorageAccounts listAccountSAS" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas") + Observable> listAccountSAS(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body AccountSasParameters parameters, @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.v2019_04_01.StorageAccounts listServiceSAS" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas") + Observable> listServiceSAS(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body ServiceSasParameters parameters, @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.v2019_04_01.StorageAccounts failover" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover") + Observable> failover(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.StorageAccounts beginFailover" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover") + Observable> beginFailover(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.StorageAccounts revokeUserDelegationKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys") + Observable> revokeUserDelegationKeys(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param name The storage account name. + * @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 CheckNameAvailabilityResultInner object if successful. + */ + public CheckNameAvailabilityResultInner checkNameAvailability(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).toBlocking().single().body(); + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param name The storage account name. + * @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 checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback); + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param name The storage account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResultInner object + */ + public Observable checkNameAvailabilityAsync(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).map(new Func1, CheckNameAvailabilityResultInner>() { + @Override + public CheckNameAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param name The storage account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResultInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String name) { + 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."); + } + StorageAccountCheckNameAvailabilityParameters accountName = new StorageAccountCheckNameAvailabilityParameters(); + accountName.withName(name); + return service.checkNameAvailability(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), accountName, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(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); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @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 parameters to provide for the created account. + * @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 StorageAccountInner object if successful. + */ + public StorageAccountInner create(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().last().body(); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @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 parameters to provide for the created account. + * @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 createAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @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 parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, StorageAccountInner>() { + @Override + public StorageAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @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 parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters 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."); + } + 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()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @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 parameters to provide for the created account. + * @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 StorageAccountInner object if successful. + */ + public StorageAccountInner beginCreate(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @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 parameters to provide for the created account. + * @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 beginCreateAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @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 parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, StorageAccountInner>() { + @Override + public StorageAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @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 parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters 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."); + } + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a storage account in Microsoft Azure. + * + * @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 a storage account in Microsoft Azure. + * + * @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 a storage account in Microsoft Azure. + * + * @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 a storage account in Microsoft Azure. + * + * @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."); + } + 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()) + .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); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @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 StorageAccountInner object if successful. + */ + public StorageAccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @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 getByResourceGroupAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @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 StorageAccountInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, StorageAccountInner>() { + @Override + public StorageAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @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 StorageAccountInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final StorageAccountExpand expand = null; + return service.getByResourceGroup(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @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 expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats. Possible values include: 'geoReplicationStats' + * @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 StorageAccountInner object if successful. + */ + public StorageAccountInner getByResourceGroup(String resourceGroupName, String accountName, StorageAccountExpand expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName, expand).toBlocking().single().body(); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @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 expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats. Possible values include: 'geoReplicationStats' + * @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 getByResourceGroupAsync(String resourceGroupName, String accountName, StorageAccountExpand expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName, expand), serviceCallback); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @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 expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats. Possible values include: 'geoReplicationStats' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName, StorageAccountExpand expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName, expand).map(new Func1, StorageAccountInner>() { + @Override + public StorageAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @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 expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats. Possible values include: 'geoReplicationStats' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountExpand expand) { + 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 (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(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(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); + } + + /** + * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name of the storage account cannot be changed after creation. + * + * @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 parameters to provide for the updated account. + * @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 StorageAccountInner object if successful. + */ + public StorageAccountInner update(String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name of the storage account cannot be changed after creation. + * + * @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 parameters to provide for the updated account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name of the storage account cannot be changed after creation. + * + * @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 parameters to provide for the updated account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, StorageAccountInner>() { + @Override + public StorageAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name of the storage account cannot be changed after creation. + * + * @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 parameters to provide for the updated account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountUpdateParameters 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."); + } + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(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); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @return the observable to the List<StorageAccountInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @return the observable to the List<StorageAccountInner> object + */ + 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()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @return the observable to the List<StorageAccountInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @return the observable to the List<StorageAccountInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName 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 (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()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the access keys for 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 StorageAccountListKeysResultInner object if successful. + */ + public StorageAccountListKeysResultInner listKeys(String resourceGroupName, String accountName) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Lists the access keys for 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 listKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Lists the access keys for 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 StorageAccountListKeysResultInner object + */ + public Observable listKeysAsync(String resourceGroupName, String accountName) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, StorageAccountListKeysResultInner>() { + @Override + public StorageAccountListKeysResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the access keys for 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 StorageAccountListKeysResultInner object + */ + public Observable> listKeysWithServiceResponseAsync(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."); + } + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(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); + } + + /** + * Regenerates one of the access keys for 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 keyName The name of storage keys that want to be regenerated, possible values are key1, key2. + * @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 StorageAccountListKeysResultInner object if successful. + */ + public StorageAccountListKeysResultInner regenerateKey(String resourceGroupName, String accountName, String keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName).toBlocking().single().body(); + } + + /** + * Regenerates one of the access keys for 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 keyName The name of storage keys that want to be regenerated, possible values are key1, key2. + * @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 regenerateKeyAsync(String resourceGroupName, String accountName, String keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName), serviceCallback); + } + + /** + * Regenerates one of the access keys for 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 keyName The name of storage keys that want to be regenerated, possible values are key1, key2. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountListKeysResultInner object + */ + public Observable regenerateKeyAsync(String resourceGroupName, String accountName, String keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName).map(new Func1, StorageAccountListKeysResultInner>() { + @Override + public StorageAccountListKeysResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates one of the access keys for 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 keyName The name of storage keys that want to be regenerated, possible values are key1, key2. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountListKeysResultInner object + */ + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String accountName, String keyName) { + 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 (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."); + } + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeyDelegate(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); + } + + /** + * List SAS credentials of a 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 parameters The parameters to provide to list SAS credentials for the storage account. + * @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 ListAccountSasResponseInner object if successful. + */ + public ListAccountSasResponseInner listAccountSAS(String resourceGroupName, String accountName, AccountSasParameters parameters) { + return listAccountSASWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * List SAS credentials of a 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 parameters The parameters to provide to list SAS credentials for the storage account. + * @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 listAccountSASAsync(String resourceGroupName, String accountName, AccountSasParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listAccountSASWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * List SAS credentials of a 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 parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListAccountSasResponseInner object + */ + public Observable listAccountSASAsync(String resourceGroupName, String accountName, AccountSasParameters parameters) { + return listAccountSASWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, ListAccountSasResponseInner>() { + @Override + public ListAccountSasResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List SAS credentials of a 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 parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListAccountSasResponseInner object + */ + public Observable> listAccountSASWithServiceResponseAsync(String resourceGroupName, String accountName, AccountSasParameters 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."); + } + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listAccountSASDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listAccountSASDelegate(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); + } + + /** + * List service SAS credentials of a specific resource. + * + * @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 parameters to provide to list service SAS credentials. + * @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 ListServiceSasResponseInner object if successful. + */ + public ListServiceSasResponseInner listServiceSAS(String resourceGroupName, String accountName, ServiceSasParameters parameters) { + return listServiceSASWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * List service SAS credentials of a specific resource. + * + * @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 parameters to provide to list service SAS credentials. + * @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 listServiceSASAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listServiceSASWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * List service SAS credentials of a specific resource. + * + * @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 parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListServiceSasResponseInner object + */ + public Observable listServiceSASAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters) { + return listServiceSASWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, ListServiceSasResponseInner>() { + @Override + public ListServiceSasResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List service SAS credentials of a specific resource. + * + * @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 parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListServiceSasResponseInner object + */ + public Observable> listServiceSASWithServiceResponseAsync(String resourceGroupName, String accountName, ServiceSasParameters 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."); + } + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listServiceSASDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listServiceSASDelegate(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); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @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 failover(String resourceGroupName, String accountName) { + failoverWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().last().body(); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @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 failoverAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(failoverWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @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 + */ + public Observable failoverAsync(String resourceGroupName, String accountName) { + return failoverWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @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 + */ + public Observable> failoverWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.failover(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @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 beginFailover(String resourceGroupName, String accountName) { + beginFailoverWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @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 beginFailoverAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginFailoverWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @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 beginFailoverAsync(String resourceGroupName, String accountName) { + return beginFailoverWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @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> beginFailoverWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginFailover(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginFailoverDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginFailoverDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Revoke user delegation keys. + * + * @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 revokeUserDelegationKeys(String resourceGroupName, String accountName) { + revokeUserDelegationKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Revoke user delegation keys. + * + * @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 revokeUserDelegationKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(revokeUserDelegationKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Revoke user delegation keys. + * + * @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 revokeUserDelegationKeysAsync(String resourceGroupName, String accountName) { + return revokeUserDelegationKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Revoke user delegation keys. + * + * @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> revokeUserDelegationKeysWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.revokeUserDelegationKeys(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = revokeUserDelegationKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse revokeUserDelegationKeysDelegate(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/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageManagementClientImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageManagementClientImpl.java new file mode 100644 index 000000000000..13881958034f --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageManagementClientImpl.java @@ -0,0 +1,280 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the StorageManagementClientImpl class. + */ +public class StorageManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The ID of the target subscription. */ + private String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public StorageManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = 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; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public StorageManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public StorageManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public StorageManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The SkusInner object to access its operations. + */ + private SkusInner skus; + + /** + * Gets the SkusInner object to access its operations. + * @return the SkusInner object. + */ + public SkusInner skus() { + return this.skus; + } + + /** + * The StorageAccountsInner object to access its operations. + */ + private StorageAccountsInner storageAccounts; + + /** + * Gets the StorageAccountsInner object to access its operations. + * @return the StorageAccountsInner object. + */ + public StorageAccountsInner storageAccounts() { + return this.storageAccounts; + } + + /** + * The UsagesInner object to access its operations. + */ + private UsagesInner usages; + + /** + * Gets the UsagesInner object to access its operations. + * @return the UsagesInner object. + */ + public UsagesInner usages() { + return this.usages; + } + + /** + * 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; + } + + /** + * 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. + */ + private BlobContainersInner blobContainers; + + /** + * Gets the BlobContainersInner object to access its operations. + * @return the BlobContainersInner object. + */ + public BlobContainersInner blobContainers() { + return this.blobContainers; + } + + /** + * Initializes an instance of StorageManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public StorageManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of StorageManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public StorageManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of StorageManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public StorageManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2019-04-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.skus = new SkusInner(restClient().retrofit(), this); + this.storageAccounts = new StorageAccountsInner(restClient().retrofit(), this); + this.usages = new UsagesInner(restClient().retrofit(), this); + this.managementPolicies = new ManagementPoliciesInner(restClient().retrofit(), this); + this.blobServices = new BlobServicesInner(restClient().retrofit(), this); + this.blobContainers = new BlobContainersInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "StorageManagementClient", "2019-04-01"); + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageManager.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageManager.java new file mode 100644 index 000000000000..79b3aaca331e --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageManager.java @@ -0,0 +1,171 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.storage.v2019_04_01.Operations; +import com.microsoft.azure.management.storage.v2019_04_01.Skus; +import com.microsoft.azure.management.storage.v2019_04_01.StorageAccounts; +import com.microsoft.azure.management.storage.v2019_04_01.Usages; +import com.microsoft.azure.management.storage.v2019_04_01.ManagementPolicies; +import com.microsoft.azure.management.storage.v2019_04_01.BlobServices; +import com.microsoft.azure.management.storage.v2019_04_01.BlobContainers; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Storage resource management. + */ +public final class StorageManager extends ManagerCore { + private Operations operations; + private Skus skus; + private StorageAccounts storageAccounts; + private Usages usages; + private ManagementPolicies managementPolicies; + private BlobServices blobServices; + private BlobContainers blobContainers; + /** + * Get a Configurable instance that can be used to create StorageManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new StorageManager.ConfigurableImpl(); + } + /** + * Creates an instance of StorageManager that exposes Storage resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the StorageManager + */ + public static StorageManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new StorageManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of StorageManager that exposes Storage resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the StorageManager + */ + public static StorageManager authenticate(RestClient restClient, String subscriptionId) { + return new StorageManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of StorageManager that exposes Storage management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Storage management API entry points that work across subscriptions + */ + StorageManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Skus. + */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(this); + } + return this.skus; + } + + /** + * @return Entry point to manage StorageAccounts. + */ + public StorageAccounts storageAccounts() { + if (this.storageAccounts == null) { + this.storageAccounts = new StorageAccountsImpl(this); + } + return this.storageAccounts; + } + + /** + * @return Entry point to manage Usages. + */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(this); + } + return this.usages; + } + + /** + * @return Entry point to manage ManagementPolicies. + */ + public ManagementPolicies managementPolicies() { + if (this.managementPolicies == null) { + this.managementPolicies = new ManagementPoliciesImpl(this); + } + return this.managementPolicies; + } + + /** + * @return Entry point to manage BlobServices. + */ + public BlobServices blobServices() { + if (this.blobServices == null) { + this.blobServices = new BlobServicesImpl(this); + } + return this.blobServices; + } + + /** + * @return Entry point to manage BlobContainers. + */ + public BlobContainers blobContainers() { + if (this.blobContainers == null) { + this.blobContainers = new BlobContainersImpl(this); + } + return this.blobContainers; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public StorageManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return StorageManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private StorageManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new StorageManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/UsageImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/UsageImpl.java new file mode 100644 index 000000000000..e0fd507c892e --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/UsageImpl.java @@ -0,0 +1,52 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.Usage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_04_01.UsageName; +import com.microsoft.azure.management.storage.v2019_04_01.UsageUnit; + +class UsageImpl extends WrapperImpl implements Usage { + private final StorageManager manager; + + UsageImpl(UsageInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + + + @Override + public Integer currentValue() { + return this.inner().currentValue(); + } + + @Override + public Integer limit() { + return this.inner().limit(); + } + + @Override + public UsageName name() { + return this.inner().name(); + } + + @Override + public UsageUnit unit() { + return this.inner().unit(); + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/UsageInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/UsageInner.java new file mode 100644 index 000000000000..3b7ad077b6b4 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/UsageInner.java @@ -0,0 +1,81 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.management.storage.v2019_04_01.UsageUnit; +import com.microsoft.azure.management.storage.v2019_04_01.UsageName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes Storage Resource Usage. + */ +public class UsageInner { + /** + * Gets the unit of measurement. Possible values include: 'Count', 'Bytes', + * 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private UsageUnit unit; + + /** + * Gets the current count of the allocated resources in the subscription. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Integer currentValue; + + /** + * Gets the maximum count of the resources that can be allocated in the + * subscription. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Integer limit; + + /** + * Gets the name of the type of usage. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private UsageName name; + + /** + * Get gets the unit of measurement. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'. + * + * @return the unit value + */ + public UsageUnit unit() { + return this.unit; + } + + /** + * Get gets the current count of the allocated resources in the subscription. + * + * @return the currentValue value + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Get gets the maximum count of the resources that can be allocated in the subscription. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Get gets the name of the type of usage. + * + * @return the name value + */ + public UsageName name() { + return this.name; + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/UsagesImpl.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/UsagesImpl.java new file mode 100644 index 000000000000..5c9e32de4d54 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/UsagesImpl.java @@ -0,0 +1,53 @@ +/** + * 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.v2019_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_04_01.Usages; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_04_01.Usage; + +class UsagesImpl extends WrapperImpl implements Usages { + private final StorageManager manager; + + UsagesImpl(StorageManager manager) { + super(manager.inner().usages()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + private UsageImpl wrapModel(UsageInner inner) { + return new UsageImpl(inner, manager()); + } + + @Override + public Observable listByLocationAsync(String location) { + UsagesInner client = this.inner(); + return client.listByLocationAsync(location) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Usage call(UsageInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/UsagesInner.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/UsagesInner.java new file mode 100644 index 000000000000..0212688ec8a0 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/UsagesInner.java @@ -0,0 +1,145 @@ +/** + * 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.v2019_04_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 java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +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 Usages. + */ +public class UsagesInner { + /** The Retrofit service to perform REST calls. */ + private UsagesService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of UsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public UsagesInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(UsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Usages to be + * used by Retrofit to perform actually REST calls. + */ + interface UsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.Usages listByLocation" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages") + Observable> listByLocation(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @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 List<UsageInner> object if successful. + */ + public List listByLocation(String location) { + return listByLocationWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByLocationAsync(String location, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByLocationWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable> listByLocationAsync(String location) { + return listByLocationWithServiceResponseAsync(location).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable>> listByLocationWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + 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()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByLocationDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByLocationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/package-info.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/package-info.java new file mode 100644 index 000000000000..e73c210091b7 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/package-info.java @@ -0,0 +1,11 @@ +// 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. + +/** + * This package contains the implementation classes for StorageManagementClient. + * The Azure Storage Management API. + */ +package com.microsoft.azure.management.storage.v2019_04_01.implementation; diff --git a/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/package-info.java b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/package-info.java new file mode 100644 index 000000000000..d4263e503222 --- /dev/null +++ b/storage/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/package-info.java @@ -0,0 +1,11 @@ +// 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. + +/** + * This package contains the classes for StorageManagementClient. + * The Azure Storage Management API. + */ +package com.microsoft.azure.management.storage.v2019_04_01;