diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/AccountSasParameters.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/AccountSasParameters.java new file mode 100644 index 00000000000..12fd40e3346 --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/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; + +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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/AzureEntityResource.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/AzureEntityResource.java new file mode 100644 index 00000000000..f7cdc6f3149 --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/AzureEntityResource.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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource model definition for a Azure Resource Manager resource with an + * etag. + */ +public class AzureEntityResource extends AzureResource { + /** + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the etag value. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/AzureResource.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/AzureResource.java new file mode 100644 index 00000000000..0fda136de18 --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/AzureResource.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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An Azure Resource Manager resource. + */ +public class AzureResource { + /** + * Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The name of the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The type of the resource. Ex- Microsoft.Compute/virtualMachines or + * Microsoft.Storage/storageAccounts. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java new file mode 100644 index 00000000000..816d3144db4 --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/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; + +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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/BlobContainersDeleteImmutabilityPolicyHeaders.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/BlobContainersDeleteImmutabilityPolicyHeaders.java new file mode 100644 index 00000000000..282a444955a --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/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; + +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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/BlobContainersExtendImmutabilityPolicyHeaders.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/BlobContainersExtendImmutabilityPolicyHeaders.java new file mode 100644 index 00000000000..80930f5683f --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/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; + +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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/BlobContainersGetImmutabilityPolicyHeaders.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/BlobContainersGetImmutabilityPolicyHeaders.java new file mode 100644 index 00000000000..1cc5641bf1b --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/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; + +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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/BlobContainersLockImmutabilityPolicyHeaders.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/BlobContainersLockImmutabilityPolicyHeaders.java new file mode 100644 index 00000000000..0e79395735b --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/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; + +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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/CustomDomain.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/CustomDomain.java index 6ad0b15d389..d2e501195da 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/CustomDomain.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/CustomDomain.java @@ -30,7 +30,7 @@ public class CustomDomain { private Boolean useSubDomain; /** - * Get the name value. + * Get gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. * * @return the name value */ @@ -39,7 +39,7 @@ public String name() { } /** - * Set the name value. + * 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. @@ -50,7 +50,7 @@ public CustomDomain withName(String name) { } /** - * Get the useSubDomain value. + * Get indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. * * @return the useSubDomain value */ @@ -59,7 +59,7 @@ public Boolean useSubDomain() { } /** - * Set the useSubDomain value. + * 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 * @return the CustomDomain object itself. diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/Dimension.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/Dimension.java index 4ff16f095d3..64a89816e65 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/Dimension.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/Dimension.java @@ -27,7 +27,7 @@ public class Dimension { private String displayName; /** - * Get the name value. + * Get display name of dimension. * * @return the name value */ @@ -36,7 +36,7 @@ public String name() { } /** - * Set the name value. + * Set display name of dimension. * * @param name the name value to set * @return the Dimension object itself. @@ -47,7 +47,7 @@ public Dimension withName(String name) { } /** - * Get the displayName value. + * Get display name of dimension. * * @return the displayName value */ @@ -56,7 +56,7 @@ public String displayName() { } /** - * Set the displayName value. + * Set display name of dimension. * * @param displayName the displayName value to set * @return the Dimension object itself. diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/Encryption.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/Encryption.java index 3b63626f92e..aefb3d4bbbe 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/Encryption.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/Encryption.java @@ -35,7 +35,7 @@ public class Encryption { private KeyVaultProperties keyVaultProperties; /** - * Get the services value. + * Get list of services which support encryption. * * @return the services value */ @@ -44,7 +44,7 @@ public EncryptionServices services() { } /** - * Set the services value. + * Set list of services which support encryption. * * @param services the services value to set * @return the Encryption object itself. @@ -55,7 +55,7 @@ public Encryption withServices(EncryptionServices services) { } /** - * Get the keySource value. + * Get the encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. * * @return the keySource value */ @@ -64,7 +64,7 @@ public KeySource keySource() { } /** - * Set the keySource value. + * 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. @@ -75,7 +75,7 @@ public Encryption withKeySource(KeySource keySource) { } /** - * Get the keyVaultProperties value. + * Get properties provided by key vault. * * @return the keyVaultProperties value */ @@ -84,7 +84,7 @@ public KeyVaultProperties keyVaultProperties() { } /** - * Set the keyVaultProperties value. + * Set properties provided by key vault. * * @param keyVaultProperties the keyVaultProperties value to set * @return the Encryption object itself. diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/EncryptionService.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/EncryptionService.java index a528345c53d..d74aa576af2 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/EncryptionService.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/EncryptionService.java @@ -32,7 +32,7 @@ public class EncryptionService { private DateTime lastEnabledTime; /** - * Get the enabled value. + * Get a boolean indicating whether or not the service encrypts the data as it is stored. * * @return the enabled value */ @@ -41,7 +41,7 @@ public Boolean enabled() { } /** - * Set the enabled value. + * 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. @@ -52,7 +52,7 @@ public EncryptionService withEnabled(Boolean enabled) { } /** - * Get the lastEnabledTime value. + * 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 */ diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/EncryptionServices.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/EncryptionServices.java index 2fa5712808a..b56a9e5446a 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/EncryptionServices.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/EncryptionServices.java @@ -39,7 +39,7 @@ public class EncryptionServices { private EncryptionService queue; /** - * Get the blob value. + * Get the encryption function of the blob storage service. * * @return the blob value */ @@ -48,7 +48,7 @@ public EncryptionService blob() { } /** - * Set the blob value. + * Set the encryption function of the blob storage service. * * @param blob the blob value to set * @return the EncryptionServices object itself. @@ -59,7 +59,7 @@ public EncryptionServices withBlob(EncryptionService blob) { } /** - * Get the file value. + * Get the encryption function of the file storage service. * * @return the file value */ @@ -68,7 +68,7 @@ public EncryptionService file() { } /** - * Set the file value. + * Set the encryption function of the file storage service. * * @param file the file value to set * @return the EncryptionServices object itself. @@ -79,7 +79,7 @@ public EncryptionServices withFile(EncryptionService file) { } /** - * Get the table value. + * Get the encryption function of the table storage service. * * @return the table value */ @@ -88,7 +88,7 @@ public EncryptionService table() { } /** - * Get the queue value. + * Get the encryption function of the queue storage service. * * @return the queue value */ diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/Endpoints.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/Endpoints.java index 79b2415bf79..1d34e73ce3e 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/Endpoints.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/Endpoints.java @@ -40,7 +40,7 @@ public class Endpoints { private String file; /** - * Get the blob value. + * Get gets the blob endpoint. * * @return the blob value */ @@ -49,7 +49,7 @@ public String blob() { } /** - * Get the queue value. + * Get gets the queue endpoint. * * @return the queue value */ @@ -58,7 +58,7 @@ public String queue() { } /** - * Get the table value. + * Get gets the table endpoint. * * @return the table value */ @@ -67,7 +67,7 @@ public String table() { } /** - * Get the file value. + * Get gets the file endpoint. * * @return the file value */ diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/IPRule.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/IPRule.java index fdbfff33bca..17736e080f4 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/IPRule.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/IPRule.java @@ -28,7 +28,7 @@ public class IPRule { private Action action; /** - * Get the iPAddressOrRange value. + * Get specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. * * @return the iPAddressOrRange value */ @@ -37,7 +37,7 @@ public String iPAddressOrRange() { } /** - * Set the iPAddressOrRange value. + * 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. @@ -48,7 +48,7 @@ public IPRule withIPAddressOrRange(String iPAddressOrRange) { } /** - * Get the action value. + * Get the action of IP ACL rule. Possible values include: 'Allow'. * * @return the action value */ @@ -57,7 +57,7 @@ public Action action() { } /** - * Set the action value. + * Set the action of IP ACL rule. Possible values include: 'Allow'. * * @param action the action value to set * @return the IPRule object itself. diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/Identity.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/Identity.java index 8b61e08b2cc..8ec974600eb 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/Identity.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/Identity.java @@ -40,7 +40,7 @@ public Identity() { } /** - * Get the principalId value. + * Get the principal ID of resource identity. * * @return the principalId value */ @@ -49,7 +49,7 @@ public String principalId() { } /** - * Get the tenantId value. + * Get the tenant ID of resource. * * @return the tenantId value */ @@ -58,7 +58,7 @@ public String tenantId() { } /** - * Get the type value. + * Get the identity type. * * @return the type value */ @@ -67,7 +67,7 @@ public String type() { } /** - * Set the type value. + * Set the identity type. * * @param type the type value to set * @return the Identity object itself. diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/ImmutabilityPolicyProperties.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/ImmutabilityPolicyProperties.java new file mode 100644 index 00000000000..df18c6ac407 --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/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; + +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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/ImmutabilityPolicyState.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/ImmutabilityPolicyState.java new file mode 100644 index 00000000000..372a511fc5f --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/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; + +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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/ImmutabilityPolicyUpdateType.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/ImmutabilityPolicyUpdateType.java new file mode 100644 index 00000000000..41855f47074 --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/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; + +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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/KeyVaultProperties.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/KeyVaultProperties.java index bf28ccba56a..0124717daf3 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/KeyVaultProperties.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/KeyVaultProperties.java @@ -33,7 +33,7 @@ public class KeyVaultProperties { private String keyVaultUri; /** - * Get the keyName value. + * Get the name of KeyVault key. * * @return the keyName value */ @@ -42,7 +42,7 @@ public String keyName() { } /** - * Set the keyName value. + * Set the name of KeyVault key. * * @param keyName the keyName value to set * @return the KeyVaultProperties object itself. @@ -53,7 +53,7 @@ public KeyVaultProperties withKeyName(String keyName) { } /** - * Get the keyVersion value. + * Get the version of KeyVault key. * * @return the keyVersion value */ @@ -62,7 +62,7 @@ public String keyVersion() { } /** - * Set the keyVersion value. + * Set the version of KeyVault key. * * @param keyVersion the keyVersion value to set * @return the KeyVaultProperties object itself. @@ -73,7 +73,7 @@ public KeyVaultProperties withKeyVersion(String keyVersion) { } /** - * Get the keyVaultUri value. + * Get the Uri of KeyVault. * * @return the keyVaultUri value */ @@ -82,7 +82,7 @@ public String keyVaultUri() { } /** - * Set the keyVaultUri value. + * Set the Uri of KeyVault. * * @param keyVaultUri the keyVaultUri value to set * @return the KeyVaultProperties object itself. diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/LeaseDuration.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/LeaseDuration.java new file mode 100644 index 00000000000..7dc337596ac --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/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; + +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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/LeaseState.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/LeaseState.java new file mode 100644 index 00000000000..6a68b99b475 --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/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; + +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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/LeaseStatus.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/LeaseStatus.java new file mode 100644 index 00000000000..a1fc414a8b4 --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/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; + +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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/LegalHoldProperties.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/LegalHoldProperties.java new file mode 100644 index 00000000000..946521b16d3 --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/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; + +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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/ListContainerItem.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/ListContainerItem.java new file mode 100644 index 00000000000..8dd4b98fa64 --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/ListContainerItem.java @@ -0,0 +1,206 @@ +/** + * 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; + +import org.joda.time.DateTime; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.storage.implementation.AzureEntityResourceInner; + +/** + * The blob container properties be listed out. + */ +@JsonFlatten +public class ListContainerItem extends AzureEntityResourceInner { + /** + * 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 ListContainerItem object itself. + */ + public ListContainerItem 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 ListContainerItem object itself. + */ + public ListContainerItem 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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/ManagementPoliciesRulesSetParameter.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/ManagementPoliciesRulesSetParameter.java new file mode 100644 index 00000000000..67d438a3d05 --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/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; + +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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/MetricSpecification.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/MetricSpecification.java index 8be7985c122..97bd96b37ba 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/MetricSpecification.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/MetricSpecification.java @@ -70,7 +70,7 @@ public class MetricSpecification { private String resourceIdDimensionNameOverride; /** - * Get the name value. + * Get name of metric specification. * * @return the name value */ @@ -79,7 +79,7 @@ public String name() { } /** - * Set the name value. + * Set name of metric specification. * * @param name the name value to set * @return the MetricSpecification object itself. @@ -90,7 +90,7 @@ public MetricSpecification withName(String name) { } /** - * Get the displayName value. + * Get display name of metric specification. * * @return the displayName value */ @@ -99,7 +99,7 @@ public String displayName() { } /** - * Set the displayName value. + * Set display name of metric specification. * * @param displayName the displayName value to set * @return the MetricSpecification object itself. @@ -110,7 +110,7 @@ public MetricSpecification withDisplayName(String displayName) { } /** - * Get the displayDescription value. + * Get display description of metric specification. * * @return the displayDescription value */ @@ -119,7 +119,7 @@ public String displayDescription() { } /** - * Set the displayDescription value. + * Set display description of metric specification. * * @param displayDescription the displayDescription value to set * @return the MetricSpecification object itself. @@ -130,7 +130,7 @@ public MetricSpecification withDisplayDescription(String displayDescription) { } /** - * Get the unit value. + * Get unit could be Bytes or Count. * * @return the unit value */ @@ -139,7 +139,7 @@ public String unit() { } /** - * Set the unit value. + * Set unit could be Bytes or Count. * * @param unit the unit value to set * @return the MetricSpecification object itself. @@ -150,7 +150,7 @@ public MetricSpecification withUnit(String unit) { } /** - * Get the dimensions value. + * Get dimensions of blobs, including blob type and access tier. * * @return the dimensions value */ @@ -159,7 +159,7 @@ public List dimensions() { } /** - * Set the dimensions value. + * Set dimensions of blobs, including blob type and access tier. * * @param dimensions the dimensions value to set * @return the MetricSpecification object itself. @@ -170,7 +170,7 @@ public MetricSpecification withDimensions(List dimensions) { } /** - * Get the aggregationType value. + * Get aggregation type could be Average. * * @return the aggregationType value */ @@ -179,7 +179,7 @@ public String aggregationType() { } /** - * Set the aggregationType value. + * Set aggregation type could be Average. * * @param aggregationType the aggregationType value to set * @return the MetricSpecification object itself. @@ -190,7 +190,7 @@ public MetricSpecification withAggregationType(String aggregationType) { } /** - * Get the fillGapWithZero value. + * Get the property to decide fill gap with zero or not. * * @return the fillGapWithZero value */ @@ -199,7 +199,7 @@ public Boolean fillGapWithZero() { } /** - * Set the fillGapWithZero value. + * Set the property to decide fill gap with zero or not. * * @param fillGapWithZero the fillGapWithZero value to set * @return the MetricSpecification object itself. @@ -210,7 +210,7 @@ public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { } /** - * Get the category value. + * Get the category this metric specification belong to, could be Capacity. * * @return the category value */ @@ -219,7 +219,7 @@ public String category() { } /** - * Set the category value. + * Set the category this metric specification belong to, could be Capacity. * * @param category the category value to set * @return the MetricSpecification object itself. @@ -230,7 +230,7 @@ public MetricSpecification withCategory(String category) { } /** - * Get the resourceIdDimensionNameOverride value. + * Get account Resource Id. * * @return the resourceIdDimensionNameOverride value */ @@ -239,7 +239,7 @@ public String resourceIdDimensionNameOverride() { } /** - * Set the resourceIdDimensionNameOverride value. + * Set account Resource Id. * * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set * @return the MetricSpecification object itself. diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/NetworkRuleSet.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/NetworkRuleSet.java index dc4b07ca939..2682002e112 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/NetworkRuleSet.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/NetworkRuleSet.java @@ -45,7 +45,7 @@ public class NetworkRuleSet { private DefaultAction defaultAction; /** - * Get the bypass value. + * 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 */ @@ -54,7 +54,7 @@ public Bypass bypass() { } /** - * Set the bypass value. + * 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. @@ -65,7 +65,7 @@ public NetworkRuleSet withBypass(Bypass bypass) { } /** - * Get the virtualNetworkRules value. + * Get sets the virtual network rules. * * @return the virtualNetworkRules value */ @@ -74,7 +74,7 @@ public List virtualNetworkRules() { } /** - * Set the virtualNetworkRules value. + * Set sets the virtual network rules. * * @param virtualNetworkRules the virtualNetworkRules value to set * @return the NetworkRuleSet object itself. @@ -85,7 +85,7 @@ public NetworkRuleSet withVirtualNetworkRules(List virtualNe } /** - * Get the ipRules value. + * Get sets the IP ACL rules. * * @return the ipRules value */ @@ -94,7 +94,7 @@ public List ipRules() { } /** - * Set the ipRules value. + * Set sets the IP ACL rules. * * @param ipRules the ipRules value to set * @return the NetworkRuleSet object itself. @@ -105,7 +105,7 @@ public NetworkRuleSet withIpRules(List ipRules) { } /** - * Get the defaultAction value. + * Get specifies the default action of allow or deny when no other rules match. Possible values include: 'Allow', 'Deny'. * * @return the defaultAction value */ @@ -114,7 +114,7 @@ public DefaultAction defaultAction() { } /** - * Set the defaultAction value. + * 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. diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/OperationDisplay.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/OperationDisplay.java index d535b38c645..6aa22daf3d4 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/OperationDisplay.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/OperationDisplay.java @@ -33,7 +33,7 @@ public class OperationDisplay { private String operation; /** - * Get the provider value. + * Get service provider: Microsoft Storage. * * @return the provider value */ @@ -42,7 +42,7 @@ public String provider() { } /** - * Set the provider value. + * Set service provider: Microsoft Storage. * * @param provider the provider value to set * @return the OperationDisplay object itself. @@ -53,7 +53,7 @@ public OperationDisplay withProvider(String provider) { } /** - * Get the resource value. + * Get resource on which the operation is performed etc. * * @return the resource value */ @@ -62,7 +62,7 @@ public String resource() { } /** - * Set the resource value. + * Set resource on which the operation is performed etc. * * @param resource the resource value to set * @return the OperationDisplay object itself. @@ -73,7 +73,7 @@ public OperationDisplay withResource(String resource) { } /** - * Get the operation value. + * Get type of operation: get, read, delete, etc. * * @return the operation value */ @@ -82,7 +82,7 @@ public String operation() { } /** - * Set the operation value. + * Set type of operation: get, read, delete, etc. * * @param operation the operation value to set * @return the OperationDisplay object itself. diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/PublicAccess.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/PublicAccess.java new file mode 100644 index 00000000000..f6d53d58584 --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/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; + +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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/Restriction.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/Restriction.java index 15fce9b59fd..a62934cef98 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/Restriction.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/Restriction.java @@ -40,7 +40,7 @@ public class Restriction { private ReasonCode reasonCode; /** - * Get the type value. + * Get the type of restrictions. As of now only possible value for this is location. * * @return the type value */ @@ -49,7 +49,7 @@ public String type() { } /** - * Get the values value. + * 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 */ @@ -58,7 +58,7 @@ public List values() { } /** - * Get the reasonCode value. + * 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 */ @@ -67,7 +67,7 @@ public ReasonCode reasonCode() { } /** - * Set the reasonCode value. + * 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. diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/SKUCapability.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/SKUCapability.java index 999fe48e9e9..6fc3344ecd4 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/SKUCapability.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/SKUCapability.java @@ -30,7 +30,7 @@ public class SKUCapability { private String value; /** - * Get the name 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 */ @@ -39,7 +39,7 @@ public String name() { } /** - * Get the value value. + * Get a string value to indicate states of given capability. Possibly 'true' or 'false'. * * @return the value value */ diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/ServiceSasParameters.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/ServiceSasParameters.java new file mode 100644 index 00000000000..b939e509689 --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/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; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters to list service SAS credentials of a speicific 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", required = true) + 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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/ServiceSpecification.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/ServiceSpecification.java index 495b287b18f..01f13661070 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/ServiceSpecification.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/ServiceSpecification.java @@ -22,7 +22,7 @@ public class ServiceSpecification { private List metricSpecifications; /** - * Get the metricSpecifications value. + * Get metric specifications of operation. * * @return the metricSpecifications value */ @@ -31,7 +31,7 @@ public List metricSpecifications() { } /** - * Set the metricSpecifications value. + * Set metric specifications of operation. * * @param metricSpecifications the metricSpecifications value to set * @return the ServiceSpecification object itself. diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountCheckNameAvailabilityParameters.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountCheckNameAvailabilityParameters.java index 11c95edcb1c..7e227371b55 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountCheckNameAvailabilityParameters.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountCheckNameAvailabilityParameters.java @@ -28,13 +28,14 @@ public class StorageAccountCheckNameAvailabilityParameters { /** * Creates an instance of StorageAccountCheckNameAvailabilityParameters class. + * @param name the storage account name. */ public StorageAccountCheckNameAvailabilityParameters() { type = "Microsoft.Storage/storageAccounts"; } /** - * Get the name value. + * Get the storage account name. * * @return the name value */ @@ -43,7 +44,7 @@ public String name() { } /** - * Set the name value. + * Set the storage account name. * * @param name the name value to set * @return the StorageAccountCheckNameAvailabilityParameters object itself. @@ -54,7 +55,7 @@ public StorageAccountCheckNameAvailabilityParameters withName(String name) { } /** - * Get the type value. + * Get the type of resource, Microsoft.Storage/storageAccounts. * * @return the type value */ @@ -63,7 +64,7 @@ public String type() { } /** - * Set the type value. + * Set the type of resource, Microsoft.Storage/storageAccounts. * * @param type the type value to set * @return the StorageAccountCheckNameAvailabilityParameters object itself. diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountCreateParameters.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountCreateParameters.java new file mode 100644 index 00000000000..b8358ee8060 --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountCreateParameters.java @@ -0,0 +1,296 @@ +/** + * 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; + +import com.microsoft.azure.management.storage.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'. + */ + @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; + + /** + * Allows https traffic only to storage service if sets to true. + */ + @JsonProperty(value = "properties.supportsHttpsTrafficOnly") + private Boolean enableHttpsTrafficOnly; + + /** + * 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'. + * + * @return the kind value + */ + public Kind kind() { + return this.kind; + } + + /** + * Set required. Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. + * + * @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 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 StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; + return this; + } + +} diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountKey.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountKey.java index ebb46e7c767..dab504e323c 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountKey.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountKey.java @@ -34,7 +34,7 @@ public class StorageAccountKey { private KeyPermission permissions; /** - * Get the keyName value. + * Get name of the key. * * @return the keyName value */ @@ -43,7 +43,7 @@ public String keyName() { } /** - * Get the value value. + * Get base 64-encoded value of the key. * * @return the value value */ @@ -52,7 +52,7 @@ public String value() { } /** - * Get the permissions value. + * Get permissions for the key -- read-only or full permissions. Possible values include: 'Read', 'Full'. * * @return the permissions value */ diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountRegenerateKeyParameters.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountRegenerateKeyParameters.java index a42820d0a95..1db38cb5019 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountRegenerateKeyParameters.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountRegenerateKeyParameters.java @@ -22,7 +22,7 @@ public class StorageAccountRegenerateKeyParameters { private String keyName; /** - * Get the keyName value. + * Get the name of storage keys that want to be regenerated, possible vaules are key1, key2. * * @return the keyName value */ @@ -31,7 +31,7 @@ public String keyName() { } /** - * Set the keyName value. + * Set the name of storage keys that want to be regenerated, possible vaules are key1, key2. * * @param keyName the keyName value to set * @return the StorageAccountRegenerateKeyParameters object itself. diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountUpdateParameters.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountUpdateParameters.java new file mode 100644 index 00000000000..4922206de22 --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/StorageAccountUpdateParameters.java @@ -0,0 +1,269 @@ +/** + * 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; + +import com.microsoft.azure.management.storage.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 or Premium_LRS, 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; + + /** + * 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'. + */ + @JsonProperty(value = "kind") + private Kind kind; + + /** + * Get gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS or Premium_LRS, 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 or Premium_LRS, 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 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'. + * + * @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'. + * + * @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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/TagProperty.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/TagProperty.java new file mode 100644 index 00000000000..51498128ec2 --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/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; + +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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/UpdateHistoryProperty.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/UpdateHistoryProperty.java new file mode 100644 index 00000000000..39eab3d5ced --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/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; + +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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/UsageName.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/UsageName.java index 38db9a4bb28..d244ba68f43 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/UsageName.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/UsageName.java @@ -27,7 +27,7 @@ public class UsageName { private String localizedValue; /** - * Get the value value. + * Get gets a string describing the resource name. * * @return the value value */ @@ -36,7 +36,7 @@ public String value() { } /** - * Get the localizedValue value. + * Get gets a localized string describing the resource name. * * @return the localizedValue value */ diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/VirtualNetworkRule.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/VirtualNetworkRule.java index d05b2a46f58..c4ae50cc44b 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/VirtualNetworkRule.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/VirtualNetworkRule.java @@ -36,7 +36,7 @@ public class VirtualNetworkRule { private State state; /** - * Get the virtualNetworkResourceId value. + * Get resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. * * @return the virtualNetworkResourceId value */ @@ -45,7 +45,7 @@ public String virtualNetworkResourceId() { } /** - * Set the virtualNetworkResourceId value. + * 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. @@ -56,7 +56,7 @@ public VirtualNetworkRule withVirtualNetworkResourceId(String virtualNetworkReso } /** - * Get the action value. + * Get the action of virtual network rule. Possible values include: 'Allow'. * * @return the action value */ @@ -65,7 +65,7 @@ public Action action() { } /** - * Set the action value. + * Set the action of virtual network rule. Possible values include: 'Allow'. * * @param action the action value to set * @return the VirtualNetworkRule object itself. @@ -76,7 +76,7 @@ public VirtualNetworkRule withAction(Action action) { } /** - * Get the state value. + * Get gets the state of virtual network rule. Possible values include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', 'networkSourceDeleted'. * * @return the state value */ @@ -85,7 +85,7 @@ public State state() { } /** - * Set the state value. + * 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. diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/AzureEntityResourceInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/AzureEntityResourceInner.java new file mode 100644 index 00000000000..034dec5643b --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/AzureEntityResourceInner.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.implementation; + +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 AzureEntityResourceInner 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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainerInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainerInner.java new file mode 100644 index 00000000000..728588e638d --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainerInner.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.implementation; + +import com.microsoft.azure.management.storage.PublicAccess; +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.LeaseStatus; +import com.microsoft.azure.management.storage.LeaseState; +import com.microsoft.azure.management.storage.LeaseDuration; +import java.util.Map; +import com.microsoft.azure.management.storage.ImmutabilityPolicyProperties; +import com.microsoft.azure.management.storage.LegalHoldProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Properties of the blob container, including Id, resource name, resource + * type, Etag. + */ +@JsonFlatten +public class BlobContainerInner extends AzureEntityResourceInner { + /** + * 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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainersCreateOrUpdateImmutabilityPolicyHeadersInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainersCreateOrUpdateImmutabilityPolicyHeadersInner.java new file mode 100644 index 00000000000..0a1496bb409 --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainersCreateOrUpdateImmutabilityPolicyHeadersInner.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.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for CreateOrUpdateImmutabilityPolicy operation. + */ +public class BlobContainersCreateOrUpdateImmutabilityPolicyHeadersInner { + /** + * 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 value. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the eTag value. + * + * @param eTag the eTag value to set + * @return the BlobContainersCreateOrUpdateImmutabilityPolicyHeadersInner object itself. + */ + public BlobContainersCreateOrUpdateImmutabilityPolicyHeadersInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainersDeleteImmutabilityPolicyHeadersInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainersDeleteImmutabilityPolicyHeadersInner.java new file mode 100644 index 00000000000..429e572174c --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainersDeleteImmutabilityPolicyHeadersInner.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.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for DeleteImmutabilityPolicy operation. + */ +public class BlobContainersDeleteImmutabilityPolicyHeadersInner { + /** + * 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 value. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the eTag value. + * + * @param eTag the eTag value to set + * @return the BlobContainersDeleteImmutabilityPolicyHeadersInner object itself. + */ + public BlobContainersDeleteImmutabilityPolicyHeadersInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainersExtendImmutabilityPolicyHeadersInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainersExtendImmutabilityPolicyHeadersInner.java new file mode 100644 index 00000000000..58707fededf --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainersExtendImmutabilityPolicyHeadersInner.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.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for ExtendImmutabilityPolicy operation. + */ +public class BlobContainersExtendImmutabilityPolicyHeadersInner { + /** + * 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 value. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the eTag value. + * + * @param eTag the eTag value to set + * @return the BlobContainersExtendImmutabilityPolicyHeadersInner object itself. + */ + public BlobContainersExtendImmutabilityPolicyHeadersInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainersGetImmutabilityPolicyHeadersInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainersGetImmutabilityPolicyHeadersInner.java new file mode 100644 index 00000000000..afc3e5697ff --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainersGetImmutabilityPolicyHeadersInner.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.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for GetImmutabilityPolicy operation. + */ +public class BlobContainersGetImmutabilityPolicyHeadersInner { + /** + * 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 value. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the eTag value. + * + * @param eTag the eTag value to set + * @return the BlobContainersGetImmutabilityPolicyHeadersInner object itself. + */ + public BlobContainersGetImmutabilityPolicyHeadersInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainersInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainersInner.java new file mode 100644 index 00000000000..c00fb322266 --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainersInner.java @@ -0,0 +1,1680 @@ +/** + * 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.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.storage.BlobContainersCreateOrUpdateImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.BlobContainersDeleteImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.BlobContainersExtendImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.BlobContainersGetImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.BlobContainersLockImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.PublicAccess; +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.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.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, @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.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.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.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.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.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.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.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.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.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.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.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); + + } + + /** + * 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 ListContainerItemsInner object if successful. + */ + public ListContainerItemsInner list(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).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(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName), 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 ListContainerItemsInner object + */ + public Observable listAsync(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, ListContainerItemsInner>() { + @Override + public ListContainerItemsInner 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 ListContainerItemsInner object + */ + public Observable> listWithServiceResponseAsync(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.list(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 = listDelegate(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().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(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); + } + +} diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainersLockImmutabilityPolicyHeadersInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainersLockImmutabilityPolicyHeadersInner.java new file mode 100644 index 00000000000..df7663db080 --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/BlobContainersLockImmutabilityPolicyHeadersInner.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.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for LockImmutabilityPolicy operation. + */ +public class BlobContainersLockImmutabilityPolicyHeadersInner { + /** + * 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 value. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the eTag value. + * + * @param eTag the eTag value to set + * @return the BlobContainersLockImmutabilityPolicyHeadersInner object itself. + */ + public BlobContainersLockImmutabilityPolicyHeadersInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/CheckNameAvailabilityResultInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/CheckNameAvailabilityResultInner.java index 45ae874dbb9..1e05c2ff630 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/CheckNameAvailabilityResultInner.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/CheckNameAvailabilityResultInner.java @@ -38,7 +38,7 @@ public class CheckNameAvailabilityResultInner { private String message; /** - * Get the nameAvailable value. + * 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 */ @@ -47,7 +47,7 @@ public Boolean nameAvailable() { } /** - * Get the reason value. + * 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 */ @@ -56,7 +56,7 @@ public Reason reason() { } /** - * Get the message value. + * Get gets an error message explaining the Reason value in more detail. * * @return the message value */ diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/ImmutabilityPolicyInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/ImmutabilityPolicyInner.java new file mode 100644 index 00000000000..0596d0f9e2f --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/ImmutabilityPolicyInner.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.implementation; + +import com.microsoft.azure.management.storage.ImmutabilityPolicyState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The ImmutabilityPolicy property of a blob container, including Id, resource + * name, resource type, Etag. + */ +@JsonFlatten +public class ImmutabilityPolicyInner extends AzureEntityResourceInner { + /** + * 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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/LegalHoldInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/LegalHoldInner.java new file mode 100644 index 00000000000..c78d84dc4ee --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/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.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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/ListAccountSasResponseInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/ListAccountSasResponseInner.java index 294235a5088..0b57e05f7ba 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/ListAccountSasResponseInner.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/ListAccountSasResponseInner.java @@ -21,7 +21,7 @@ public class ListAccountSasResponseInner { private String accountSasToken; /** - * Get the accountSasToken value. + * Get list SAS credentials of storage account. * * @return the accountSasToken value */ diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/ListContainerItemsInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/ListContainerItemsInner.java new file mode 100644 index 00000000000..75156a84462 --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/ListContainerItemsInner.java @@ -0,0 +1,45 @@ +/** + * 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.implementation; + +import java.util.List; +import com.microsoft.azure.management.storage.ListContainerItem; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of blob containers. + */ +public class ListContainerItemsInner { + /** + * The list of blob containers. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of blob containers. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of blob containers. + * + * @param value the value value to set + * @return the ListContainerItemsInner object itself. + */ + public ListContainerItemsInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/ListServiceSasResponseInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/ListServiceSasResponseInner.java index 5ad24a3eeef..b6472828928 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/ListServiceSasResponseInner.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/ListServiceSasResponseInner.java @@ -21,7 +21,7 @@ public class ListServiceSasResponseInner { private String serviceSasToken; /** - * Get the serviceSasToken value. + * Get list service SAS credentials of speicific resource. * * @return the serviceSasToken value */ diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/OperationInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/OperationInner.java index a520c94d2f0..c6510549338 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/OperationInner.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/OperationInner.java @@ -43,7 +43,7 @@ public class OperationInner { private ServiceSpecification serviceSpecification; /** - * Get the name value. + * Get operation name: {provider}/{resource}/{operation}. * * @return the name value */ @@ -52,7 +52,7 @@ public String name() { } /** - * Set the name value. + * Set operation name: {provider}/{resource}/{operation}. * * @param name the name value to set * @return the OperationInner object itself. @@ -63,7 +63,7 @@ public OperationInner withName(String name) { } /** - * Get the display value. + * Get display metadata associated with the operation. * * @return the display value */ @@ -72,7 +72,7 @@ public OperationDisplay display() { } /** - * Set the display value. + * Set display metadata associated with the operation. * * @param display the display value to set * @return the OperationInner object itself. @@ -83,7 +83,7 @@ public OperationInner withDisplay(OperationDisplay display) { } /** - * Get the origin value. + * Get the origin of operations. * * @return the origin value */ @@ -92,7 +92,7 @@ public String origin() { } /** - * Set the origin value. + * Set the origin of operations. * * @param origin the origin value to set * @return the OperationInner object itself. @@ -103,7 +103,7 @@ public OperationInner withOrigin(String origin) { } /** - * Get the serviceSpecification value. + * Get one property of operation, include metric specifications. * * @return the serviceSpecification value */ @@ -112,7 +112,7 @@ public ServiceSpecification serviceSpecification() { } /** - * Set the serviceSpecification value. + * Set one property of operation, include metric specifications. * * @param serviceSpecification the serviceSpecification value to set * @return the OperationInner object itself. diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/OperationsInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/OperationsInner.java index 0ee86ac5301..e615ea26bfb 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/OperationsInner.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/OperationsInner.java @@ -111,7 +111,11 @@ public Observable>> listWithServiceResponse public Observable>> call(Response response) { try { ServiceResponse> result = listDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.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); diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/ProxyResourceInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/ProxyResourceInner.java new file mode 100644 index 00000000000..48511afa63f --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/ProxyResourceInner.java @@ -0,0 +1,18 @@ +/** + * 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.implementation; + +import com.microsoft.azure.ProxyResource; + +/** + * The resource model definition for a ARM proxy resource. It will have + * everything other than required location and tags. + */ +public class ProxyResourceInner extends ProxyResource { +} diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/SkuInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/SkuInner.java index efcd0d0c045..bbac7e11ee9 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/SkuInner.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/SkuInner.java @@ -72,7 +72,7 @@ public class SkuInner { private List restrictions; /** - * Get the name value. + * 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'. * * @return the name value */ @@ -81,7 +81,7 @@ public SkuName name() { } /** - * Set the name value. + * 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'. * * @param name the name value to set * @return the SkuInner object itself. @@ -92,7 +92,7 @@ public SkuInner withName(SkuName name) { } /** - * Get the tier value. + * Get gets the sku tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium'. * * @return the tier value */ @@ -101,7 +101,7 @@ public SkuTier tier() { } /** - * Get the resourceType value. + * Get the type of the resource, usually it is 'storageAccounts'. * * @return the resourceType value */ @@ -110,7 +110,7 @@ public String resourceType() { } /** - * Get the kind value. + * Get indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. * * @return the kind value */ @@ -119,7 +119,7 @@ public Kind kind() { } /** - * Get the locations value. + * 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 */ @@ -128,7 +128,7 @@ public List locations() { } /** - * Get the capabilities value. + * Get the capability information in the specified sku, including file encryption, network acls, change notification, etc. * * @return the capabilities value */ @@ -137,7 +137,7 @@ public List capabilities() { } /** - * Get the restrictions value. + * Get the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. * * @return the restrictions value */ @@ -146,7 +146,7 @@ public List restrictions() { } /** - * Set the restrictions value. + * 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. diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/SkusInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/SkusInner.java index a3c6918c3bd..553e11d346e 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/SkusInner.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/SkusInner.java @@ -121,7 +121,11 @@ public Observable>> listWithServiceResponseAsync( public Observable>> call(Response response) { try { ServiceResponse> result = listDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.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); diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountInner.java index b30cd8aae8f..56b6fb8a316 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountInner.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountInner.java @@ -20,13 +20,12 @@ import com.microsoft.azure.management.storage.NetworkRuleSet; 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 { +public class StorageAccountInner extends TrackedResourceInner { /** * Gets the SKU. */ @@ -149,7 +148,7 @@ public class StorageAccountInner extends Resource { private NetworkRuleSet networkRuleSet; /** - * Get the sku value. + * Get gets the SKU. * * @return the sku value */ @@ -158,7 +157,7 @@ public SkuInner sku() { } /** - * Get the kind value. + * Get gets the Kind. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'. * * @return the kind value */ @@ -167,7 +166,7 @@ public Kind kind() { } /** - * Get the identity value. + * Get the identity of the resource. * * @return the identity value */ @@ -176,7 +175,7 @@ public Identity identity() { } /** - * Set the identity value. + * Set the identity of the resource. * * @param identity the identity value to set * @return the StorageAccountInner object itself. @@ -187,7 +186,7 @@ public StorageAccountInner withIdentity(Identity identity) { } /** - * Get the provisioningState value. + * 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 */ @@ -196,7 +195,7 @@ public ProvisioningState provisioningState() { } /** - * Get the primaryEndpoints value. + * 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 */ @@ -205,7 +204,7 @@ public Endpoints primaryEndpoints() { } /** - * Get the primaryLocation value. + * Get gets the location of the primary data center for the storage account. * * @return the primaryLocation value */ @@ -214,7 +213,7 @@ public String primaryLocation() { } /** - * Get the statusOfPrimary value. + * 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 */ @@ -223,7 +222,7 @@ public AccountStatus statusOfPrimary() { } /** - * Get the lastGeoFailoverTime value. + * 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 */ @@ -232,7 +231,7 @@ public DateTime lastGeoFailoverTime() { } /** - * Get the secondaryLocation value. + * 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 */ @@ -241,7 +240,7 @@ public String secondaryLocation() { } /** - * Get the statusOfSecondary value. + * 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 */ @@ -250,7 +249,7 @@ public AccountStatus statusOfSecondary() { } /** - * Get the creationTime value. + * Get gets the creation date and time of the storage account in UTC. * * @return the creationTime value */ @@ -259,7 +258,7 @@ public DateTime creationTime() { } /** - * Get the customDomain value. + * Get gets the custom domain the user assigned to this storage account. * * @return the customDomain value */ @@ -268,7 +267,7 @@ public CustomDomain customDomain() { } /** - * Get the secondaryEndpoints value. + * 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 */ @@ -277,7 +276,7 @@ public Endpoints secondaryEndpoints() { } /** - * Get the encryption value. + * Get gets the encryption settings on the account. If unspecified, the account is unencrypted. * * @return the encryption value */ @@ -286,7 +285,7 @@ public Encryption encryption() { } /** - * Get the accessTier value. + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @return the accessTier value */ @@ -295,7 +294,7 @@ public AccessTier accessTier() { } /** - * Get the enableHttpsTrafficOnly value. + * Get allows https traffic only to storage service if sets to true. * * @return the enableHttpsTrafficOnly value */ @@ -304,7 +303,7 @@ public Boolean enableHttpsTrafficOnly() { } /** - * Set the enableHttpsTrafficOnly value. + * Set allows https traffic only to storage service if sets to true. * * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set * @return the StorageAccountInner object itself. @@ -315,7 +314,7 @@ public StorageAccountInner withEnableHttpsTrafficOnly(Boolean enableHttpsTraffic } /** - * Get the networkRuleSet value. + * Get network rule set. * * @return the networkRuleSet value */ diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountListKeysResultInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountListKeysResultInner.java index 2abe6cbb668..1b960083c22 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountListKeysResultInner.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountListKeysResultInner.java @@ -24,7 +24,7 @@ public class StorageAccountListKeysResultInner { private List keys; /** - * Get the keys value. + * Get gets the list of storage account keys and their properties for the specified storage account. * * @return the keys value */ diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountManagementPoliciesInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountManagementPoliciesInner.java new file mode 100644 index 00000000000..4eeb1f2000c --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/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.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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsInner.java index 3c2f7263460..65899011247 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsInner.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsInner.java @@ -14,8 +14,13 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.storage.AccountSasParameters; +import com.microsoft.azure.management.storage.ManagementPoliciesRulesSetParameter; +import com.microsoft.azure.management.storage.ServiceSasParameters; import com.microsoft.azure.management.storage.StorageAccountCheckNameAvailabilityParameters; +import com.microsoft.azure.management.storage.StorageAccountCreateParameters; import com.microsoft.azure.management.storage.StorageAccountRegenerateKeyParameters; +import com.microsoft.azure.management.storage.StorageAccountUpdateParameters; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -71,11 +76,11 @@ interface StorageAccountsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.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 StorageAccountCreateParametersInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + 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.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 StorageAccountCreateParametersInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + 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.StorageAccounts delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", method = "DELETE", hasBody = true) @@ -87,7 +92,7 @@ interface StorageAccountsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.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 StorageAccountUpdateParametersInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + 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.StorageAccounts list" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts") @@ -107,11 +112,23 @@ interface StorageAccountsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.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 AccountSasParametersInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + 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.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 ServiceSasParametersInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + 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.StorageAccounts getManagementPolicies" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}") + Observable> getManagementPolicies(@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.StorageAccounts createOrUpdateManagementPolicies" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}") + Observable> createOrUpdateManagementPolicies(@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.StorageAccounts deleteManagementPolicies" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}", method = "DELETE", hasBody = true) + Observable> deleteManagementPolicies(@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); } @@ -207,7 +224,7 @@ private ServiceResponse checkNameAvailabilityD * @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, StorageAccountCreateParametersInner parameters) { + public StorageAccountInner create(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().last().body(); } @@ -221,7 +238,7 @@ public StorageAccountInner create(String resourceGroupName, String accountName, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture createAsync(String resourceGroupName, String accountName, StorageAccountCreateParametersInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture createAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); } @@ -234,7 +251,7 @@ public ServiceFuture createAsync(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable createAsync(String resourceGroupName, String accountName, StorageAccountCreateParametersInner parameters) { + public Observable createAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, StorageAccountInner>() { @Override public StorageAccountInner call(ServiceResponse response) { @@ -252,7 +269,7 @@ public StorageAccountInner call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountCreateParametersInner parameters) { + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -284,7 +301,7 @@ public Observable> createWithServiceRespons * @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, StorageAccountCreateParametersInner parameters) { + public StorageAccountInner beginCreate(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); } @@ -298,7 +315,7 @@ public StorageAccountInner beginCreate(String resourceGroupName, String accountN * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, StorageAccountCreateParametersInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); } @@ -311,7 +328,7 @@ public ServiceFuture beginCreateAsync(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the StorageAccountInner object */ - public Observable beginCreateAsync(String resourceGroupName, String accountName, StorageAccountCreateParametersInner parameters) { + public Observable beginCreateAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, StorageAccountInner>() { @Override public StorageAccountInner call(ServiceResponse response) { @@ -329,7 +346,7 @@ public StorageAccountInner call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the StorageAccountInner object */ - public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountCreateParametersInner parameters) { + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -551,7 +568,7 @@ private ServiceResponse getByResourceGroupDelegate(Response * @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, StorageAccountUpdateParametersInner parameters) { + public StorageAccountInner update(String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters) { return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); } @@ -565,7 +582,7 @@ public StorageAccountInner update(String resourceGroupName, String accountName, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture updateAsync(String resourceGroupName, String accountName, StorageAccountUpdateParametersInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture updateAsync(String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); } @@ -578,7 +595,7 @@ public ServiceFuture updateAsync(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the StorageAccountInner object */ - public Observable updateAsync(String resourceGroupName, String accountName, StorageAccountUpdateParametersInner parameters) { + public Observable updateAsync(String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters) { return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, StorageAccountInner>() { @Override public StorageAccountInner call(ServiceResponse response) { @@ -596,7 +613,7 @@ public StorageAccountInner call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the StorageAccountInner object */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountUpdateParametersInner parameters) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -695,7 +712,11 @@ public Observable>> listWithServiceRes public Observable>> call(Response response) { try { ServiceResponse> result = listDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.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); @@ -779,7 +800,11 @@ public Observable>> listByResourceGrou public Observable>> call(Response response) { try { ServiceResponse> result = listByResourceGroupDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.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); @@ -987,7 +1012,7 @@ private ServiceResponse regenerateKeyDelegate * @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, AccountSasParametersInner parameters) { + public ListAccountSasResponseInner listAccountSAS(String resourceGroupName, String accountName, AccountSasParameters parameters) { return listAccountSASWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); } @@ -1001,7 +1026,7 @@ public ListAccountSasResponseInner listAccountSAS(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture listAccountSASAsync(String resourceGroupName, String accountName, AccountSasParametersInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture listAccountSASAsync(String resourceGroupName, String accountName, AccountSasParameters parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(listAccountSASWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); } @@ -1014,7 +1039,7 @@ public ServiceFuture listAccountSASAsync(String res * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ListAccountSasResponseInner object */ - public Observable listAccountSASAsync(String resourceGroupName, String accountName, AccountSasParametersInner parameters) { + public Observable listAccountSASAsync(String resourceGroupName, String accountName, AccountSasParameters parameters) { return listAccountSASWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, ListAccountSasResponseInner>() { @Override public ListAccountSasResponseInner call(ServiceResponse response) { @@ -1032,7 +1057,7 @@ public ListAccountSasResponseInner call(ServiceResponse> listAccountSASWithServiceResponseAsync(String resourceGroupName, String accountName, AccountSasParametersInner parameters) { + public Observable> listAccountSASWithServiceResponseAsync(String resourceGroupName, String accountName, AccountSasParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1081,7 +1106,7 @@ private ServiceResponse listAccountSASDelegate(Resp * @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, ServiceSasParametersInner parameters) { + public ListServiceSasResponseInner listServiceSAS(String resourceGroupName, String accountName, ServiceSasParameters parameters) { return listServiceSASWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); } @@ -1095,7 +1120,7 @@ public ListServiceSasResponseInner listServiceSAS(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture listServiceSASAsync(String resourceGroupName, String accountName, ServiceSasParametersInner parameters, final ServiceCallback serviceCallback) { + public ServiceFuture listServiceSASAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(listServiceSASWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); } @@ -1108,7 +1133,7 @@ public ServiceFuture listServiceSASAsync(String res * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ListServiceSasResponseInner object */ - public Observable listServiceSASAsync(String resourceGroupName, String accountName, ServiceSasParametersInner parameters) { + public Observable listServiceSASAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters) { return listServiceSASWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, ListServiceSasResponseInner>() { @Override public ListServiceSasResponseInner call(ServiceResponse response) { @@ -1126,7 +1151,7 @@ public ListServiceSasResponseInner call(ServiceResponse> listServiceSASWithServiceResponseAsync(String resourceGroupName, String accountName, ServiceSasParametersInner parameters) { + public Observable> listServiceSASWithServiceResponseAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1164,4 +1189,354 @@ private ServiceResponse listServiceSASDelegate(Resp .build(response); } + /** + * 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 getManagementPolicies(String resourceGroupName, String accountName) { + return getManagementPoliciesWithServiceResponseAsync(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 getManagementPoliciesAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getManagementPoliciesWithServiceResponseAsync(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 getManagementPoliciesAsync(String resourceGroupName, String accountName) { + return getManagementPoliciesWithServiceResponseAsync(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> getManagementPoliciesWithServiceResponseAsync(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.getManagementPolicies(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 = getManagementPoliciesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getManagementPoliciesDelegate(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 createOrUpdateManagementPolicies(String resourceGroupName, String accountName) { + return createOrUpdateManagementPoliciesWithServiceResponseAsync(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 createOrUpdateManagementPoliciesAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateManagementPoliciesWithServiceResponseAsync(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 createOrUpdateManagementPoliciesAsync(String resourceGroupName, String accountName) { + return createOrUpdateManagementPoliciesWithServiceResponseAsync(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> createOrUpdateManagementPoliciesWithServiceResponseAsync(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"; + final Object policy = null; + ManagementPoliciesRulesSetParameter properties = new ManagementPoliciesRulesSetParameter(); + properties.withPolicy(null); + return service.createOrUpdateManagementPolicies(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 = createOrUpdateManagementPoliciesDelegate(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 createOrUpdateManagementPolicies(String resourceGroupName, String accountName, Object policy) { + return createOrUpdateManagementPoliciesWithServiceResponseAsync(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 createOrUpdateManagementPoliciesAsync(String resourceGroupName, String accountName, Object policy, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateManagementPoliciesWithServiceResponseAsync(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 createOrUpdateManagementPoliciesAsync(String resourceGroupName, String accountName, Object policy) { + return createOrUpdateManagementPoliciesWithServiceResponseAsync(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> createOrUpdateManagementPoliciesWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String managementPolicyName = "default"; + ManagementPoliciesRulesSetParameter properties = new ManagementPoliciesRulesSetParameter(); + properties.withPolicy(policy); + return service.createOrUpdateManagementPolicies(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 = createOrUpdateManagementPoliciesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateManagementPoliciesDelegate(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 deleteManagementPolicies(String resourceGroupName, String accountName) { + deleteManagementPoliciesWithServiceResponseAsync(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 deleteManagementPoliciesAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteManagementPoliciesWithServiceResponseAsync(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 deleteManagementPoliciesAsync(String resourceGroupName, String accountName) { + return deleteManagementPoliciesWithServiceResponseAsync(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> deleteManagementPoliciesWithServiceResponseAsync(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.deleteManagementPolicies(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 = deleteManagementPoliciesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteManagementPoliciesDelegate(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/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageManagementClientImpl.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageManagementClientImpl.java index ce919779fbc..33e10bb3ae2 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageManagementClientImpl.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageManagementClientImpl.java @@ -28,11 +28,11 @@ public AzureClient getAzureClient() { return this.azureClient; } - /** Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + /** The ID of the target subscription. */ private String subscriptionId; /** - * Gets Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * Gets The ID of the target subscription. * * @return the subscriptionId value. */ @@ -41,7 +41,7 @@ public String subscriptionId() { } /** - * Sets Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * Sets The ID of the target subscription. * * @param subscriptionId the subscriptionId value. * @return the service client itself @@ -51,11 +51,11 @@ public StorageManagementClientImpl withSubscriptionId(String subscriptionId) { return this; } - /** Client Api Version. */ + /** The API version to use for this operation. */ private String apiVersion; /** - * Gets Client Api Version. + * Gets The API version to use for this operation. * * @return the apiVersion value. */ @@ -184,6 +184,19 @@ public UsagesInner usages() { return this.usages; } + /** + * 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. * @@ -215,7 +228,7 @@ public StorageManagementClientImpl(RestClient restClient) { } protected void initialize() { - this.apiVersion = "2017-10-01"; + this.apiVersion = "2018-03-01-preview"; this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -223,6 +236,7 @@ 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.blobContainers = new BlobContainersInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } @@ -233,6 +247,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "StorageManagementClient", "2017-10-01"); + return String.format("%s (%s, %s)", super.userAgent(), "StorageManagementClient", "2018-03-01-preview"); } } diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/TrackedResourceInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/TrackedResourceInner.java new file mode 100644 index 00000000000..5b919bb6cfa --- /dev/null +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/TrackedResourceInner.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.implementation; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The resource model definition for a ARM tracked top level resource. + */ +public class TrackedResourceInner extends ProxyResource { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The geo-location where the resource lives. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the TrackedResourceInner object itself. + */ + public TrackedResourceInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the geo-location where the resource lives. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the geo-location where the resource lives. + * + * @param location the location value to set + * @return the TrackedResourceInner object itself. + */ + public TrackedResourceInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/UsageInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/UsageInner.java index f6211b55164..2bf008ffecd 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/UsageInner.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/UsageInner.java @@ -43,7 +43,7 @@ public class UsageInner { private UsageName name; /** - * Get the unit value. + * Get gets the unit of measurement. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'. * * @return the unit value */ @@ -52,7 +52,7 @@ public UsageUnit unit() { } /** - * Get the currentValue value. + * Get gets the current count of the allocated resources in the subscription. * * @return the currentValue value */ @@ -61,7 +61,7 @@ public Integer currentValue() { } /** - * Get the limit value. + * Get gets the maximum count of the resources that can be allocated in the subscription. * * @return the limit value */ @@ -70,7 +70,7 @@ public Integer limit() { } /** - * Get the name value. + * Get gets the name of the type of usage. * * @return the name value */ diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/UsagesInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/UsagesInner.java index 53d7e6acd97..90cc93fb771 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/UsagesInner.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/UsagesInner.java @@ -58,6 +58,10 @@ interface UsagesService { @GET("subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages") 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.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); + } /** @@ -121,7 +125,11 @@ public Observable>> listWithServiceResponseAsyn public Observable>> call(Response response) { try { ServiceResponse> result = listDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.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); @@ -137,4 +145,88 @@ private ServiceResponse> listDelegate(Response 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); + } + }