diff --git a/sdk/storage/mgmt-v2019_08_01_preview/pom.xml b/sdk/storage/mgmt-v2019_08_01_preview/pom.xml new file mode 100644 index 0000000000000..0e367cbc089d8 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.storage.v2019_08_01_preview + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-storage + 1.0.0-beta + jar + Microsoft Azure SDK for Storage Management + This package contains Microsoft Storage Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/AccessTier.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/AccessTier.java new file mode 100644 index 0000000000000..0c169440ff984 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/AccessTier.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AccessTier. + */ +public enum AccessTier { + /** Enum value Hot. */ + HOT("Hot"), + + /** Enum value Cool. */ + COOL("Cool"); + + /** The actual serialized value for a AccessTier instance. */ + private String value; + + AccessTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccessTier instance. + * + * @param value the serialized value to parse. + * @return the parsed AccessTier object, or null if unable to parse. + */ + @JsonCreator + public static AccessTier fromString(String value) { + AccessTier[] items = AccessTier.values(); + for (AccessTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/AccountSasParameters.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/AccountSasParameters.java new file mode 100644 index 0000000000000..ba53764be066a --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/AccountSasParameters.java @@ -0,0 +1,236 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +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/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/AccountStatus.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/AccountStatus.java new file mode 100644 index 0000000000000..28fbdfe8538de --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/AccountStatus.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AccountStatus. + */ +public enum AccountStatus { + /** Enum value available. */ + AVAILABLE("available"), + + /** Enum value unavailable. */ + UNAVAILABLE("unavailable"); + + /** The actual serialized value for a AccountStatus instance. */ + private String value; + + AccountStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccountStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed AccountStatus object, or null if unable to parse. + */ + @JsonCreator + public static AccountStatus fromString(String value) { + AccountStatus[] items = AccountStatus.values(); + for (AccountStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Action.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Action.java new file mode 100644 index 0000000000000..6a29420705a3e --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Action.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Action. + */ +public enum Action { + /** Enum value Allow. */ + ALLOW("Allow"); + + /** The actual serialized value for a Action instance. */ + private String value; + + Action(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Action instance. + * + * @param value the serialized value to parse. + * @return the parsed Action object, or null if unable to parse. + */ + @JsonCreator + public static Action fromString(String value) { + Action[] items = Action.values(); + for (Action item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ActiveDirectoryProperties.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ActiveDirectoryProperties.java new file mode 100644 index 0000000000000..952331e603d5e --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ActiveDirectoryProperties.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Settings properties for Active Directory (AD). + */ +public class ActiveDirectoryProperties { + /** + * Specifies the primary domain that the AD DNS server is authoritative + * for. + */ + @JsonProperty(value = "domainName", required = true) + private String domainName; + + /** + * Specifies the NetBIOS domain name. + */ + @JsonProperty(value = "netBiosDomainName", required = true) + private String netBiosDomainName; + + /** + * Specifies the Active Directory forest to get. + */ + @JsonProperty(value = "forestName", required = true) + private String forestName; + + /** + * Specifies the domain GUID. + */ + @JsonProperty(value = "domainGuid", required = true) + private String domainGuid; + + /** + * Specifies the security identifier (SID). + */ + @JsonProperty(value = "domainSid", required = true) + private String domainSid; + + /** + * Specifies the security identifier (SID) for Azure Storage. + */ + @JsonProperty(value = "azureStorageSid", required = true) + private String azureStorageSid; + + /** + * Get specifies the primary domain that the AD DNS server is authoritative for. + * + * @return the domainName value + */ + public String domainName() { + return this.domainName; + } + + /** + * Set specifies the primary domain that the AD DNS server is authoritative for. + * + * @param domainName the domainName value to set + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Get specifies the NetBIOS domain name. + * + * @return the netBiosDomainName value + */ + public String netBiosDomainName() { + return this.netBiosDomainName; + } + + /** + * Set specifies the NetBIOS domain name. + * + * @param netBiosDomainName the netBiosDomainName value to set + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withNetBiosDomainName(String netBiosDomainName) { + this.netBiosDomainName = netBiosDomainName; + return this; + } + + /** + * Get specifies the Active Directory forest to get. + * + * @return the forestName value + */ + public String forestName() { + return this.forestName; + } + + /** + * Set specifies the Active Directory forest to get. + * + * @param forestName the forestName value to set + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withForestName(String forestName) { + this.forestName = forestName; + return this; + } + + /** + * Get specifies the domain GUID. + * + * @return the domainGuid value + */ + public String domainGuid() { + return this.domainGuid; + } + + /** + * Set specifies the domain GUID. + * + * @param domainGuid the domainGuid value to set + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withDomainGuid(String domainGuid) { + this.domainGuid = domainGuid; + return this; + } + + /** + * Get specifies the security identifier (SID). + * + * @return the domainSid value + */ + public String domainSid() { + return this.domainSid; + } + + /** + * Set specifies the security identifier (SID). + * + * @param domainSid the domainSid value to set + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withDomainSid(String domainSid) { + this.domainSid = domainSid; + return this; + } + + /** + * Get specifies the security identifier (SID) for Azure Storage. + * + * @return the azureStorageSid value + */ + public String azureStorageSid() { + return this.azureStorageSid; + } + + /** + * Set specifies the security identifier (SID) for Azure Storage. + * + * @param azureStorageSid the azureStorageSid value to set + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withAzureStorageSid(String azureStorageSid) { + this.azureStorageSid = azureStorageSid; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/AzureEntityResource.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/AzureEntityResource.java new file mode 100644 index 0000000000000..24ef236955934 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/AzureEntityResource.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The resource model definition for a Azure Resource Manager resource with an + * etag. + */ +public class AzureEntityResource extends ProxyResource { + /** + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get resource Etag. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/AzureFilesIdentityBasedAuthentication.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/AzureFilesIdentityBasedAuthentication.java new file mode 100644 index 0000000000000..067f070d73203 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/AzureFilesIdentityBasedAuthentication.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Settings for Azure Files identity based authentication. + */ +public class AzureFilesIdentityBasedAuthentication { + /** + * Indicates the directory service used. Possible values include: 'None', + * 'AADDS', 'AD'. + */ + @JsonProperty(value = "directoryServiceOptions", required = true) + private DirectoryServiceOptions directoryServiceOptions; + + /** + * Required if choose AD. + */ + @JsonProperty(value = "activeDirectoryProperties") + private ActiveDirectoryProperties activeDirectoryProperties; + + /** + * Get indicates the directory service used. Possible values include: 'None', 'AADDS', 'AD'. + * + * @return the directoryServiceOptions value + */ + public DirectoryServiceOptions directoryServiceOptions() { + return this.directoryServiceOptions; + } + + /** + * Set indicates the directory service used. Possible values include: 'None', 'AADDS', 'AD'. + * + * @param directoryServiceOptions the directoryServiceOptions value to set + * @return the AzureFilesIdentityBasedAuthentication object itself. + */ + public AzureFilesIdentityBasedAuthentication withDirectoryServiceOptions(DirectoryServiceOptions directoryServiceOptions) { + this.directoryServiceOptions = directoryServiceOptions; + return this; + } + + /** + * Get required if choose AD. + * + * @return the activeDirectoryProperties value + */ + public ActiveDirectoryProperties activeDirectoryProperties() { + return this.activeDirectoryProperties; + } + + /** + * Set required if choose AD. + * + * @param activeDirectoryProperties the activeDirectoryProperties value to set + * @return the AzureFilesIdentityBasedAuthentication object itself. + */ + public AzureFilesIdentityBasedAuthentication withActiveDirectoryProperties(ActiveDirectoryProperties activeDirectoryProperties) { + this.activeDirectoryProperties = activeDirectoryProperties; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainer.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainer.java new file mode 100644 index 0000000000000..d9ae899a522cf --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainer.java @@ -0,0 +1,270 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.BlobContainerInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import org.joda.time.DateTime; +import java.util.Map; + +/** + * Type representing BlobContainer. + */ +public interface BlobContainer extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the defaultEncryptionScope value. + */ + String defaultEncryptionScope(); + + /** + * @return the deleted value. + */ + Boolean deleted(); + + /** + * @return the deletedTime value. + */ + DateTime deletedTime(); + + /** + * @return the denyEncryptionScopeOverride value. + */ + Boolean denyEncryptionScopeOverride(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the hasImmutabilityPolicy value. + */ + Boolean hasImmutabilityPolicy(); + + /** + * @return the hasLegalHold value. + */ + Boolean hasLegalHold(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the immutabilityPolicy value. + */ + ImmutabilityPolicyProperties immutabilityPolicy(); + + /** + * @return the lastModifiedTime value. + */ + DateTime lastModifiedTime(); + + /** + * @return the leaseDuration value. + */ + LeaseDuration leaseDuration(); + + /** + * @return the leaseState value. + */ + LeaseState leaseState(); + + /** + * @return the leaseStatus value. + */ + LeaseStatus leaseStatus(); + + /** + * @return the legalHold value. + */ + LegalHoldProperties legalHold(); + + /** + * @return the metadata value. + */ + Map metadata(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the publicAccess value. + */ + PublicAccess publicAccess(); + + /** + * @return the remainingRetentionDays value. + */ + Integer remainingRetentionDays(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the version value. + */ + String version(); + + /** + * The entirety of the BlobContainer definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithBlobService, DefinitionStages.WithCreate { + } + + /** + * Grouping of BlobContainer definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a BlobContainer definition. + */ + interface Blank extends WithBlobService { + } + + /** + * The stage of the blobcontainer definition allowing to specify BlobService. + */ + interface WithBlobService { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only + * @return the next definition stage + */ + WithCreate withExistingBlobService(String resourceGroupName, String accountName); + } + + /** + * The stage of the blobcontainer definition allowing to specify DefaultEncryptionScope. + */ + interface WithDefaultEncryptionScope { + /** + * Specifies defaultEncryptionScope. + * @param defaultEncryptionScope Default the container to use specified encryption scope for all writes + * @return the next definition stage + */ + WithCreate withDefaultEncryptionScope(String defaultEncryptionScope); + } + + /** + * The stage of the blobcontainer definition allowing to specify DenyEncryptionScopeOverride. + */ + interface WithDenyEncryptionScopeOverride { + /** + * Specifies denyEncryptionScopeOverride. + * @param denyEncryptionScopeOverride Block override of encryption scope from the container default + * @return the next definition stage + */ + WithCreate withDenyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride); + } + + /** + * The stage of the blobcontainer definition allowing to specify Metadata. + */ + interface WithMetadata { + /** + * Specifies metadata. + * @param metadata A name-value pair to associate with the container as metadata + * @return the next definition stage + */ + WithCreate withMetadata(Map metadata); + } + + /** + * The stage of the blobcontainer definition allowing to specify PublicAccess. + */ + interface WithPublicAccess { + /** + * Specifies publicAccess. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @return the next definition stage + */ + WithCreate withPublicAccess(PublicAccess publicAccess); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDefaultEncryptionScope, DefinitionStages.WithDenyEncryptionScopeOverride, DefinitionStages.WithMetadata, DefinitionStages.WithPublicAccess { + } + } + /** + * The template for a BlobContainer update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDefaultEncryptionScope, UpdateStages.WithDenyEncryptionScopeOverride, UpdateStages.WithMetadata, UpdateStages.WithPublicAccess { + } + + /** + * Grouping of BlobContainer update stages. + */ + interface UpdateStages { + /** + * The stage of the blobcontainer update allowing to specify DefaultEncryptionScope. + */ + interface WithDefaultEncryptionScope { + /** + * Specifies defaultEncryptionScope. + * @param defaultEncryptionScope Default the container to use specified encryption scope for all writes + * @return the next update stage + */ + Update withDefaultEncryptionScope(String defaultEncryptionScope); + } + + /** + * The stage of the blobcontainer update allowing to specify DenyEncryptionScopeOverride. + */ + interface WithDenyEncryptionScopeOverride { + /** + * Specifies denyEncryptionScopeOverride. + * @param denyEncryptionScopeOverride Block override of encryption scope from the container default + * @return the next update stage + */ + Update withDenyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride); + } + + /** + * The stage of the blobcontainer update allowing to specify Metadata. + */ + interface WithMetadata { + /** + * Specifies metadata. + * @param metadata A name-value pair to associate with the container as metadata + * @return the next update stage + */ + Update withMetadata(Map metadata); + } + + /** + * The stage of the blobcontainer update allowing to specify PublicAccess. + */ + interface WithPublicAccess { + /** + * Specifies publicAccess. + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None' + * @return the next update stage + */ + Update withPublicAccess(PublicAccess publicAccess); + } + + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainers.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainers.java new file mode 100644 index 0000000000000..6729492d4c2d0 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainers.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import rx.Completable; +import rx.Observable; +import java.util.List; + +/** + * Type representing BlobContainers. + */ +public interface BlobContainers { + /** + * Begins definition for a new Container resource. + * @param name resource name. + * @return the first stage of the new Container definition. + */ + BlobContainer.DefinitionStages.Blank defineContainer(String name); + + /** + * Begins definition for a new ImmutabilityPolicy resource. + * @param name resource name. + * @return the first stage of the new ImmutabilityPolicy definition. + */ + ImmutabilityPolicy.DefinitionStages.Blank defineImmutabilityPolicy(String name); + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String containerName); + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String containerName); + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable setLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags); + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable clearLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags); + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable leaseAsync(String resourceGroupName, String accountName, String containerName); + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName); + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the only way is to delete the container after deleting all expired blobs inside the policy locked container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch); + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable lockImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch); + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable extendImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java new file mode 100644 index 0000000000000..f7f7a034c3b46 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +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/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainersDeleteImmutabilityPolicyHeaders.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainersDeleteImmutabilityPolicyHeaders.java new file mode 100644 index 0000000000000..10ef7f5c14503 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainersDeleteImmutabilityPolicyHeaders.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +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/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainersExtendImmutabilityPolicyHeaders.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainersExtendImmutabilityPolicyHeaders.java new file mode 100644 index 0000000000000..7615a64571ca6 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainersExtendImmutabilityPolicyHeaders.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +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/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainersGetImmutabilityPolicyHeaders.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainersGetImmutabilityPolicyHeaders.java new file mode 100644 index 0000000000000..54d986f6217d1 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainersGetImmutabilityPolicyHeaders.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +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/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainersLockImmutabilityPolicyHeaders.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainersLockImmutabilityPolicyHeaders.java new file mode 100644 index 0000000000000..cfc5d63509fd0 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobContainersLockImmutabilityPolicyHeaders.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +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/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobRestoreParameters.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobRestoreParameters.java new file mode 100644 index 0000000000000..63a093c795213 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobRestoreParameters.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Blob restore parameters. + */ +public class BlobRestoreParameters { + /** + * Restore blob to the specified time. + */ + @JsonProperty(value = "timeToRestore", required = true) + private DateTime timeToRestore; + + /** + * Blob ranges to restore. + */ + @JsonProperty(value = "blobRanges", required = true) + private List blobRanges; + + /** + * Get restore blob to the specified time. + * + * @return the timeToRestore value + */ + public DateTime timeToRestore() { + return this.timeToRestore; + } + + /** + * Set restore blob to the specified time. + * + * @param timeToRestore the timeToRestore value to set + * @return the BlobRestoreParameters object itself. + */ + public BlobRestoreParameters withTimeToRestore(DateTime timeToRestore) { + this.timeToRestore = timeToRestore; + return this; + } + + /** + * Get blob ranges to restore. + * + * @return the blobRanges value + */ + public List blobRanges() { + return this.blobRanges; + } + + /** + * Set blob ranges to restore. + * + * @param blobRanges the blobRanges value to set + * @return the BlobRestoreParameters object itself. + */ + public BlobRestoreParameters withBlobRanges(List blobRanges) { + this.blobRanges = blobRanges; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobRestoreProgressStatus.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobRestoreProgressStatus.java new file mode 100644 index 0000000000000..55277442b94fc --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobRestoreProgressStatus.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BlobRestoreProgressStatus. + */ +public final class BlobRestoreProgressStatus extends ExpandableStringEnum { + /** Static value InProgress for BlobRestoreProgressStatus. */ + public static final BlobRestoreProgressStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Complete for BlobRestoreProgressStatus. */ + public static final BlobRestoreProgressStatus COMPLETE = fromString("Complete"); + + /** Static value Failed for BlobRestoreProgressStatus. */ + public static final BlobRestoreProgressStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a BlobRestoreProgressStatus from its string representation. + * @param name a name to look for + * @return the corresponding BlobRestoreProgressStatus + */ + @JsonCreator + public static BlobRestoreProgressStatus fromString(String name) { + return fromString(name, BlobRestoreProgressStatus.class); + } + + /** + * @return known BlobRestoreProgressStatus values + */ + public static Collection values() { + return values(BlobRestoreProgressStatus.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobRestoreRange.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobRestoreRange.java new file mode 100644 index 0000000000000..a8452d65ac515 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobRestoreRange.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Blob range. + */ +public class BlobRestoreRange { + /** + * Blob start range. This is inclusive. Empty means account start. + */ + @JsonProperty(value = "startRange", required = true) + private String startRange; + + /** + * Blob end range. This is exclusive. Empty means account end. + */ + @JsonProperty(value = "endRange", required = true) + private String endRange; + + /** + * Get blob start range. This is inclusive. Empty means account start. + * + * @return the startRange value + */ + public String startRange() { + return this.startRange; + } + + /** + * Set blob start range. This is inclusive. Empty means account start. + * + * @param startRange the startRange value to set + * @return the BlobRestoreRange object itself. + */ + public BlobRestoreRange withStartRange(String startRange) { + this.startRange = startRange; + return this; + } + + /** + * Get blob end range. This is exclusive. Empty means account end. + * + * @return the endRange value + */ + public String endRange() { + return this.endRange; + } + + /** + * Set blob end range. This is exclusive. Empty means account end. + * + * @param endRange the endRange value to set + * @return the BlobRestoreRange object itself. + */ + public BlobRestoreRange withEndRange(String endRange) { + this.endRange = endRange; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobRestoreStatus.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobRestoreStatus.java new file mode 100644 index 0000000000000..da55a051b792c --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobRestoreStatus.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.BlobRestoreStatusInner; + +/** + * Type representing BlobRestoreStatus. + */ +public interface BlobRestoreStatus extends HasInner, HasManager { + /** + * @return the failureReason value. + */ + String failureReason(); + + /** + * @return the parameters value. + */ + BlobRestoreParameters parameters(); + + /** + * @return the restoreId value. + */ + String restoreId(); + + /** + * @return the status value. + */ + BlobRestoreProgressStatus status(); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobServiceProperties.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobServiceProperties.java new file mode 100644 index 0000000000000..d44b12297a63a --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobServiceProperties.java @@ -0,0 +1,325 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.BlobServicePropertiesInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; + +/** + * Type representing BlobServiceProperties. + */ +public interface BlobServiceProperties extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the automaticSnapshotPolicyEnabled value. + */ + Boolean automaticSnapshotPolicyEnabled(); + + /** + * @return the changeFeed value. + */ + ChangeFeed changeFeed(); + + /** + * @return the containerDeleteRetentionPolicy value. + */ + DeleteRetentionPolicy containerDeleteRetentionPolicy(); + + /** + * @return the cors value. + */ + CorsRules cors(); + + /** + * @return the defaultServiceVersion value. + */ + String defaultServiceVersion(); + + /** + * @return the deleteRetentionPolicy value. + */ + DeleteRetentionPolicy deleteRetentionPolicy(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the isVersioningEnabled value. + */ + Boolean isVersioningEnabled(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the restorePolicy value. + */ + RestorePolicyProperties restorePolicy(); + + /** + * @return the sku value. + */ + SkuInner sku(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the BlobServiceProperties definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithStorageAccount, DefinitionStages.WithCreate { + } + + /** + * Grouping of BlobServiceProperties definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a BlobServiceProperties definition. + */ + interface Blank extends WithStorageAccount { + } + + /** + * The stage of the blobserviceproperties definition allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only + * @return the next definition stage + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the blobserviceproperties definition allowing to specify AutomaticSnapshotPolicyEnabled. + */ + interface WithAutomaticSnapshotPolicyEnabled { + /** + * Specifies automaticSnapshotPolicyEnabled. + * @param automaticSnapshotPolicyEnabled Deprecated in favor of isVersioningEnabled property + * @return the next definition stage + */ + WithCreate withAutomaticSnapshotPolicyEnabled(Boolean automaticSnapshotPolicyEnabled); + } + + /** + * The stage of the blobserviceproperties definition allowing to specify ChangeFeed. + */ + interface WithChangeFeed { + /** + * Specifies changeFeed. + * @param changeFeed The blob service properties for change feed events + * @return the next definition stage + */ + WithCreate withChangeFeed(ChangeFeed changeFeed); + } + + /** + * The stage of the blobserviceproperties definition allowing to specify ContainerDeleteRetentionPolicy. + */ + interface WithContainerDeleteRetentionPolicy { + /** + * Specifies containerDeleteRetentionPolicy. + * @param containerDeleteRetentionPolicy The blob service properties for container soft delete + * @return the next definition stage + */ + WithCreate withContainerDeleteRetentionPolicy(DeleteRetentionPolicy containerDeleteRetentionPolicy); + } + + /** + * The stage of the blobserviceproperties definition allowing to specify Cors. + */ + interface WithCors { + /** + * Specifies cors. + * @param cors Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service + * @return the next definition stage + */ + WithCreate withCors(CorsRules cors); + } + + /** + * The stage of the blobserviceproperties definition allowing to specify DefaultServiceVersion. + */ + interface WithDefaultServiceVersion { + /** + * Specifies defaultServiceVersion. + * @param defaultServiceVersion DefaultServiceVersion indicates the default version to use for requests to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 and all more recent versions + * @return the next definition stage + */ + WithCreate withDefaultServiceVersion(String defaultServiceVersion); + } + + /** + * The stage of the blobserviceproperties definition allowing to specify DeleteRetentionPolicy. + */ + interface WithDeleteRetentionPolicy { + /** + * Specifies deleteRetentionPolicy. + * @param deleteRetentionPolicy The blob service properties for blob soft delete + * @return the next definition stage + */ + WithCreate withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy); + } + + /** + * The stage of the blobserviceproperties definition allowing to specify IsVersioningEnabled. + */ + interface WithIsVersioningEnabled { + /** + * Specifies isVersioningEnabled. + * @param isVersioningEnabled Versioning is enabled if set to true + * @return the next definition stage + */ + WithCreate withIsVersioningEnabled(Boolean isVersioningEnabled); + } + + /** + * The stage of the blobserviceproperties definition allowing to specify RestorePolicy. + */ + interface WithRestorePolicy { + /** + * Specifies restorePolicy. + * @param restorePolicy The blob service properties for blob restore policy + * @return the next definition stage + */ + WithCreate withRestorePolicy(RestorePolicyProperties restorePolicy); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAutomaticSnapshotPolicyEnabled, DefinitionStages.WithChangeFeed, DefinitionStages.WithContainerDeleteRetentionPolicy, DefinitionStages.WithCors, DefinitionStages.WithDefaultServiceVersion, DefinitionStages.WithDeleteRetentionPolicy, DefinitionStages.WithIsVersioningEnabled, DefinitionStages.WithRestorePolicy { + } + } + /** + * The template for a BlobServiceProperties update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAutomaticSnapshotPolicyEnabled, UpdateStages.WithChangeFeed, UpdateStages.WithContainerDeleteRetentionPolicy, UpdateStages.WithCors, UpdateStages.WithDefaultServiceVersion, UpdateStages.WithDeleteRetentionPolicy, UpdateStages.WithIsVersioningEnabled, UpdateStages.WithRestorePolicy { + } + + /** + * Grouping of BlobServiceProperties update stages. + */ + interface UpdateStages { + /** + * The stage of the blobserviceproperties update allowing to specify AutomaticSnapshotPolicyEnabled. + */ + interface WithAutomaticSnapshotPolicyEnabled { + /** + * Specifies automaticSnapshotPolicyEnabled. + * @param automaticSnapshotPolicyEnabled Deprecated in favor of isVersioningEnabled property + * @return the next update stage + */ + Update withAutomaticSnapshotPolicyEnabled(Boolean automaticSnapshotPolicyEnabled); + } + + /** + * The stage of the blobserviceproperties update allowing to specify ChangeFeed. + */ + interface WithChangeFeed { + /** + * Specifies changeFeed. + * @param changeFeed The blob service properties for change feed events + * @return the next update stage + */ + Update withChangeFeed(ChangeFeed changeFeed); + } + + /** + * The stage of the blobserviceproperties update allowing to specify ContainerDeleteRetentionPolicy. + */ + interface WithContainerDeleteRetentionPolicy { + /** + * Specifies containerDeleteRetentionPolicy. + * @param containerDeleteRetentionPolicy The blob service properties for container soft delete + * @return the next update stage + */ + Update withContainerDeleteRetentionPolicy(DeleteRetentionPolicy containerDeleteRetentionPolicy); + } + + /** + * The stage of the blobserviceproperties update allowing to specify Cors. + */ + interface WithCors { + /** + * Specifies cors. + * @param cors Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service + * @return the next update stage + */ + Update withCors(CorsRules cors); + } + + /** + * The stage of the blobserviceproperties update allowing to specify DefaultServiceVersion. + */ + interface WithDefaultServiceVersion { + /** + * Specifies defaultServiceVersion. + * @param defaultServiceVersion DefaultServiceVersion indicates the default version to use for requests to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 and all more recent versions + * @return the next update stage + */ + Update withDefaultServiceVersion(String defaultServiceVersion); + } + + /** + * The stage of the blobserviceproperties update allowing to specify DeleteRetentionPolicy. + */ + interface WithDeleteRetentionPolicy { + /** + * Specifies deleteRetentionPolicy. + * @param deleteRetentionPolicy The blob service properties for blob soft delete + * @return the next update stage + */ + Update withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy); + } + + /** + * The stage of the blobserviceproperties update allowing to specify IsVersioningEnabled. + */ + interface WithIsVersioningEnabled { + /** + * Specifies isVersioningEnabled. + * @param isVersioningEnabled Versioning is enabled if set to true + * @return the next update stage + */ + Update withIsVersioningEnabled(Boolean isVersioningEnabled); + } + + /** + * The stage of the blobserviceproperties update allowing to specify RestorePolicy. + */ + interface WithRestorePolicy { + /** + * Specifies restorePolicy. + * @param restorePolicy The blob service properties for blob restore policy + * @return the next update stage + */ + Update withRestorePolicy(RestorePolicyProperties restorePolicy); + } + + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobServices.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobServices.java new file mode 100644 index 0000000000000..5dd51d8dc4308 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/BlobServices.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.BlobServicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BlobServices. + */ +public interface BlobServices extends SupportsCreating, HasInner { + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getServicePropertiesAsync(String resourceGroupName, String accountName); + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Bypass.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Bypass.java new file mode 100644 index 0000000000000..724b7ee9b6458 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Bypass.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Bypass. + */ +public final class Bypass extends ExpandableStringEnum { + /** Static value None for Bypass. */ + public static final Bypass NONE = fromString("None"); + + /** Static value Logging for Bypass. */ + public static final Bypass LOGGING = fromString("Logging"); + + /** Static value Metrics for Bypass. */ + public static final Bypass METRICS = fromString("Metrics"); + + /** Static value AzureServices for Bypass. */ + public static final Bypass AZURE_SERVICES = fromString("AzureServices"); + + /** + * Creates or finds a Bypass from its string representation. + * @param name a name to look for + * @return the corresponding Bypass + */ + @JsonCreator + public static Bypass fromString(String name) { + return fromString(name, Bypass.class); + } + + /** + * @return known Bypass values + */ + public static Collection values() { + return values(Bypass.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ChangeFeed.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ChangeFeed.java new file mode 100644 index 0000000000000..23700118a3900 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ChangeFeed.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The blob service properties for change feed events. + */ +public class ChangeFeed { + /** + * Indicates whether change feed event logging is enabled for the Blob + * service. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Get indicates whether change feed event logging is enabled for the Blob service. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set indicates whether change feed event logging is enabled for the Blob service. + * + * @param enabled the enabled value to set + * @return the ChangeFeed object itself. + */ + public ChangeFeed withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/CheckNameAvailabilityResult.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/CheckNameAvailabilityResult.java new file mode 100644 index 0000000000000..b7fe9de953f76 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/CheckNameAvailabilityResult.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.CheckNameAvailabilityResultInner; + +/** + * Type representing CheckNameAvailabilityResult. + */ +public interface CheckNameAvailabilityResult extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + Reason reason(); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/CorsRule.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/CorsRule.java new file mode 100644 index 0000000000000..909ffb1d3fa8c --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/CorsRule.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies a CORS rule for the Blob service. + */ +public class CorsRule { + /** + * Required if CorsRule element is present. A list of origin domains that + * will be allowed via CORS, or "*" to allow all domains. + */ + @JsonProperty(value = "allowedOrigins", required = true) + private List allowedOrigins; + + /** + * Required if CorsRule element is present. A list of HTTP methods that are + * allowed to be executed by the origin. + */ + @JsonProperty(value = "allowedMethods", required = true) + private List allowedMethods; + + /** + * Required if CorsRule element is present. The number of seconds that the + * client/browser should cache a preflight response. + */ + @JsonProperty(value = "maxAgeInSeconds", required = true) + private int maxAgeInSeconds; + + /** + * Required if CorsRule element is present. A list of response headers to + * expose to CORS clients. + */ + @JsonProperty(value = "exposedHeaders", required = true) + private List exposedHeaders; + + /** + * Required if CorsRule element is present. A list of headers allowed to be + * part of the cross-origin request. + */ + @JsonProperty(value = "allowedHeaders", required = true) + private List allowedHeaders; + + /** + * Get required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow all domains. + * + * @return the allowedOrigins value + */ + public List allowedOrigins() { + return this.allowedOrigins; + } + + /** + * Set required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow all domains. + * + * @param allowedOrigins the allowedOrigins value to set + * @return the CorsRule object itself. + */ + public CorsRule withAllowedOrigins(List allowedOrigins) { + this.allowedOrigins = allowedOrigins; + return this; + } + + /** + * Get required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin. + * + * @return the allowedMethods value + */ + public List allowedMethods() { + return this.allowedMethods; + } + + /** + * Set required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin. + * + * @param allowedMethods the allowedMethods value to set + * @return the CorsRule object itself. + */ + public CorsRule withAllowedMethods(List allowedMethods) { + this.allowedMethods = allowedMethods; + return this; + } + + /** + * Get required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight response. + * + * @return the maxAgeInSeconds value + */ + public int maxAgeInSeconds() { + return this.maxAgeInSeconds; + } + + /** + * Set required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight response. + * + * @param maxAgeInSeconds the maxAgeInSeconds value to set + * @return the CorsRule object itself. + */ + public CorsRule withMaxAgeInSeconds(int maxAgeInSeconds) { + this.maxAgeInSeconds = maxAgeInSeconds; + return this; + } + + /** + * Get required if CorsRule element is present. A list of response headers to expose to CORS clients. + * + * @return the exposedHeaders value + */ + public List exposedHeaders() { + return this.exposedHeaders; + } + + /** + * Set required if CorsRule element is present. A list of response headers to expose to CORS clients. + * + * @param exposedHeaders the exposedHeaders value to set + * @return the CorsRule object itself. + */ + public CorsRule withExposedHeaders(List exposedHeaders) { + this.exposedHeaders = exposedHeaders; + return this; + } + + /** + * Get required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request. + * + * @return the allowedHeaders value + */ + public List allowedHeaders() { + return this.allowedHeaders; + } + + /** + * Set required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request. + * + * @param allowedHeaders the allowedHeaders value to set + * @return the CorsRule object itself. + */ + public CorsRule withAllowedHeaders(List allowedHeaders) { + this.allowedHeaders = allowedHeaders; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/CorsRules.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/CorsRules.java new file mode 100644 index 0000000000000..e32fe01a55078 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/CorsRules.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Sets the CORS rules. You can include up to five CorsRule elements in the + * request. + */ +public class CorsRules { + /** + * The List of CORS rules. You can include up to five CorsRule elements in + * the request. + */ + @JsonProperty(value = "corsRules") + private List corsRules; + + /** + * Get the List of CORS rules. You can include up to five CorsRule elements in the request. + * + * @return the corsRules value + */ + public List corsRules() { + return this.corsRules; + } + + /** + * Set the List of CORS rules. You can include up to five CorsRule elements in the request. + * + * @param corsRules the corsRules value to set + * @return the CorsRules object itself. + */ + public CorsRules withCorsRules(List corsRules) { + this.corsRules = corsRules; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/CustomDomain.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/CustomDomain.java new file mode 100644 index 0000000000000..6687fd2fcbdf4 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/CustomDomain.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The custom domain assigned to this storage account. This can be set via + * Update. + */ +public class CustomDomain { + /** + * Gets or sets the custom domain name assigned to the storage account. + * Name is the CNAME source. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Indicates whether indirect CName validation is enabled. Default value is + * false. This should only be set on updates. + */ + @JsonProperty(value = "useSubDomainName") + private Boolean useSubDomainName; + + /** + * Get gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + * + * @param name the name value to set + * @return the CustomDomain object itself. + */ + public CustomDomain withName(String name) { + this.name = name; + return this; + } + + /** + * Get indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + * + * @return the useSubDomainName value + */ + public Boolean useSubDomainName() { + return this.useSubDomainName; + } + + /** + * Set indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + * + * @param useSubDomainName the useSubDomainName value to set + * @return the CustomDomain object itself. + */ + public CustomDomain withUseSubDomainName(Boolean useSubDomainName) { + this.useSubDomainName = useSubDomainName; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DateAfterCreation.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DateAfterCreation.java new file mode 100644 index 0000000000000..b45c0b852f7fc --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DateAfterCreation.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Object to define the number of days after creation. + */ +public class DateAfterCreation { + /** + * Value indicating the age in days after creation. + */ + @JsonProperty(value = "daysAfterCreationGreaterThan", required = true) + private double daysAfterCreationGreaterThan; + + /** + * Get value indicating the age in days after creation. + * + * @return the daysAfterCreationGreaterThan value + */ + public double daysAfterCreationGreaterThan() { + return this.daysAfterCreationGreaterThan; + } + + /** + * Set value indicating the age in days after creation. + * + * @param daysAfterCreationGreaterThan the daysAfterCreationGreaterThan value to set + * @return the DateAfterCreation object itself. + */ + public DateAfterCreation withDaysAfterCreationGreaterThan(double daysAfterCreationGreaterThan) { + this.daysAfterCreationGreaterThan = daysAfterCreationGreaterThan; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DateAfterModification.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DateAfterModification.java new file mode 100644 index 0000000000000..436b4c654771d --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DateAfterModification.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Object to define the number of days after last modification. + */ +public class DateAfterModification { + /** + * Value indicating the age in days after last modification. + */ + @JsonProperty(value = "daysAfterModificationGreaterThan", required = true) + private double daysAfterModificationGreaterThan; + + /** + * Get value indicating the age in days after last modification. + * + * @return the daysAfterModificationGreaterThan value + */ + public double daysAfterModificationGreaterThan() { + return this.daysAfterModificationGreaterThan; + } + + /** + * Set value indicating the age in days after last modification. + * + * @param daysAfterModificationGreaterThan the daysAfterModificationGreaterThan value to set + * @return the DateAfterModification object itself. + */ + public DateAfterModification withDaysAfterModificationGreaterThan(double daysAfterModificationGreaterThan) { + this.daysAfterModificationGreaterThan = daysAfterModificationGreaterThan; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DefaultAction.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DefaultAction.java new file mode 100644 index 0000000000000..2fd33143508ea --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DefaultAction.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DefaultAction. + */ +public enum DefaultAction { + /** Enum value Allow. */ + ALLOW("Allow"), + + /** Enum value Deny. */ + DENY("Deny"); + + /** The actual serialized value for a DefaultAction instance. */ + private String value; + + DefaultAction(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DefaultAction instance. + * + * @param value the serialized value to parse. + * @return the parsed DefaultAction object, or null if unable to parse. + */ + @JsonCreator + public static DefaultAction fromString(String value) { + DefaultAction[] items = DefaultAction.values(); + for (DefaultAction item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DeleteRetentionPolicy.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DeleteRetentionPolicy.java new file mode 100644 index 0000000000000..00af28ca976d4 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DeleteRetentionPolicy.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The service properties for soft delete. + */ +public class DeleteRetentionPolicy { + /** + * Indicates whether DeleteRetentionPolicy is enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Indicates the number of days that the deleted item should be retained. + * The minimum specified value can be 1 and the maximum value can be 365. + */ + @JsonProperty(value = "days") + private Integer days; + + /** + * Get indicates whether DeleteRetentionPolicy is enabled. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set indicates whether DeleteRetentionPolicy is enabled. + * + * @param enabled the enabled value to set + * @return the DeleteRetentionPolicy object itself. + */ + public DeleteRetentionPolicy withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum value can be 365. + * + * @return the days value + */ + public Integer days() { + return this.days; + } + + /** + * Set indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum value can be 365. + * + * @param days the days value to set + * @return the DeleteRetentionPolicy object itself. + */ + public DeleteRetentionPolicy withDays(Integer days) { + this.days = days; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DeletedAccount.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DeletedAccount.java new file mode 100644 index 0000000000000..015cde0ece077 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DeletedAccount.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.DeletedAccountInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; + +/** + * Type representing DeletedAccount. + */ +public interface DeletedAccount extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the creationTime value. + */ + String creationTime(); + + /** + * @return the deletionTime value. + */ + String deletionTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the restoreReference value. + */ + String restoreReference(); + + /** + * @return the storageAccountResourceId value. + */ + String storageAccountResourceId(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DeletedAccounts.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DeletedAccounts.java new file mode 100644 index 0000000000000..d98daf384298a --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DeletedAccounts.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.DeletedAccountsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DeletedAccounts. + */ +public interface DeletedAccounts extends HasInner { + /** + * Lists deleted accounts under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String deletedAccountName, String location); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DeletedShare.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DeletedShare.java new file mode 100644 index 0000000000000..03a09cb22d6b4 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DeletedShare.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The deleted share to be restored. + */ +public class DeletedShare { + /** + * Required. Identify the name of the deleted share that will be restored. + */ + @JsonProperty(value = "deletedShareName", required = true) + private String deletedShareName; + + /** + * Required. Identify the version of the deleted share that will be + * restored. + */ + @JsonProperty(value = "deletedShareVersion", required = true) + private String deletedShareVersion; + + /** + * Get required. Identify the name of the deleted share that will be restored. + * + * @return the deletedShareName value + */ + public String deletedShareName() { + return this.deletedShareName; + } + + /** + * Set required. Identify the name of the deleted share that will be restored. + * + * @param deletedShareName the deletedShareName value to set + * @return the DeletedShare object itself. + */ + public DeletedShare withDeletedShareName(String deletedShareName) { + this.deletedShareName = deletedShareName; + return this; + } + + /** + * Get required. Identify the version of the deleted share that will be restored. + * + * @return the deletedShareVersion value + */ + public String deletedShareVersion() { + return this.deletedShareVersion; + } + + /** + * Set required. Identify the version of the deleted share that will be restored. + * + * @param deletedShareVersion the deletedShareVersion value to set + * @return the DeletedShare object itself. + */ + public DeletedShare withDeletedShareVersion(String deletedShareVersion) { + this.deletedShareVersion = deletedShareVersion; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Dimension.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Dimension.java new file mode 100644 index 0000000000000..0e77013212dce --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Dimension.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Dimension of blobs, possibly be blob type or access tier. + */ +public class Dimension { + /** + * Display name of dimension. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display name of dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get display name of dimension. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set display name of dimension. + * + * @param name the name value to set + * @return the Dimension object itself. + */ + public Dimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get display name of dimension. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set display name of dimension. + * + * @param displayName the displayName value to set + * @return the Dimension object itself. + */ + public Dimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DirectoryServiceOptions.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DirectoryServiceOptions.java new file mode 100644 index 0000000000000..edcc7eebf09e0 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/DirectoryServiceOptions.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DirectoryServiceOptions. + */ +public final class DirectoryServiceOptions extends ExpandableStringEnum { + /** Static value None for DirectoryServiceOptions. */ + public static final DirectoryServiceOptions NONE = fromString("None"); + + /** Static value AADDS for DirectoryServiceOptions. */ + public static final DirectoryServiceOptions AADDS = fromString("AADDS"); + + /** Static value AD for DirectoryServiceOptions. */ + public static final DirectoryServiceOptions AD = fromString("AD"); + + /** + * Creates or finds a DirectoryServiceOptions from its string representation. + * @param name a name to look for + * @return the corresponding DirectoryServiceOptions + */ + @JsonCreator + public static DirectoryServiceOptions fromString(String name) { + return fromString(name, DirectoryServiceOptions.class); + } + + /** + * @return known DirectoryServiceOptions values + */ + public static Collection values() { + return values(DirectoryServiceOptions.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EnabledProtocols.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EnabledProtocols.java new file mode 100644 index 0000000000000..597f38aa68fe5 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EnabledProtocols.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EnabledProtocols. + */ +public final class EnabledProtocols extends ExpandableStringEnum { + /** Static value SMB for EnabledProtocols. */ + public static final EnabledProtocols SMB = fromString("SMB"); + + /** Static value NFS for EnabledProtocols. */ + public static final EnabledProtocols NFS = fromString("NFS"); + + /** + * Creates or finds a EnabledProtocols from its string representation. + * @param name a name to look for + * @return the corresponding EnabledProtocols + */ + @JsonCreator + public static EnabledProtocols fromString(String name) { + return fromString(name, EnabledProtocols.class); + } + + /** + * @return known EnabledProtocols values + */ + public static Collection values() { + return values(EnabledProtocols.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Encryption.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Encryption.java new file mode 100644 index 0000000000000..a18b3c28fb344 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Encryption.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The encryption settings on the storage account. + */ +public class Encryption { + /** + * List of services which support encryption. + */ + @JsonProperty(value = "services") + private EncryptionServices services; + + /** + * The encryption keySource (provider). Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.Keyvault. Possible values include: + * 'Microsoft.Storage', 'Microsoft.Keyvault'. + */ + @JsonProperty(value = "keySource", required = true) + private KeySource keySource; + + /** + * A boolean indicating whether or not the service applies a secondary + * layer of encryption with platform managed keys for data at rest. + */ + @JsonProperty(value = "requireInfrastructureEncryption") + private Boolean requireInfrastructureEncryption; + + /** + * Properties provided by key vault. + */ + @JsonProperty(value = "keyvaultproperties") + private KeyVaultProperties keyVaultProperties; + + /** + * Get list of services which support encryption. + * + * @return the services value + */ + public EncryptionServices services() { + return this.services; + } + + /** + * Set list of services which support encryption. + * + * @param services the services value to set + * @return the Encryption object itself. + */ + public Encryption withServices(EncryptionServices services) { + this.services = services; + return this; + } + + /** + * Get the encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + * + * @return the keySource value + */ + public KeySource keySource() { + return this.keySource; + } + + /** + * Set the encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + * + * @param keySource the keySource value to set + * @return the Encryption object itself. + */ + public Encryption withKeySource(KeySource keySource) { + this.keySource = keySource; + return this; + } + + /** + * Get a boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest. + * + * @return the requireInfrastructureEncryption value + */ + public Boolean requireInfrastructureEncryption() { + return this.requireInfrastructureEncryption; + } + + /** + * Set a boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest. + * + * @param requireInfrastructureEncryption the requireInfrastructureEncryption value to set + * @return the Encryption object itself. + */ + public Encryption withRequireInfrastructureEncryption(Boolean requireInfrastructureEncryption) { + this.requireInfrastructureEncryption = requireInfrastructureEncryption; + return this; + } + + /** + * Get properties provided by key vault. + * + * @return the keyVaultProperties value + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set properties provided by key vault. + * + * @param keyVaultProperties the keyVaultProperties value to set + * @return the Encryption object itself. + */ + public Encryption withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionScope.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionScope.java new file mode 100644 index 0000000000000..5951f08f09fc6 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionScope.java @@ -0,0 +1,186 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.EncryptionScopeInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import org.joda.time.DateTime; + +/** + * Type representing EncryptionScope. + */ +public interface EncryptionScope extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the creationTime value. + */ + DateTime creationTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the keyVaultProperties value. + */ + EncryptionScopeKeyVaultProperties keyVaultProperties(); + + /** + * @return the lastModifiedTime value. + */ + DateTime lastModifiedTime(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the source value. + */ + EncryptionScopeSource source(); + + /** + * @return the state value. + */ + EncryptionScopeState state(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the EncryptionScope definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithStorageAccount, DefinitionStages.WithCreate { + } + + /** + * Grouping of EncryptionScope definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a EncryptionScope definition. + */ + interface Blank extends WithStorageAccount { + } + + /** + * The stage of the encryptionscope definition allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only + * @return the next definition stage + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the encryptionscope definition allowing to specify KeyVaultProperties. + */ + interface WithKeyVaultProperties { + /** + * Specifies keyVaultProperties. + * @param keyVaultProperties The key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is set to 'Microsoft.KeyVault' + * @return the next definition stage + */ + WithCreate withKeyVaultProperties(EncryptionScopeKeyVaultProperties keyVaultProperties); + } + + /** + * The stage of the encryptionscope definition allowing to specify Source. + */ + interface WithSource { + /** + * Specifies source. + * @param source The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. Possible values include: 'Microsoft.Storage', 'Microsoft.KeyVault' + * @return the next definition stage + */ + WithCreate withSource(EncryptionScopeSource source); + } + + /** + * The stage of the encryptionscope definition allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + * @param state The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. Possible values include: 'Enabled', 'Disabled' + * @return the next definition stage + */ + WithCreate withState(EncryptionScopeState state); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithKeyVaultProperties, DefinitionStages.WithSource, DefinitionStages.WithState { + } + } + /** + * The template for a EncryptionScope update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithKeyVaultProperties, UpdateStages.WithSource, UpdateStages.WithState { + } + + /** + * Grouping of EncryptionScope update stages. + */ + interface UpdateStages { + /** + * The stage of the encryptionscope update allowing to specify KeyVaultProperties. + */ + interface WithKeyVaultProperties { + /** + * Specifies keyVaultProperties. + * @param keyVaultProperties The key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is set to 'Microsoft.KeyVault' + * @return the next update stage + */ + Update withKeyVaultProperties(EncryptionScopeKeyVaultProperties keyVaultProperties); + } + + /** + * The stage of the encryptionscope update allowing to specify Source. + */ + interface WithSource { + /** + * Specifies source. + * @param source The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. Possible values include: 'Microsoft.Storage', 'Microsoft.KeyVault' + * @return the next update stage + */ + Update withSource(EncryptionScopeSource source); + } + + /** + * The stage of the encryptionscope update allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + * @param state The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. Possible values include: 'Enabled', 'Disabled' + * @return the next update stage + */ + Update withState(EncryptionScopeState state); + } + + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionScopeKeyVaultProperties.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionScopeKeyVaultProperties.java new file mode 100644 index 0000000000000..96387e2a2bc47 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionScopeKeyVaultProperties.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The key vault properties for the encryption scope. This is a required field + * if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + */ +public class EncryptionScopeKeyVaultProperties { + /** + * The object identifier for a key vault key object. When applied, the + * encryption scope will use the key referenced by the identifier to enable + * customer-managed key support on this encryption scope. + */ + @JsonProperty(value = "keyUri") + private String keyUri; + + /** + * Get the object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the identifier to enable customer-managed key support on this encryption scope. + * + * @return the keyUri value + */ + public String keyUri() { + return this.keyUri; + } + + /** + * Set the object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the identifier to enable customer-managed key support on this encryption scope. + * + * @param keyUri the keyUri value to set + * @return the EncryptionScopeKeyVaultProperties object itself. + */ + public EncryptionScopeKeyVaultProperties withKeyUri(String keyUri) { + this.keyUri = keyUri; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionScopeSource.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionScopeSource.java new file mode 100644 index 0000000000000..c4f0b01c3fc6e --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionScopeSource.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EncryptionScopeSource. + */ +public final class EncryptionScopeSource extends ExpandableStringEnum { + /** Static value Microsoft.Storage for EncryptionScopeSource. */ + public static final EncryptionScopeSource MICROSOFT_STORAGE = fromString("Microsoft.Storage"); + + /** Static value Microsoft.KeyVault for EncryptionScopeSource. */ + public static final EncryptionScopeSource MICROSOFT_KEY_VAULT = fromString("Microsoft.KeyVault"); + + /** + * Creates or finds a EncryptionScopeSource from its string representation. + * @param name a name to look for + * @return the corresponding EncryptionScopeSource + */ + @JsonCreator + public static EncryptionScopeSource fromString(String name) { + return fromString(name, EncryptionScopeSource.class); + } + + /** + * @return known EncryptionScopeSource values + */ + public static Collection values() { + return values(EncryptionScopeSource.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionScopeState.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionScopeState.java new file mode 100644 index 0000000000000..51013d6b04f8d --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionScopeState.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EncryptionScopeState. + */ +public final class EncryptionScopeState extends ExpandableStringEnum { + /** Static value Enabled for EncryptionScopeState. */ + public static final EncryptionScopeState ENABLED = fromString("Enabled"); + + /** Static value Disabled for EncryptionScopeState. */ + public static final EncryptionScopeState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a EncryptionScopeState from its string representation. + * @param name a name to look for + * @return the corresponding EncryptionScopeState + */ + @JsonCreator + public static EncryptionScopeState fromString(String name) { + return fromString(name, EncryptionScopeState.class); + } + + /** + * @return known EncryptionScopeState values + */ + public static Collection values() { + return values(EncryptionScopeState.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionScopes.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionScopes.java new file mode 100644 index 0000000000000..1a198ef4ce494 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionScopes.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.EncryptionScopesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing EncryptionScopes. + */ +public interface EncryptionScopes extends SupportsCreating, HasInner { + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String encryptionScopeName); + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionService.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionService.java new file mode 100644 index 0000000000000..fc24247d1a3e5 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionService.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A service that allows server-side encryption to be used. + */ +public class EncryptionService { + /** + * A boolean indicating whether or not the service encrypts the data as it + * is stored. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Gets a rough estimate of the date/time when the encryption was last + * enabled by the user. Only returned when encryption is enabled. There + * might be some unencrypted blobs which were written after this time, as + * it is just a rough estimate. + */ + @JsonProperty(value = "lastEnabledTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastEnabledTime; + + /** + * Encryption key type to be used for the encryption service. 'Account' key + * type implies that an account-scoped encryption key will be used. + * 'Service' key type implies that a default service key is used. Possible + * values include: 'Service', 'Account'. + */ + @JsonProperty(value = "keyType") + private KeyType keyType; + + /** + * Get a boolean indicating whether or not the service encrypts the data as it is stored. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set a boolean indicating whether or not the service encrypts the data as it is stored. + * + * @param enabled the enabled value to set + * @return the EncryptionService object itself. + */ + public EncryptionService withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get gets a rough estimate of the date/time when the encryption was last enabled by the user. Only returned when encryption is enabled. There might be some unencrypted blobs which were written after this time, as it is just a rough estimate. + * + * @return the lastEnabledTime value + */ + public DateTime lastEnabledTime() { + return this.lastEnabledTime; + } + + /** + * Get encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. Possible values include: 'Service', 'Account'. + * + * @return the keyType value + */ + public KeyType keyType() { + return this.keyType; + } + + /** + * Set encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. Possible values include: 'Service', 'Account'. + * + * @param keyType the keyType value to set + * @return the EncryptionService object itself. + */ + public EncryptionService withKeyType(KeyType keyType) { + this.keyType = keyType; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionServices.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionServices.java new file mode 100644 index 0000000000000..58e75e12abbd7 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/EncryptionServices.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A list of services that support encryption. + */ +public class EncryptionServices { + /** + * The encryption function of the blob storage service. + */ + @JsonProperty(value = "blob") + private EncryptionService blob; + + /** + * The encryption function of the file storage service. + */ + @JsonProperty(value = "file") + private EncryptionService file; + + /** + * The encryption function of the table storage service. + */ + @JsonProperty(value = "table") + private EncryptionService table; + + /** + * The encryption function of the queue storage service. + */ + @JsonProperty(value = "queue") + private EncryptionService queue; + + /** + * Get the encryption function of the blob storage service. + * + * @return the blob value + */ + public EncryptionService blob() { + return this.blob; + } + + /** + * Set the encryption function of the blob storage service. + * + * @param blob the blob value to set + * @return the EncryptionServices object itself. + */ + public EncryptionServices withBlob(EncryptionService blob) { + this.blob = blob; + return this; + } + + /** + * Get the encryption function of the file storage service. + * + * @return the file value + */ + public EncryptionService file() { + return this.file; + } + + /** + * Set the encryption function of the file storage service. + * + * @param file the file value to set + * @return the EncryptionServices object itself. + */ + public EncryptionServices withFile(EncryptionService file) { + this.file = file; + return this; + } + + /** + * Get the encryption function of the table storage service. + * + * @return the table value + */ + public EncryptionService table() { + return this.table; + } + + /** + * Set the encryption function of the table storage service. + * + * @param table the table value to set + * @return the EncryptionServices object itself. + */ + public EncryptionServices withTable(EncryptionService table) { + this.table = table; + return this; + } + + /** + * Get the encryption function of the queue storage service. + * + * @return the queue value + */ + public EncryptionService queue() { + return this.queue; + } + + /** + * Set the encryption function of the queue storage service. + * + * @param queue the queue value to set + * @return the EncryptionServices object itself. + */ + public EncryptionServices withQueue(EncryptionService queue) { + this.queue = queue; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Endpoints.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Endpoints.java new file mode 100644 index 0000000000000..8883875037953 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Endpoints.java @@ -0,0 +1,160 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The URIs that are used to perform a retrieval of a public blob, queue, + * table, web or dfs object. + */ +public class Endpoints { + /** + * Gets the blob endpoint. + */ + @JsonProperty(value = "blob", access = JsonProperty.Access.WRITE_ONLY) + private String blob; + + /** + * Gets the queue endpoint. + */ + @JsonProperty(value = "queue", access = JsonProperty.Access.WRITE_ONLY) + private String queue; + + /** + * Gets the table endpoint. + */ + @JsonProperty(value = "table", access = JsonProperty.Access.WRITE_ONLY) + private String table; + + /** + * Gets the file endpoint. + */ + @JsonProperty(value = "file", access = JsonProperty.Access.WRITE_ONLY) + private String file; + + /** + * Gets the web endpoint. + */ + @JsonProperty(value = "web", access = JsonProperty.Access.WRITE_ONLY) + private String web; + + /** + * Gets the dfs endpoint. + */ + @JsonProperty(value = "dfs", access = JsonProperty.Access.WRITE_ONLY) + private String dfs; + + /** + * Gets the microsoft routing storage endpoints. + */ + @JsonProperty(value = "microsoftEndpoints") + private StorageAccountMicrosoftEndpoints microsoftEndpoints; + + /** + * Gets the internet routing storage endpoints. + */ + @JsonProperty(value = "internetEndpoints") + private StorageAccountInternetEndpoints internetEndpoints; + + /** + * Get gets the blob endpoint. + * + * @return the blob value + */ + public String blob() { + return this.blob; + } + + /** + * Get gets the queue endpoint. + * + * @return the queue value + */ + public String queue() { + return this.queue; + } + + /** + * Get gets the table endpoint. + * + * @return the table value + */ + public String table() { + return this.table; + } + + /** + * Get gets the file endpoint. + * + * @return the file value + */ + public String file() { + return this.file; + } + + /** + * Get gets the web endpoint. + * + * @return the web value + */ + public String web() { + return this.web; + } + + /** + * Get gets the dfs endpoint. + * + * @return the dfs value + */ + public String dfs() { + return this.dfs; + } + + /** + * Get gets the microsoft routing storage endpoints. + * + * @return the microsoftEndpoints value + */ + public StorageAccountMicrosoftEndpoints microsoftEndpoints() { + return this.microsoftEndpoints; + } + + /** + * Set gets the microsoft routing storage endpoints. + * + * @param microsoftEndpoints the microsoftEndpoints value to set + * @return the Endpoints object itself. + */ + public Endpoints withMicrosoftEndpoints(StorageAccountMicrosoftEndpoints microsoftEndpoints) { + this.microsoftEndpoints = microsoftEndpoints; + return this; + } + + /** + * Get gets the internet routing storage endpoints. + * + * @return the internetEndpoints value + */ + public StorageAccountInternetEndpoints internetEndpoints() { + return this.internetEndpoints; + } + + /** + * Set gets the internet routing storage endpoints. + * + * @param internetEndpoints the internetEndpoints value to set + * @return the Endpoints object itself. + */ + public Endpoints withInternetEndpoints(StorageAccountInternetEndpoints internetEndpoints) { + this.internetEndpoints = internetEndpoints; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ErrorResponse.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ErrorResponse.java new file mode 100644 index 0000000000000..6f11b73a7e57d --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ErrorResponse.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An error response from the storage resource provider. + */ +public class ErrorResponse { + /** + * Azure Storage Resource Provider error response body. + */ + @JsonProperty(value = "error") + private ErrorResponseBody error; + + /** + * Get azure Storage Resource Provider error response body. + * + * @return the error value + */ + public ErrorResponseBody error() { + return this.error; + } + + /** + * Set azure Storage Resource Provider error response body. + * + * @param error the error value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withError(ErrorResponseBody error) { + this.error = error; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ErrorResponseBody.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ErrorResponseBody.java new file mode 100644 index 0000000000000..971caa71b42ab --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ErrorResponseBody.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error response body contract. + */ +public class ErrorResponseBody { + /** + * An identifier for the error. Codes are invariant and are intended to be + * consumed programmatically. + */ + @JsonProperty(value = "code") + private String code; + + /** + * A message describing the error, intended to be suitable for display in a + * user interface. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get an identifier for the error. Codes are invariant and are intended to be consumed programmatically. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set an identifier for the error. Codes are invariant and are intended to be consumed programmatically. + * + * @param code the code value to set + * @return the ErrorResponseBody object itself. + */ + public ErrorResponseBody withCode(String code) { + this.code = code; + return this; + } + + /** + * Get a message describing the error, intended to be suitable for display in a user interface. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set a message describing the error, intended to be suitable for display in a user interface. + * + * @param message the message value to set + * @return the ErrorResponseBody object itself. + */ + public ErrorResponseBody withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ErrorResponseException.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ErrorResponseException.java new file mode 100644 index 0000000000000..01528046c5fb8 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ExtendedLocation.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ExtendedLocation.java new file mode 100644 index 0000000000000..042bed699a6bb --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ExtendedLocation.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The complex type of the extended location. + */ +public class ExtendedLocation { + /** + * The name of the extended location. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The type of the extended location. Possible values include: 'EdgeZone'. + */ + @JsonProperty(value = "type") + private ExtendedLocationTypes type; + + /** + * Get the name of the extended location. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the extended location. + * + * @param name the name value to set + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of the extended location. Possible values include: 'EdgeZone'. + * + * @return the type value + */ + public ExtendedLocationTypes type() { + return this.type; + } + + /** + * Set the type of the extended location. Possible values include: 'EdgeZone'. + * + * @param type the type value to set + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withType(ExtendedLocationTypes type) { + this.type = type; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ExtendedLocationTypes.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ExtendedLocationTypes.java new file mode 100644 index 0000000000000..c918c6e5779af --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ExtendedLocationTypes.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExtendedLocationTypes. + */ +public final class ExtendedLocationTypes extends ExpandableStringEnum { + /** Static value EdgeZone for ExtendedLocationTypes. */ + public static final ExtendedLocationTypes EDGE_ZONE = fromString("EdgeZone"); + + /** + * Creates or finds a ExtendedLocationTypes from its string representation. + * @param name a name to look for + * @return the corresponding ExtendedLocationTypes + */ + @JsonCreator + public static ExtendedLocationTypes fromString(String name) { + return fromString(name, ExtendedLocationTypes.class); + } + + /** + * @return known ExtendedLocationTypes values + */ + public static Collection values() { + return values(ExtendedLocationTypes.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/FileServiceItems.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/FileServiceItems.java new file mode 100644 index 0000000000000..28160b07bdf17 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/FileServiceItems.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.FileServiceItemsInner; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.FileServicePropertiesInner; +import java.util.List; + +/** + * Type representing FileServiceItems. + */ +public interface FileServiceItems extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/FileServiceProperties.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/FileServiceProperties.java new file mode 100644 index 0000000000000..2e194a8a1c7a8 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/FileServiceProperties.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.FileServicePropertiesInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import java.util.List; + +/** + * Type representing FileServiceProperties. + */ +public interface FileServiceProperties extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the cors value. + */ + CorsRules cors(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the shareDeleteRetentionPolicy value. + */ + DeleteRetentionPolicy shareDeleteRetentionPolicy(); + + /** + * @return the sku value. + */ + SkuInner sku(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the FileServiceProperties definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithStorageAccount, DefinitionStages.WithCors, DefinitionStages.WithShareDeleteRetentionPolicy, DefinitionStages.WithCreate { + } + + /** + * Grouping of FileServiceProperties definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a FileServiceProperties definition. + */ + interface Blank extends WithStorageAccount { + } + + /** + * The stage of the fileserviceproperties definition allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only + * @return the next definition stage + */ + WithCors withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the fileserviceproperties definition allowing to specify Cors. + */ + interface WithCors { + /** + * Specifies cors. + * @param cors Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the File service + * @return the next definition stage + */ + WithShareDeleteRetentionPolicy withCors(CorsRules cors); + } + + /** + * The stage of the fileserviceproperties definition allowing to specify ShareDeleteRetentionPolicy. + */ + interface WithShareDeleteRetentionPolicy { + /** + * Specifies shareDeleteRetentionPolicy. + * @param shareDeleteRetentionPolicy The file service properties for share soft delete + * @return the next definition stage + */ + WithCreate withShareDeleteRetentionPolicy(DeleteRetentionPolicy shareDeleteRetentionPolicy); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a FileServiceProperties update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCors, UpdateStages.WithShareDeleteRetentionPolicy { + } + + /** + * Grouping of FileServiceProperties update stages. + */ + interface UpdateStages { + /** + * The stage of the fileserviceproperties update allowing to specify Cors. + */ + interface WithCors { + /** + * Specifies cors. + * @param cors Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the File service + * @return the next update stage + */ + Update withCors(CorsRules cors); + } + + /** + * The stage of the fileserviceproperties update allowing to specify ShareDeleteRetentionPolicy. + */ + interface WithShareDeleteRetentionPolicy { + /** + * Specifies shareDeleteRetentionPolicy. + * @param shareDeleteRetentionPolicy The file service properties for share soft delete + * @return the next update stage + */ + Update withShareDeleteRetentionPolicy(DeleteRetentionPolicy shareDeleteRetentionPolicy); + } + + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/FileServices.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/FileServices.java new file mode 100644 index 0000000000000..95352f8eed1a1 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/FileServices.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.FileServicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing FileServices. + */ +public interface FileServices extends SupportsCreating, HasInner { + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName); + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getServicePropertiesAsync(String resourceGroupName, String accountName); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/FileShare.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/FileShare.java new file mode 100644 index 0000000000000..841c768c76d64 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/FileShare.java @@ -0,0 +1,279 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.FileShareInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import org.joda.time.DateTime; +import java.util.Map; + +/** + * Type representing FileShare. + */ +public interface FileShare extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the accessTier value. + */ + ShareAccessTier accessTier(); + + /** + * @return the accessTierChangeTime value. + */ + DateTime accessTierChangeTime(); + + /** + * @return the accessTierStatus value. + */ + String accessTierStatus(); + + /** + * @return the deleted value. + */ + Boolean deleted(); + + /** + * @return the deletedTime value. + */ + DateTime deletedTime(); + + /** + * @return the enabledProtocols value. + */ + EnabledProtocols enabledProtocols(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModifiedTime value. + */ + DateTime lastModifiedTime(); + + /** + * @return the metadata value. + */ + Map metadata(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the remainingRetentionDays value. + */ + Integer remainingRetentionDays(); + + /** + * @return the rootSquash value. + */ + RootSquashType rootSquash(); + + /** + * @return the shareQuota value. + */ + Integer shareQuota(); + + /** + * @return the shareUsageBytes value. + */ + Long shareUsageBytes(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the version value. + */ + String version(); + + /** + * The entirety of the FileShare definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithFileService, DefinitionStages.WithCreate { + } + + /** + * Grouping of FileShare definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a FileShare definition. + */ + interface Blank extends WithFileService { + } + + /** + * The stage of the fileshare definition allowing to specify FileService. + */ + interface WithFileService { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only + * @return the next definition stage + */ + WithCreate withExistingFileService(String resourceGroupName, String accountName); + } + + /** + * The stage of the fileshare definition allowing to specify AccessTier. + */ + interface WithAccessTier { + /** + * Specifies accessTier. + * @param accessTier Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Possible values include: 'TransactionOptimized', 'Hot', 'Cool', 'Premium' + * @return the next definition stage + */ + WithCreate withAccessTier(ShareAccessTier accessTier); + } + + /** + * The stage of the fileshare definition allowing to specify EnabledProtocols. + */ + interface WithEnabledProtocols { + /** + * Specifies enabledProtocols. + * @param enabledProtocols The authentication protocol that is used for the file share. Can only be specified when creating a share. Possible values include: 'SMB', 'NFS' + * @return the next definition stage + */ + WithCreate withEnabledProtocols(EnabledProtocols enabledProtocols); + } + + /** + * The stage of the fileshare definition allowing to specify Metadata. + */ + interface WithMetadata { + /** + * Specifies metadata. + * @param metadata A name-value pair to associate with the share as metadata + * @return the next definition stage + */ + WithCreate withMetadata(Map metadata); + } + + /** + * The stage of the fileshare definition allowing to specify RootSquash. + */ + interface WithRootSquash { + /** + * Specifies rootSquash. + * @param rootSquash The property is for NFS share only. The default is NoRootSquash. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash' + * @return the next definition stage + */ + WithCreate withRootSquash(RootSquashType rootSquash); + } + + /** + * The stage of the fileshare definition allowing to specify ShareQuota. + */ + interface WithShareQuota { + /** + * Specifies shareQuota. + * @param shareQuota The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400 + * @return the next definition stage + */ + WithCreate withShareQuota(Integer shareQuota); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAccessTier, DefinitionStages.WithEnabledProtocols, DefinitionStages.WithMetadata, DefinitionStages.WithRootSquash, DefinitionStages.WithShareQuota { + } + } + /** + * The template for a FileShare update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAccessTier, UpdateStages.WithEnabledProtocols, UpdateStages.WithMetadata, UpdateStages.WithRootSquash, UpdateStages.WithShareQuota { + } + + /** + * Grouping of FileShare update stages. + */ + interface UpdateStages { + /** + * The stage of the fileshare update allowing to specify AccessTier. + */ + interface WithAccessTier { + /** + * Specifies accessTier. + * @param accessTier Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Possible values include: 'TransactionOptimized', 'Hot', 'Cool', 'Premium' + * @return the next update stage + */ + Update withAccessTier(ShareAccessTier accessTier); + } + + /** + * The stage of the fileshare update allowing to specify EnabledProtocols. + */ + interface WithEnabledProtocols { + /** + * Specifies enabledProtocols. + * @param enabledProtocols The authentication protocol that is used for the file share. Can only be specified when creating a share. Possible values include: 'SMB', 'NFS' + * @return the next update stage + */ + Update withEnabledProtocols(EnabledProtocols enabledProtocols); + } + + /** + * The stage of the fileshare update allowing to specify Metadata. + */ + interface WithMetadata { + /** + * Specifies metadata. + * @param metadata A name-value pair to associate with the share as metadata + * @return the next update stage + */ + Update withMetadata(Map metadata); + } + + /** + * The stage of the fileshare update allowing to specify RootSquash. + */ + interface WithRootSquash { + /** + * Specifies rootSquash. + * @param rootSquash The property is for NFS share only. The default is NoRootSquash. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash' + * @return the next update stage + */ + Update withRootSquash(RootSquashType rootSquash); + } + + /** + * The stage of the fileshare update allowing to specify ShareQuota. + */ + interface WithShareQuota { + /** + * Specifies shareQuota. + * @param shareQuota The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400 + * @return the next update stage + */ + Update withShareQuota(Integer shareQuota); + } + + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/FileShareItem.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/FileShareItem.java new file mode 100644 index 0000000000000..587a0ebd6a189 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/FileShareItem.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.FileShareItemInner; +import org.joda.time.DateTime; +import java.util.Map; + +/** + * Type representing FileShareItem. + */ +public interface FileShareItem extends HasInner, HasManager { + /** + * @return the accessTier value. + */ + ShareAccessTier accessTier(); + + /** + * @return the accessTierChangeTime value. + */ + DateTime accessTierChangeTime(); + + /** + * @return the accessTierStatus value. + */ + String accessTierStatus(); + + /** + * @return the deleted value. + */ + Boolean deleted(); + + /** + * @return the deletedTime value. + */ + DateTime deletedTime(); + + /** + * @return the enabledProtocols value. + */ + EnabledProtocols enabledProtocols(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModifiedTime value. + */ + DateTime lastModifiedTime(); + + /** + * @return the metadata value. + */ + Map metadata(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the remainingRetentionDays value. + */ + Integer remainingRetentionDays(); + + /** + * @return the rootSquash value. + */ + RootSquashType rootSquash(); + + /** + * @return the shareQuota value. + */ + Integer shareQuota(); + + /** + * @return the shareUsageBytes value. + */ + Long shareUsageBytes(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the version value. + */ + String version(); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/FileShares.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/FileShares.java new file mode 100644 index 0000000000000..8e137a6c944cf --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/FileShares.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.FileSharesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing FileShares. + */ +public interface FileShares extends SupportsCreating, HasInner { + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String shareName); + + /** + * Deletes specified share 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 shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String shareName); + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share 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 deletedShareName Required. Identify the name of the deleted share that will be restored. + * @param deletedShareVersion Required. Identify the version of the deleted share that will be restored. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable restoreAsync(String resourceGroupName, String accountName, String shareName, String deletedShareName, String deletedShareVersion); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/GeoReplicationStats.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/GeoReplicationStats.java new file mode 100644 index 0000000000000..d41157c761f6f --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/GeoReplicationStats.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Statistics related to replication for storage account's Blob, Table, Queue + * and File services. It is only available when geo-redundant replication is + * enabled for the storage account. + */ +public class GeoReplicationStats { + /** + * The status of the secondary location. Possible values are: - Live: + * Indicates that the secondary location is active and operational. - + * Bootstrap: Indicates initial synchronization from the primary location + * to the secondary location is in progress.This typically occurs when + * replication is first enabled. - Unavailable: Indicates that the + * secondary location is temporarily unavailable. Possible values include: + * 'Live', 'Bootstrap', 'Unavailable'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private GeoReplicationStatus status; + + /** + * All primary writes preceding this UTC date/time value are guaranteed to + * be available for read operations. Primary writes following this point in + * time may or may not be available for reads. Element may be default value + * if value of LastSyncTime is not available, this can happen if secondary + * is offline or we are in bootstrap. + */ + @JsonProperty(value = "lastSyncTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastSyncTime; + + /** + * A boolean flag which indicates whether or not account failover is + * supported for the account. + */ + @JsonProperty(value = "canFailover", access = JsonProperty.Access.WRITE_ONLY) + private Boolean canFailover; + + /** + * Get the status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location is temporarily unavailable. Possible values include: 'Live', 'Bootstrap', 'Unavailable'. + * + * @return the status value + */ + public GeoReplicationStatus status() { + return this.status; + } + + /** + * Get all primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary writes following this point in time may or may not be available for reads. Element may be default value if value of LastSyncTime is not available, this can happen if secondary is offline or we are in bootstrap. + * + * @return the lastSyncTime value + */ + public DateTime lastSyncTime() { + return this.lastSyncTime; + } + + /** + * Get a boolean flag which indicates whether or not account failover is supported for the account. + * + * @return the canFailover value + */ + public Boolean canFailover() { + return this.canFailover; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/GeoReplicationStatus.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/GeoReplicationStatus.java new file mode 100644 index 0000000000000..38d93f163b2d5 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/GeoReplicationStatus.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for GeoReplicationStatus. + */ +public final class GeoReplicationStatus extends ExpandableStringEnum { + /** Static value Live for GeoReplicationStatus. */ + public static final GeoReplicationStatus LIVE = fromString("Live"); + + /** Static value Bootstrap for GeoReplicationStatus. */ + public static final GeoReplicationStatus BOOTSTRAP = fromString("Bootstrap"); + + /** Static value Unavailable for GeoReplicationStatus. */ + public static final GeoReplicationStatus UNAVAILABLE = fromString("Unavailable"); + + /** + * Creates or finds a GeoReplicationStatus from its string representation. + * @param name a name to look for + * @return the corresponding GeoReplicationStatus + */ + @JsonCreator + public static GeoReplicationStatus fromString(String name) { + return fromString(name, GeoReplicationStatus.class); + } + + /** + * @return known GeoReplicationStatus values + */ + public static Collection values() { + return values(GeoReplicationStatus.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/GetShareExpand.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/GetShareExpand.java new file mode 100644 index 0000000000000..9cdc81b1896cd --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/GetShareExpand.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for GetShareExpand. + */ +public enum GetShareExpand { + /** Enum value stats. */ + STATS("stats"); + + /** The actual serialized value for a GetShareExpand instance. */ + private String value; + + GetShareExpand(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a GetShareExpand instance. + * + * @param value the serialized value to parse. + * @return the parsed GetShareExpand object, or null if unable to parse. + */ + @JsonCreator + public static GetShareExpand fromString(String value) { + GetShareExpand[] items = GetShareExpand.values(); + for (GetShareExpand item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/HttpProtocol.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/HttpProtocol.java new file mode 100644 index 0000000000000..dc74ada3521ae --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/HttpProtocol.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for HttpProtocol. + */ +public enum HttpProtocol { + /** Enum value https,http. */ + HTTPSHTTP("https,http"), + + /** Enum value https. */ + HTTPS("https"); + + /** The actual serialized value for a HttpProtocol instance. */ + private String value; + + HttpProtocol(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a HttpProtocol instance. + * + * @param value the serialized value to parse. + * @return the parsed HttpProtocol object, or null if unable to parse. + */ + @JsonCreator + public static HttpProtocol fromString(String value) { + HttpProtocol[] items = HttpProtocol.values(); + for (HttpProtocol item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/IPRule.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/IPRule.java new file mode 100644 index 0000000000000..81039bdfebd57 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/IPRule.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IP rule with specific IP or IP range in CIDR format. + */ +public class IPRule { + /** + * Specifies the IP or IP range in CIDR format. Only IPV4 address is + * allowed. + */ + @JsonProperty(value = "value", required = true) + private String iPAddressOrRange; + + /** + * The action of IP ACL rule. Possible values include: 'Allow'. + */ + @JsonProperty(value = "action") + private Action action; + + /** + * Get specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + * + * @return the iPAddressOrRange value + */ + public String iPAddressOrRange() { + return this.iPAddressOrRange; + } + + /** + * Set specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + * + * @param iPAddressOrRange the iPAddressOrRange value to set + * @return the IPRule object itself. + */ + public IPRule withIPAddressOrRange(String iPAddressOrRange) { + this.iPAddressOrRange = iPAddressOrRange; + return this; + } + + /** + * Get the action of IP ACL rule. Possible values include: 'Allow'. + * + * @return the action value + */ + public Action action() { + return this.action; + } + + /** + * Set the action of IP ACL rule. Possible values include: 'Allow'. + * + * @param action the action value to set + * @return the IPRule object itself. + */ + public IPRule withAction(Action action) { + this.action = action; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Identity.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Identity.java new file mode 100644 index 0000000000000..be464d5d53478 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Identity.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Identity for the resource. + */ +public class Identity { + /** + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * The identity type. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of Identity class. + */ + public Identity() { + type = "SystemAssigned"; + } + + /** + * Get the principal ID of resource identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant ID of resource. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the identity type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the identity type. + * + * @param type the type value to set + * @return the Identity object itself. + */ + public Identity withType(String type) { + this.type = type; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ImmutabilityPolicy.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ImmutabilityPolicy.java new file mode 100644 index 0000000000000..d0635380afc36 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ImmutabilityPolicy.java @@ -0,0 +1,181 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.ImmutabilityPolicyInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; + +/** + * Type representing ImmutabilityPolicy. + */ +public interface ImmutabilityPolicy extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the allowProtectedAppendWrites value. + */ + Boolean allowProtectedAppendWrites(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the immutabilityPeriodSinceCreationInDays value. + */ + Integer immutabilityPeriodSinceCreationInDays(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the state value. + */ + ImmutabilityPolicyState state(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ImmutabilityPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithContainer, DefinitionStages.WithIfMatch, DefinitionStages.WithImmutabilityPeriodSinceCreationInDays, DefinitionStages.WithAllowProtectedAppendWrites, DefinitionStages.WithCreate { + } + + /** + * Grouping of ImmutabilityPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ImmutabilityPolicy definition. + */ + interface Blank extends WithContainer { + } + + /** + * The stage of the immutabilitypolicy definition allowing to specify Container. + */ + interface WithContainer { + /** + * Specifies resourceGroupName, accountName, containerName. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number + * @return the next definition stage + */ + WithIfMatch withExistingContainer(String resourceGroupName, String accountName, String containerName); + } + + /** + * The stage of the immutabilitypolicy definition allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied + * @return the next definition stage + */ + WithImmutabilityPeriodSinceCreationInDays withIfMatch(String ifMatch); + } + + /** + * The stage of the immutabilitypolicy definition allowing to specify ImmutabilityPeriodSinceCreationInDays. + */ + interface WithImmutabilityPeriodSinceCreationInDays { + /** + * Specifies immutabilityPeriodSinceCreationInDays. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days + * @return the next definition stage + */ + WithAllowProtectedAppendWrites withImmutabilityPeriodSinceCreationInDays(Integer immutabilityPeriodSinceCreationInDays); + } + + /** + * The stage of the immutabilitypolicy definition allowing to specify AllowProtectedAppendWrites. + */ + interface WithAllowProtectedAppendWrites { + /** + * Specifies allowProtectedAppendWrites. + * @param allowProtectedAppendWrites This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API + * @return the next definition stage + */ + WithCreate withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a ImmutabilityPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithIfMatch, UpdateStages.WithImmutabilityPeriodSinceCreationInDays, UpdateStages.WithAllowProtectedAppendWrites { + } + + /** + * Grouping of ImmutabilityPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the immutabilitypolicy update allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied + * @return the next update stage + */ + Update withIfMatch(String ifMatch); + } + + /** + * The stage of the immutabilitypolicy update allowing to specify ImmutabilityPeriodSinceCreationInDays. + */ + interface WithImmutabilityPeriodSinceCreationInDays { + /** + * Specifies immutabilityPeriodSinceCreationInDays. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since the policy creation, in days + * @return the next update stage + */ + Update withImmutabilityPeriodSinceCreationInDays(Integer immutabilityPeriodSinceCreationInDays); + } + + /** + * The stage of the immutabilitypolicy update allowing to specify AllowProtectedAppendWrites. + */ + interface WithAllowProtectedAppendWrites { + /** + * Specifies allowProtectedAppendWrites. + * @param allowProtectedAppendWrites This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API + * @return the next update stage + */ + Update withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites); + } + + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ImmutabilityPolicyProperties.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ImmutabilityPolicyProperties.java new file mode 100644 index 0000000000000..bf5104400a680 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ImmutabilityPolicyProperties.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +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") + private Integer 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; + + /** + * This property can only be changed for unlocked time-based retention + * policies. When enabled, new blocks can be written to an append blob + * while maintaining immutability protection and compliance. Only new + * blocks can be added and any existing blocks cannot be modified or + * deleted. This property cannot be changed with ExtendImmutabilityPolicy + * API. + */ + @JsonProperty(value = "properties.allowProtectedAppendWrites") + private Boolean allowProtectedAppendWrites; + + /** + * 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 Integer 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(Integer 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 this property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + * + * @return the allowProtectedAppendWrites value + */ + public Boolean allowProtectedAppendWrites() { + return this.allowProtectedAppendWrites; + } + + /** + * Set this property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + * + * @param allowProtectedAppendWrites the allowProtectedAppendWrites value to set + * @return the ImmutabilityPolicyProperties object itself. + */ + public ImmutabilityPolicyProperties withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) { + this.allowProtectedAppendWrites = allowProtectedAppendWrites; + return this; + } + + /** + * 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/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ImmutabilityPolicyState.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ImmutabilityPolicyState.java new file mode 100644 index 0000000000000..c25ceed3c88e8 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ImmutabilityPolicyState.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +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/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ImmutabilityPolicyUpdateType.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ImmutabilityPolicyUpdateType.java new file mode 100644 index 0000000000000..dc6c8dbd2c044 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ImmutabilityPolicyUpdateType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +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/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/KeyPermission.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/KeyPermission.java new file mode 100644 index 0000000000000..c9cf28ad5916a --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/KeyPermission.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for KeyPermission. + */ +public enum KeyPermission { + /** Enum value Read. */ + READ("Read"), + + /** Enum value Full. */ + FULL("Full"); + + /** The actual serialized value for a KeyPermission instance. */ + private String value; + + KeyPermission(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a KeyPermission instance. + * + * @param value the serialized value to parse. + * @return the parsed KeyPermission object, or null if unable to parse. + */ + @JsonCreator + public static KeyPermission fromString(String value) { + KeyPermission[] items = KeyPermission.values(); + for (KeyPermission item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/KeySource.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/KeySource.java new file mode 100644 index 0000000000000..e6430b1578566 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/KeySource.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for KeySource. + */ +public final class KeySource extends ExpandableStringEnum { + /** Static value Microsoft.Storage for KeySource. */ + public static final KeySource MICROSOFT_STORAGE = fromString("Microsoft.Storage"); + + /** Static value Microsoft.Keyvault for KeySource. */ + public static final KeySource MICROSOFT_KEYVAULT = fromString("Microsoft.Keyvault"); + + /** + * Creates or finds a KeySource from its string representation. + * @param name a name to look for + * @return the corresponding KeySource + */ + @JsonCreator + public static KeySource fromString(String name) { + return fromString(name, KeySource.class); + } + + /** + * @return known KeySource values + */ + public static Collection values() { + return values(KeySource.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/KeyType.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/KeyType.java new file mode 100644 index 0000000000000..4a035af7e6326 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/KeyType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for KeyType. + */ +public final class KeyType extends ExpandableStringEnum { + /** Static value Service for KeyType. */ + public static final KeyType SERVICE = fromString("Service"); + + /** Static value Account for KeyType. */ + public static final KeyType ACCOUNT = fromString("Account"); + + /** + * Creates or finds a KeyType from its string representation. + * @param name a name to look for + * @return the corresponding KeyType + */ + @JsonCreator + public static KeyType fromString(String name) { + return fromString(name, KeyType.class); + } + + /** + * @return known KeyType values + */ + public static Collection values() { + return values(KeyType.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/KeyVaultProperties.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/KeyVaultProperties.java new file mode 100644 index 0000000000000..7e2d3dcd9c951 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/KeyVaultProperties.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of key vault. + */ +public class KeyVaultProperties { + /** + * The name of KeyVault key. + */ + @JsonProperty(value = "keyname") + private String keyName; + + /** + * The version of KeyVault key. + */ + @JsonProperty(value = "keyversion") + private String keyVersion; + + /** + * The Uri of KeyVault. + */ + @JsonProperty(value = "keyvaulturi") + private String keyVaultUri; + + /** + * The object identifier of the current versioned Key Vault Key in use. + */ + @JsonProperty(value = "currentVersionedKeyIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String currentVersionedKeyIdentifier; + + /** + * Timestamp of last rotation of the Key Vault Key. + */ + @JsonProperty(value = "lastKeyRotationTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastKeyRotationTimestamp; + + /** + * Get the name of KeyVault key. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the name of KeyVault key. + * + * @param keyName the keyName value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the version of KeyVault key. + * + * @return the keyVersion value + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the version of KeyVault key. + * + * @param keyVersion the keyVersion value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Get the Uri of KeyVault. + * + * @return the keyVaultUri value + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the Uri of KeyVault. + * + * @param keyVaultUri the keyVaultUri value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Get the object identifier of the current versioned Key Vault Key in use. + * + * @return the currentVersionedKeyIdentifier value + */ + public String currentVersionedKeyIdentifier() { + return this.currentVersionedKeyIdentifier; + } + + /** + * Get timestamp of last rotation of the Key Vault Key. + * + * @return the lastKeyRotationTimestamp value + */ + public DateTime lastKeyRotationTimestamp() { + return this.lastKeyRotationTimestamp; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Kind.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Kind.java new file mode 100644 index 0000000000000..4d69217196d4a --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Kind.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Kind. + */ +public final class Kind extends ExpandableStringEnum { + /** Static value Storage for Kind. */ + public static final Kind STORAGE = fromString("Storage"); + + /** Static value StorageV2 for Kind. */ + public static final Kind STORAGE_V2 = fromString("StorageV2"); + + /** Static value BlobStorage for Kind. */ + public static final Kind BLOB_STORAGE = fromString("BlobStorage"); + + /** Static value FileStorage for Kind. */ + public static final Kind FILE_STORAGE = fromString("FileStorage"); + + /** Static value BlockBlobStorage for Kind. */ + public static final Kind BLOCK_BLOB_STORAGE = fromString("BlockBlobStorage"); + + /** + * Creates or finds a Kind from its string representation. + * @param name a name to look for + * @return the corresponding Kind + */ + @JsonCreator + public static Kind fromString(String name) { + return fromString(name, Kind.class); + } + + /** + * @return known Kind values + */ + public static Collection values() { + return values(Kind.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LargeFileSharesState.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LargeFileSharesState.java new file mode 100644 index 0000000000000..93dbb0ab0beb0 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LargeFileSharesState.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LargeFileSharesState. + */ +public final class LargeFileSharesState extends ExpandableStringEnum { + /** Static value Disabled for LargeFileSharesState. */ + public static final LargeFileSharesState DISABLED = fromString("Disabled"); + + /** Static value Enabled for LargeFileSharesState. */ + public static final LargeFileSharesState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a LargeFileSharesState from its string representation. + * @param name a name to look for + * @return the corresponding LargeFileSharesState + */ + @JsonCreator + public static LargeFileSharesState fromString(String name) { + return fromString(name, LargeFileSharesState.class); + } + + /** + * @return known LargeFileSharesState values + */ + public static Collection values() { + return values(LargeFileSharesState.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LeaseContainerRequest.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LeaseContainerRequest.java new file mode 100644 index 0000000000000..f3bcc5e61df29 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LeaseContainerRequest.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Lease Container request schema. + */ +public class LeaseContainerRequest { + /** + * Specifies the lease action. Can be one of the available actions. + * Possible values include: 'Acquire', 'Renew', 'Change', 'Release', + * 'Break'. + */ + @JsonProperty(value = "action", required = true) + private String action; + + /** + * Identifies the lease. Can be specified in any valid GUID string format. + */ + @JsonProperty(value = "leaseId") + private String leaseId; + + /** + * Optional. For a break action, proposed duration the lease should + * continue before it is broken, in seconds, between 0 and 60. + */ + @JsonProperty(value = "breakPeriod") + private Integer breakPeriod; + + /** + * Required for acquire. Specifies the duration of the lease, in seconds, + * or negative one (-1) for a lease that never expires. + */ + @JsonProperty(value = "leaseDuration") + private Integer leaseDuration; + + /** + * Optional for acquire, required for change. Proposed lease ID, in a GUID + * string format. + */ + @JsonProperty(value = "proposedLeaseId") + private String proposedLeaseId; + + /** + * Get specifies the lease action. Can be one of the available actions. Possible values include: 'Acquire', 'Renew', 'Change', 'Release', 'Break'. + * + * @return the action value + */ + public String action() { + return this.action; + } + + /** + * Set specifies the lease action. Can be one of the available actions. Possible values include: 'Acquire', 'Renew', 'Change', 'Release', 'Break'. + * + * @param action the action value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withAction(String action) { + this.action = action; + return this; + } + + /** + * Get identifies the lease. Can be specified in any valid GUID string format. + * + * @return the leaseId value + */ + public String leaseId() { + return this.leaseId; + } + + /** + * Set identifies the lease. Can be specified in any valid GUID string format. + * + * @param leaseId the leaseId value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withLeaseId(String leaseId) { + this.leaseId = leaseId; + return this; + } + + /** + * Get optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + * + * @return the breakPeriod value + */ + public Integer breakPeriod() { + return this.breakPeriod; + } + + /** + * Set optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + * + * @param breakPeriod the breakPeriod value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withBreakPeriod(Integer breakPeriod) { + this.breakPeriod = breakPeriod; + return this; + } + + /** + * Get required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + * + * @return the leaseDuration value + */ + public Integer leaseDuration() { + return this.leaseDuration; + } + + /** + * Set required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + * + * @param leaseDuration the leaseDuration value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withLeaseDuration(Integer leaseDuration) { + this.leaseDuration = leaseDuration; + return this; + } + + /** + * Get optional for acquire, required for change. Proposed lease ID, in a GUID string format. + * + * @return the proposedLeaseId value + */ + public String proposedLeaseId() { + return this.proposedLeaseId; + } + + /** + * Set optional for acquire, required for change. Proposed lease ID, in a GUID string format. + * + * @param proposedLeaseId the proposedLeaseId value to set + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withProposedLeaseId(String proposedLeaseId) { + this.proposedLeaseId = proposedLeaseId; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LeaseContainerResponse.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LeaseContainerResponse.java new file mode 100644 index 0000000000000..fae062cce29ed --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LeaseContainerResponse.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.LeaseContainerResponseInner; + +/** + * Type representing LeaseContainerResponse. + */ +public interface LeaseContainerResponse extends HasInner, HasManager { + /** + * @return the leaseId value. + */ + String leaseId(); + + /** + * @return the leaseTimeSeconds value. + */ + String leaseTimeSeconds(); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LeaseDuration.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LeaseDuration.java new file mode 100644 index 0000000000000..b7e506b508709 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LeaseDuration.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +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/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LeaseState.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LeaseState.java new file mode 100644 index 0000000000000..0de715a4f0e58 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LeaseState.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +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/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LeaseStatus.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LeaseStatus.java new file mode 100644 index 0000000000000..1751c3f663166 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LeaseStatus.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +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/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LegalHold.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LegalHold.java new file mode 100644 index 0000000000000..72d4a5cb47237 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LegalHold.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.LegalHoldInner; +import java.util.List; + +/** + * Type representing LegalHold. + */ +public interface LegalHold extends HasInner, HasManager { + /** + * @return the hasLegalHold value. + */ + Boolean hasLegalHold(); + + /** + * @return the tags value. + */ + List tags(); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LegalHoldProperties.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LegalHoldProperties.java new file mode 100644 index 0000000000000..3ea0a758eae30 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/LegalHoldProperties.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +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/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListAccountSasResponse.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListAccountSasResponse.java new file mode 100644 index 0000000000000..409129cba6e19 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListAccountSasResponse.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.ListAccountSasResponseInner; + +/** + * Type representing ListAccountSasResponse. + */ +public interface ListAccountSasResponse extends HasInner, HasManager { + /** + * @return the accountSasToken value. + */ + String accountSasToken(); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListContainerItem.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListContainerItem.java new file mode 100644 index 0000000000000..04f730c3e43cb --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListContainerItem.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.ListContainerItemInner; +import org.joda.time.DateTime; +import java.util.Map; + +/** + * Type representing ListContainerItem. + */ +public interface ListContainerItem extends HasInner, HasManager { + /** + * @return the defaultEncryptionScope value. + */ + String defaultEncryptionScope(); + + /** + * @return the deleted value. + */ + Boolean deleted(); + + /** + * @return the deletedTime value. + */ + DateTime deletedTime(); + + /** + * @return the denyEncryptionScopeOverride value. + */ + Boolean denyEncryptionScopeOverride(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the hasImmutabilityPolicy value. + */ + Boolean hasImmutabilityPolicy(); + + /** + * @return the hasLegalHold value. + */ + Boolean hasLegalHold(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the immutabilityPolicy value. + */ + ImmutabilityPolicyProperties immutabilityPolicy(); + + /** + * @return the lastModifiedTime value. + */ + DateTime lastModifiedTime(); + + /** + * @return the leaseDuration value. + */ + LeaseDuration leaseDuration(); + + /** + * @return the leaseState value. + */ + LeaseState leaseState(); + + /** + * @return the leaseStatus value. + */ + LeaseStatus leaseStatus(); + + /** + * @return the legalHold value. + */ + LegalHoldProperties legalHold(); + + /** + * @return the metadata value. + */ + Map metadata(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the publicAccess value. + */ + PublicAccess publicAccess(); + + /** + * @return the remainingRetentionDays value. + */ + Integer remainingRetentionDays(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the version value. + */ + String version(); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListContainersInclude.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListContainersInclude.java new file mode 100644 index 0000000000000..8594762e319f2 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListContainersInclude.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ListContainersInclude. + */ +public final class ListContainersInclude extends ExpandableStringEnum { + /** Static value deleted for ListContainersInclude. */ + public static final ListContainersInclude DELETED = fromString("deleted"); + + /** + * Creates or finds a ListContainersInclude from its string representation. + * @param name a name to look for + * @return the corresponding ListContainersInclude + */ + @JsonCreator + public static ListContainersInclude fromString(String name) { + return fromString(name, ListContainersInclude.class); + } + + /** + * @return known ListContainersInclude values + */ + public static Collection values() { + return values(ListContainersInclude.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListKeyExpand.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListKeyExpand.java new file mode 100644 index 0000000000000..336692470b006 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListKeyExpand.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ListKeyExpand. + */ +public enum ListKeyExpand { + /** Enum value kerb. */ + KERB("kerb"); + + /** The actual serialized value for a ListKeyExpand instance. */ + private String value; + + ListKeyExpand(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ListKeyExpand instance. + * + * @param value the serialized value to parse. + * @return the parsed ListKeyExpand object, or null if unable to parse. + */ + @JsonCreator + public static ListKeyExpand fromString(String value) { + ListKeyExpand[] items = ListKeyExpand.values(); + for (ListKeyExpand item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListQueue.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListQueue.java new file mode 100644 index 0000000000000..45cd976f362e5 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListQueue.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.ListQueueInner; +import java.util.Map; + +/** + * Type representing ListQueue. + */ +public interface ListQueue extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the metadata value. + */ + Map metadata(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListQueueServices.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListQueueServices.java new file mode 100644 index 0000000000000..7142daa32b7db --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListQueueServices.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.ListQueueServicesInner; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.QueueServicePropertiesInner; +import java.util.List; + +/** + * Type representing ListQueueServices. + */ +public interface ListQueueServices extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListServiceSasResponse.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListServiceSasResponse.java new file mode 100644 index 0000000000000..0fd9352d65c01 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListServiceSasResponse.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.ListServiceSasResponseInner; + +/** + * Type representing ListServiceSasResponse. + */ +public interface ListServiceSasResponse extends HasInner, HasManager { + /** + * @return the serviceSasToken value. + */ + String serviceSasToken(); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListSharesExpand.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListSharesExpand.java new file mode 100644 index 0000000000000..0a19a97fb73c7 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListSharesExpand.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ListSharesExpand. + */ +public enum ListSharesExpand { + /** Enum value deleted. */ + DELETED("deleted"); + + /** The actual serialized value for a ListSharesExpand instance. */ + private String value; + + ListSharesExpand(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ListSharesExpand instance. + * + * @param value the serialized value to parse. + * @return the parsed ListSharesExpand object, or null if unable to parse. + */ + @JsonCreator + public static ListSharesExpand fromString(String value) { + ListSharesExpand[] items = ListSharesExpand.values(); + for (ListSharesExpand item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListTableServices.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListTableServices.java new file mode 100644 index 0000000000000..0e65d2832e172 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ListTableServices.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.ListTableServicesInner; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.TableServicePropertiesInner; +import java.util.List; + +/** + * Type representing ListTableServices. + */ +public interface ListTableServices extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicies.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicies.java new file mode 100644 index 0000000000000..22b1c91341863 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicies.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.ManagementPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ManagementPolicies. + */ +public interface ManagementPolicies extends SupportsCreating, HasInner { + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName); + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicy.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicy.java new file mode 100644 index 0000000000000..01f0446a3b7ea --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicy.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.ManagementPolicyInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import java.util.List; +import org.joda.time.DateTime; + +/** + * Type representing ManagementPolicy. + */ +public interface ManagementPolicy extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModifiedTime value. + */ + DateTime lastModifiedTime(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the policy value. + */ + ManagementPolicySchema policy(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ManagementPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithStorageAccount, DefinitionStages.WithPolicy, DefinitionStages.WithCreate { + } + + /** + * Grouping of ManagementPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ManagementPolicy definition. + */ + interface Blank extends WithStorageAccount { + } + + /** + * The stage of the managementpolicy definition allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only + * @return the next definition stage + */ + WithPolicy withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the managementpolicy definition allowing to specify Policy. + */ + interface WithPolicy { + /** + * Specifies policy. + * @param policy The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts + * @return the next definition stage + */ + WithCreate withPolicy(ManagementPolicySchema policy); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a ManagementPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithPolicy { + } + + /** + * Grouping of ManagementPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the managementpolicy update allowing to specify Policy. + */ + interface WithPolicy { + /** + * Specifies policy. + * @param policy The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts + * @return the next update stage + */ + Update withPolicy(ManagementPolicySchema policy); + } + + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicyAction.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicyAction.java new file mode 100644 index 0000000000000..b2dfd3dc1a918 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicyAction.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Actions are applied to the filtered blobs when the execution condition is + * met. + */ +public class ManagementPolicyAction { + /** + * The management policy action for base blob. + */ + @JsonProperty(value = "baseBlob") + private ManagementPolicyBaseBlob baseBlob; + + /** + * The management policy action for snapshot. + */ + @JsonProperty(value = "snapshot") + private ManagementPolicySnapShot snapshot; + + /** + * Get the management policy action for base blob. + * + * @return the baseBlob value + */ + public ManagementPolicyBaseBlob baseBlob() { + return this.baseBlob; + } + + /** + * Set the management policy action for base blob. + * + * @param baseBlob the baseBlob value to set + * @return the ManagementPolicyAction object itself. + */ + public ManagementPolicyAction withBaseBlob(ManagementPolicyBaseBlob baseBlob) { + this.baseBlob = baseBlob; + return this; + } + + /** + * Get the management policy action for snapshot. + * + * @return the snapshot value + */ + public ManagementPolicySnapShot snapshot() { + return this.snapshot; + } + + /** + * Set the management policy action for snapshot. + * + * @param snapshot the snapshot value to set + * @return the ManagementPolicyAction object itself. + */ + public ManagementPolicyAction withSnapshot(ManagementPolicySnapShot snapshot) { + this.snapshot = snapshot; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicyBaseBlob.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicyBaseBlob.java new file mode 100644 index 0000000000000..4f51b7a42c344 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicyBaseBlob.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Management policy action for base blob. + */ +public class ManagementPolicyBaseBlob { + /** + * The function to tier blobs to cool storage. Support blobs currently at + * Hot tier. + */ + @JsonProperty(value = "tierToCool") + private DateAfterModification tierToCool; + + /** + * The function to tier blobs to archive storage. Support blobs currently + * at Hot or Cool tier. + */ + @JsonProperty(value = "tierToArchive") + private DateAfterModification tierToArchive; + + /** + * The function to delete the blob. + */ + @JsonProperty(value = "delete") + private DateAfterModification delete; + + /** + * Get the function to tier blobs to cool storage. Support blobs currently at Hot tier. + * + * @return the tierToCool value + */ + public DateAfterModification tierToCool() { + return this.tierToCool; + } + + /** + * Set the function to tier blobs to cool storage. Support blobs currently at Hot tier. + * + * @param tierToCool the tierToCool value to set + * @return the ManagementPolicyBaseBlob object itself. + */ + public ManagementPolicyBaseBlob withTierToCool(DateAfterModification tierToCool) { + this.tierToCool = tierToCool; + return this; + } + + /** + * Get the function to tier blobs to archive storage. Support blobs currently at Hot or Cool tier. + * + * @return the tierToArchive value + */ + public DateAfterModification tierToArchive() { + return this.tierToArchive; + } + + /** + * Set the function to tier blobs to archive storage. Support blobs currently at Hot or Cool tier. + * + * @param tierToArchive the tierToArchive value to set + * @return the ManagementPolicyBaseBlob object itself. + */ + public ManagementPolicyBaseBlob withTierToArchive(DateAfterModification tierToArchive) { + this.tierToArchive = tierToArchive; + return this; + } + + /** + * Get the function to delete the blob. + * + * @return the delete value + */ + public DateAfterModification delete() { + return this.delete; + } + + /** + * Set the function to delete the blob. + * + * @param delete the delete value to set + * @return the ManagementPolicyBaseBlob object itself. + */ + public ManagementPolicyBaseBlob withDelete(DateAfterModification delete) { + this.delete = delete; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicyDefinition.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicyDefinition.java new file mode 100644 index 0000000000000..07bacf3d0ad78 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicyDefinition.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An object that defines the Lifecycle rule. Each definition is made up with a + * filters set and an actions set. + */ +public class ManagementPolicyDefinition { + /** + * An object that defines the action set. + */ + @JsonProperty(value = "actions", required = true) + private ManagementPolicyAction actions; + + /** + * An object that defines the filter set. + */ + @JsonProperty(value = "filters") + private ManagementPolicyFilter filters; + + /** + * Get an object that defines the action set. + * + * @return the actions value + */ + public ManagementPolicyAction actions() { + return this.actions; + } + + /** + * Set an object that defines the action set. + * + * @param actions the actions value to set + * @return the ManagementPolicyDefinition object itself. + */ + public ManagementPolicyDefinition withActions(ManagementPolicyAction actions) { + this.actions = actions; + return this; + } + + /** + * Get an object that defines the filter set. + * + * @return the filters value + */ + public ManagementPolicyFilter filters() { + return this.filters; + } + + /** + * Set an object that defines the filter set. + * + * @param filters the filters value to set + * @return the ManagementPolicyDefinition object itself. + */ + public ManagementPolicyDefinition withFilters(ManagementPolicyFilter filters) { + this.filters = filters; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicyFilter.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicyFilter.java new file mode 100644 index 0000000000000..d77e330f715a0 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicyFilter.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filters limit rule actions to a subset of blobs within the storage account. + * If multiple filters are defined, a logical AND is performed on all filters. + */ +public class ManagementPolicyFilter { + /** + * An array of strings for prefixes to be match. + */ + @JsonProperty(value = "prefixMatch") + private List prefixMatch; + + /** + * An array of predefined enum values. Only blockBlob is supported. + */ + @JsonProperty(value = "blobTypes", required = true) + private List blobTypes; + + /** + * An array of blob index tag based filters, there can be at most 10 tag + * filters. + */ + @JsonProperty(value = "blobIndexMatch") + private List blobIndexMatch; + + /** + * Get an array of strings for prefixes to be match. + * + * @return the prefixMatch value + */ + public List prefixMatch() { + return this.prefixMatch; + } + + /** + * Set an array of strings for prefixes to be match. + * + * @param prefixMatch the prefixMatch value to set + * @return the ManagementPolicyFilter object itself. + */ + public ManagementPolicyFilter withPrefixMatch(List prefixMatch) { + this.prefixMatch = prefixMatch; + return this; + } + + /** + * Get an array of predefined enum values. Only blockBlob is supported. + * + * @return the blobTypes value + */ + public List blobTypes() { + return this.blobTypes; + } + + /** + * Set an array of predefined enum values. Only blockBlob is supported. + * + * @param blobTypes the blobTypes value to set + * @return the ManagementPolicyFilter object itself. + */ + public ManagementPolicyFilter withBlobTypes(List blobTypes) { + this.blobTypes = blobTypes; + return this; + } + + /** + * Get an array of blob index tag based filters, there can be at most 10 tag filters. + * + * @return the blobIndexMatch value + */ + public List blobIndexMatch() { + return this.blobIndexMatch; + } + + /** + * Set an array of blob index tag based filters, there can be at most 10 tag filters. + * + * @param blobIndexMatch the blobIndexMatch value to set + * @return the ManagementPolicyFilter object itself. + */ + public ManagementPolicyFilter withBlobIndexMatch(List blobIndexMatch) { + this.blobIndexMatch = blobIndexMatch; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicyRule.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicyRule.java new file mode 100644 index 0000000000000..c3a5df47c10a9 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicyRule.java @@ -0,0 +1,132 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An object that wraps the Lifecycle rule. Each rule is uniquely defined by + * name. + */ +public class ManagementPolicyRule { + /** + * Rule is enabled if set to true. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * A rule name can contain any combination of alpha numeric characters. + * Rule name is case-sensitive. It must be unique within a policy. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The valid value is Lifecycle. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * An object that defines the Lifecycle rule. + */ + @JsonProperty(value = "definition", required = true) + private ManagementPolicyDefinition definition; + + /** + * Creates an instance of ManagementPolicyRule class. + * @param name a rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy. + * @param definition an object that defines the Lifecycle rule. + */ + public ManagementPolicyRule() { + type = "Lifecycle"; + } + + /** + * Get rule is enabled if set to true. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set rule is enabled if set to true. + * + * @param enabled the enabled value to set + * @return the ManagementPolicyRule object itself. + */ + public ManagementPolicyRule withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get a rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set a rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy. + * + * @param name the name value to set + * @return the ManagementPolicyRule object itself. + */ + public ManagementPolicyRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the valid value is Lifecycle. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the valid value is Lifecycle. + * + * @param type the type value to set + * @return the ManagementPolicyRule object itself. + */ + public ManagementPolicyRule withType(String type) { + this.type = type; + return this; + } + + /** + * Get an object that defines the Lifecycle rule. + * + * @return the definition value + */ + public ManagementPolicyDefinition definition() { + return this.definition; + } + + /** + * Set an object that defines the Lifecycle rule. + * + * @param definition the definition value to set + * @return the ManagementPolicyRule object itself. + */ + public ManagementPolicyRule withDefinition(ManagementPolicyDefinition definition) { + this.definition = definition; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicySchema.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicySchema.java new file mode 100644 index 0000000000000..f66ea28a3b7da --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicySchema.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Storage Account ManagementPolicies Rules. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + */ +public class ManagementPolicySchema { + /** + * The Storage Account ManagementPolicies Rules. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + */ + @JsonProperty(value = "rules", required = true) + private List rules; + + /** + * Get the Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set the Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @param rules the rules value to set + * @return the ManagementPolicySchema object itself. + */ + public ManagementPolicySchema withRules(List rules) { + this.rules = rules; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicySnapShot.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicySnapShot.java new file mode 100644 index 0000000000000..9e5c89aac1519 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ManagementPolicySnapShot.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Management policy action for snapshot. + */ +public class ManagementPolicySnapShot { + /** + * The function to delete the blob snapshot. + */ + @JsonProperty(value = "delete") + private DateAfterCreation delete; + + /** + * Get the function to delete the blob snapshot. + * + * @return the delete value + */ + public DateAfterCreation delete() { + return this.delete; + } + + /** + * Set the function to delete the blob snapshot. + * + * @param delete the delete value to set + * @return the ManagementPolicySnapShot object itself. + */ + public ManagementPolicySnapShot withDelete(DateAfterCreation delete) { + this.delete = delete; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/MetricSpecification.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/MetricSpecification.java new file mode 100644 index 0000000000000..a5aecb56e4df7 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/MetricSpecification.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metric specification of operation. + */ +public class MetricSpecification { + /** + * Name of metric specification. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display name of metric specification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Display description of metric specification. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /** + * Unit could be Bytes or Count. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Dimensions of blobs, including blob type and access tier. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Aggregation type could be Average. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /** + * The property to decide fill gap with zero or not. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /** + * The category this metric specification belong to, could be Capacity. + */ + @JsonProperty(value = "category") + private String category; + + /** + * Account Resource Id. + */ + @JsonProperty(value = "resourceIdDimensionNameOverride") + private String resourceIdDimensionNameOverride; + + /** + * Get name of metric specification. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of metric specification. + * + * @param name the name value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get display name of metric specification. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set display name of metric specification. + * + * @param displayName the displayName value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get display description of metric specification. + * + * @return the displayDescription value + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set display description of metric specification. + * + * @param displayDescription the displayDescription value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get unit could be Bytes or Count. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set unit could be Bytes or Count. + * + * @param unit the unit value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get dimensions of blobs, including blob type and access tier. + * + * @return the dimensions value + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set dimensions of blobs, including blob type and access tier. + * + * @param dimensions the dimensions value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get aggregation type could be Average. + * + * @return the aggregationType value + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set aggregation type could be Average. + * + * @param aggregationType the aggregationType value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the property to decide fill gap with zero or not. + * + * @return the fillGapWithZero value + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the property to decide fill gap with zero or not. + * + * @param fillGapWithZero the fillGapWithZero value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the category this metric specification belong to, could be Capacity. + * + * @return the category value + */ + public String category() { + return this.category; + } + + /** + * Set the category this metric specification belong to, could be Capacity. + * + * @param category the category value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get account Resource Id. + * + * @return the resourceIdDimensionNameOverride value + */ + public String resourceIdDimensionNameOverride() { + return this.resourceIdDimensionNameOverride; + } + + /** + * Set account Resource Id. + * + * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withResourceIdDimensionNameOverride(String resourceIdDimensionNameOverride) { + this.resourceIdDimensionNameOverride = resourceIdDimensionNameOverride; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/MinimumTlsVersion.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/MinimumTlsVersion.java new file mode 100644 index 0000000000000..b37b8fd3a7625 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/MinimumTlsVersion.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MinimumTlsVersion. + */ +public final class MinimumTlsVersion extends ExpandableStringEnum { + /** Static value TLS1_0 for MinimumTlsVersion. */ + public static final MinimumTlsVersion TLS1_0 = fromString("TLS1_0"); + + /** Static value TLS1_1 for MinimumTlsVersion. */ + public static final MinimumTlsVersion TLS1_1 = fromString("TLS1_1"); + + /** Static value TLS1_2 for MinimumTlsVersion. */ + public static final MinimumTlsVersion TLS1_2 = fromString("TLS1_2"); + + /** + * Creates or finds a MinimumTlsVersion from its string representation. + * @param name a name to look for + * @return the corresponding MinimumTlsVersion + */ + @JsonCreator + public static MinimumTlsVersion fromString(String name) { + return fromString(name, MinimumTlsVersion.class); + } + + /** + * @return known MinimumTlsVersion values + */ + public static Collection values() { + return values(MinimumTlsVersion.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/NetworkRuleSet.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/NetworkRuleSet.java new file mode 100644 index 0000000000000..43a0248ca8075 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/NetworkRuleSet.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Network rule set. + */ +public class NetworkRuleSet { + /** + * Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. + * Possible values are any combination of Logging|Metrics|AzureServices + * (For example, "Logging, Metrics"), or None to bypass none of those + * traffics. Possible values include: 'None', 'Logging', 'Metrics', + * 'AzureServices'. + */ + @JsonProperty(value = "bypass") + private Bypass bypass; + + /** + * The resourceAccessRules property. + */ + @JsonProperty(value = "resourceAccessRules") + private List resourceAccessRules; + + /** + * Sets the virtual network rules. + */ + @JsonProperty(value = "virtualNetworkRules") + private List virtualNetworkRules; + + /** + * Sets the IP ACL rules. + */ + @JsonProperty(value = "ipRules") + private List ipRules; + + /** + * Specifies the default action of allow or deny when no other rules match. + * Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "defaultAction", required = true) + private DefaultAction defaultAction; + + /** + * Get specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. Possible values include: 'None', 'Logging', 'Metrics', 'AzureServices'. + * + * @return the bypass value + */ + public Bypass bypass() { + return this.bypass; + } + + /** + * Set specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. Possible values include: 'None', 'Logging', 'Metrics', 'AzureServices'. + * + * @param bypass the bypass value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withBypass(Bypass bypass) { + this.bypass = bypass; + return this; + } + + /** + * Get the resourceAccessRules value. + * + * @return the resourceAccessRules value + */ + public List resourceAccessRules() { + return this.resourceAccessRules; + } + + /** + * Set the resourceAccessRules value. + * + * @param resourceAccessRules the resourceAccessRules value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withResourceAccessRules(List resourceAccessRules) { + this.resourceAccessRules = resourceAccessRules; + return this; + } + + /** + * Get sets the virtual network rules. + * + * @return the virtualNetworkRules value + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set sets the virtual network rules. + * + * @param virtualNetworkRules the virtualNetworkRules value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withVirtualNetworkRules(List virtualNetworkRules) { + this.virtualNetworkRules = virtualNetworkRules; + return this; + } + + /** + * Get sets the IP ACL rules. + * + * @return the ipRules value + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set sets the IP ACL rules. + * + * @param ipRules the ipRules value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + + /** + * Get specifies the default action of allow or deny when no other rules match. Possible values include: 'Allow', 'Deny'. + * + * @return the defaultAction value + */ + public DefaultAction defaultAction() { + return this.defaultAction; + } + + /** + * Set specifies the default action of allow or deny when no other rules match. Possible values include: 'Allow', 'Deny'. + * + * @param defaultAction the defaultAction value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withDefaultAction(DefaultAction defaultAction) { + this.defaultAction = defaultAction; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ObjectReplicationPolicies.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ObjectReplicationPolicies.java new file mode 100644 index 0000000000000..649714860fa87 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ObjectReplicationPolicies.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.ObjectReplicationPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ObjectReplicationPolicies. + */ +public interface ObjectReplicationPolicies extends SupportsCreating, HasInner { + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String objectReplicationPolicyId); + + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName); + + /** + * Deletes the object replication policy 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 objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String objectReplicationPolicyId); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ObjectReplicationPolicy.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ObjectReplicationPolicy.java new file mode 100644 index 0000000000000..5b925720a9faa --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ObjectReplicationPolicy.java @@ -0,0 +1,163 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.ObjectReplicationPolicyInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing ObjectReplicationPolicy. + */ +public interface ObjectReplicationPolicy extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the destinationAccount value. + */ + String destinationAccount(); + + /** + * @return the enabledTime value. + */ + DateTime enabledTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the policyId value. + */ + String policyId(); + + /** + * @return the rules value. + */ + List rules(); + + /** + * @return the sourceAccount value. + */ + String sourceAccount(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ObjectReplicationPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithStorageAccount, DefinitionStages.WithDestinationAccount, DefinitionStages.WithSourceAccount, DefinitionStages.WithCreate { + } + + /** + * Grouping of ObjectReplicationPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ObjectReplicationPolicy definition. + */ + interface Blank extends WithStorageAccount { + } + + /** + * The stage of the objectreplicationpolicy definition allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only + * @return the next definition stage + */ + WithDestinationAccount withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the objectreplicationpolicy definition allowing to specify DestinationAccount. + */ + interface WithDestinationAccount { + /** + * Specifies destinationAccount. + * @param destinationAccount Required. Destination account name + * @return the next definition stage + */ + WithSourceAccount withDestinationAccount(String destinationAccount); + } + + /** + * The stage of the objectreplicationpolicy definition allowing to specify SourceAccount. + */ + interface WithSourceAccount { + /** + * Specifies sourceAccount. + * @param sourceAccount Required. Source account name + * @return the next definition stage + */ + WithCreate withSourceAccount(String sourceAccount); + } + + /** + * The stage of the objectreplicationpolicy definition allowing to specify Rules. + */ + interface WithRules { + /** + * Specifies rules. + * @param rules The storage account object replication rules + * @return the next definition stage + */ + WithCreate withRules(List rules); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithRules { + } + } + /** + * The template for a ObjectReplicationPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithRules { + } + + /** + * Grouping of ObjectReplicationPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the objectreplicationpolicy update allowing to specify Rules. + */ + interface WithRules { + /** + * Specifies rules. + * @param rules The storage account object replication rules + * @return the next update stage + */ + Update withRules(List rules); + } + + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ObjectReplicationPolicyFilter.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ObjectReplicationPolicyFilter.java new file mode 100644 index 0000000000000..ccbcfce04f1e8 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ObjectReplicationPolicyFilter.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filters limit replication to a subset of blobs within the storage account. A + * logical OR is performed on values in the filter. If multiple filters are + * defined, a logical AND is performed on all filters. + */ +public class ObjectReplicationPolicyFilter { + /** + * Optional. Filters the results to replicate only blobs whose names begin + * with the specified prefix. + */ + @JsonProperty(value = "prefixMatch") + private List prefixMatch; + + /** + * Blobs created after the time will be replicated to the destination. It + * must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. Example: + * 2020-02-19T16:05:00Z. + */ + @JsonProperty(value = "minCreationTime") + private String minCreationTime; + + /** + * Get optional. Filters the results to replicate only blobs whose names begin with the specified prefix. + * + * @return the prefixMatch value + */ + public List prefixMatch() { + return this.prefixMatch; + } + + /** + * Set optional. Filters the results to replicate only blobs whose names begin with the specified prefix. + * + * @param prefixMatch the prefixMatch value to set + * @return the ObjectReplicationPolicyFilter object itself. + */ + public ObjectReplicationPolicyFilter withPrefixMatch(List prefixMatch) { + this.prefixMatch = prefixMatch; + return this; + } + + /** + * Get blobs created after the time will be replicated to the destination. It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. Example: 2020-02-19T16:05:00Z. + * + * @return the minCreationTime value + */ + public String minCreationTime() { + return this.minCreationTime; + } + + /** + * Set blobs created after the time will be replicated to the destination. It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. Example: 2020-02-19T16:05:00Z. + * + * @param minCreationTime the minCreationTime value to set + * @return the ObjectReplicationPolicyFilter object itself. + */ + public ObjectReplicationPolicyFilter withMinCreationTime(String minCreationTime) { + this.minCreationTime = minCreationTime; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ObjectReplicationPolicyRule.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ObjectReplicationPolicyRule.java new file mode 100644 index 0000000000000..c2f0ebe0f1fed --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ObjectReplicationPolicyRule.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The replication policy rule between two containers. + */ +public class ObjectReplicationPolicyRule { + /** + * Rule Id is auto-generated for each new rule on destination account. It + * is required for put policy on source account. + */ + @JsonProperty(value = "ruleId") + private String ruleId; + + /** + * Required. Source container name. + */ + @JsonProperty(value = "sourceContainer", required = true) + private String sourceContainer; + + /** + * Required. Destination container name. + */ + @JsonProperty(value = "destinationContainer", required = true) + private String destinationContainer; + + /** + * Optional. An object that defines the filter set. + */ + @JsonProperty(value = "filters") + private ObjectReplicationPolicyFilter filters; + + /** + * Get rule Id is auto-generated for each new rule on destination account. It is required for put policy on source account. + * + * @return the ruleId value + */ + public String ruleId() { + return this.ruleId; + } + + /** + * Set rule Id is auto-generated for each new rule on destination account. It is required for put policy on source account. + * + * @param ruleId the ruleId value to set + * @return the ObjectReplicationPolicyRule object itself. + */ + public ObjectReplicationPolicyRule withRuleId(String ruleId) { + this.ruleId = ruleId; + return this; + } + + /** + * Get required. Source container name. + * + * @return the sourceContainer value + */ + public String sourceContainer() { + return this.sourceContainer; + } + + /** + * Set required. Source container name. + * + * @param sourceContainer the sourceContainer value to set + * @return the ObjectReplicationPolicyRule object itself. + */ + public ObjectReplicationPolicyRule withSourceContainer(String sourceContainer) { + this.sourceContainer = sourceContainer; + return this; + } + + /** + * Get required. Destination container name. + * + * @return the destinationContainer value + */ + public String destinationContainer() { + return this.destinationContainer; + } + + /** + * Set required. Destination container name. + * + * @param destinationContainer the destinationContainer value to set + * @return the ObjectReplicationPolicyRule object itself. + */ + public ObjectReplicationPolicyRule withDestinationContainer(String destinationContainer) { + this.destinationContainer = destinationContainer; + return this; + } + + /** + * Get optional. An object that defines the filter set. + * + * @return the filters value + */ + public ObjectReplicationPolicyFilter filters() { + return this.filters; + } + + /** + * Set optional. An object that defines the filter set. + * + * @param filters the filters value to set + * @return the ObjectReplicationPolicyRule object itself. + */ + public ObjectReplicationPolicyRule withFilters(ObjectReplicationPolicyFilter filters) { + this.filters = filters; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Operation.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Operation.java new file mode 100644 index 0000000000000..39467667b742d --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Operation.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the serviceSpecification value. + */ + ServiceSpecification serviceSpecification(); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/OperationDisplay.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/OperationDisplay.java new file mode 100644 index 0000000000000..47c3d4258d8f8 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Display metadata associated with the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft Storage. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Type of operation: get, read, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get service provider: Microsoft Storage. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set service provider: Microsoft Storage. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed etc. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get type of operation: get, read, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set type of operation: get, read, delete, etc. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the operation. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Operations.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Operations.java new file mode 100644 index 0000000000000..6a872677d9f30 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Storage Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Permissions.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Permissions.java new file mode 100644 index 0000000000000..102aef1efe3af --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Permissions.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Permissions. + */ +public final class Permissions extends ExpandableStringEnum { + /** Static value r for Permissions. */ + public static final Permissions R = fromString("r"); + + /** Static value d for Permissions. */ + public static final Permissions D = fromString("d"); + + /** Static value w for Permissions. */ + public static final Permissions W = fromString("w"); + + /** Static value l for Permissions. */ + public static final Permissions L = fromString("l"); + + /** Static value a for Permissions. */ + public static final Permissions A = fromString("a"); + + /** Static value c for Permissions. */ + public static final Permissions C = fromString("c"); + + /** Static value u for Permissions. */ + public static final Permissions U = fromString("u"); + + /** Static value p for Permissions. */ + public static final Permissions P = fromString("p"); + + /** + * Creates or finds a Permissions from its string representation. + * @param name a name to look for + * @return the corresponding Permissions + */ + @JsonCreator + public static Permissions fromString(String name) { + return fromString(name, Permissions.class); + } + + /** + * @return known Permissions values + */ + public static Collection values() { + return values(Permissions.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateEndpoint.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateEndpoint.java new file mode 100644 index 0000000000000..74ed2972a0ac4 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateEndpoint.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Private Endpoint resource. + */ +public class PrivateEndpoint { + /** + * The ARM identifier for Private Endpoint. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the ARM identifier for Private Endpoint. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateEndpointConnection.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..232f024345241 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateEndpointConnection.java @@ -0,0 +1,163 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.PrivateEndpointConnectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; + +/** + * Type representing PrivateEndpointConnection. + */ +public interface PrivateEndpointConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * @return the provisioningState value. + */ + PrivateEndpointConnectionProvisioningState provisioningState(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the PrivateEndpointConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithStorageAccount, DefinitionStages.WithPrivateLinkServiceConnectionState, DefinitionStages.WithCreate { + } + + /** + * Grouping of PrivateEndpointConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PrivateEndpointConnection definition. + */ + interface Blank extends WithStorageAccount { + } + + /** + * The stage of the privateendpointconnection definition allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only + * @return the next definition stage + */ + WithPrivateLinkServiceConnectionState withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the privateendpointconnection definition allowing to specify PrivateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies privateLinkServiceConnectionState. + * @param privateLinkServiceConnectionState A collection of information about the state of the connection between service consumer and provider + * @return the next definition stage + */ + WithCreate withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + + /** + * The stage of the privateendpointconnection definition allowing to specify PrivateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies privateEndpoint. + * @param privateEndpoint The resource of private end point + * @return the next definition stage + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the privateendpointconnection definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the private endpoint connection resource. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed' + * @return the next definition stage + */ + WithCreate withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithProvisioningState { + } + } + /** + * The template for a PrivateEndpointConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithPrivateEndpoint, UpdateStages.WithProvisioningState { + } + + /** + * Grouping of PrivateEndpointConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the privateendpointconnection update allowing to specify PrivateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies privateEndpoint. + * @param privateEndpoint The resource of private end point + * @return the next update stage + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the privateendpointconnection update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the private endpoint connection resource. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed' + * @return the next update stage + */ + Update withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState); + } + + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateEndpointConnectionProvisioningState.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 0000000000000..a57a58feac9ed --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PrivateEndpointConnectionProvisioningState. + */ +public final class PrivateEndpointConnectionProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding PrivateEndpointConnectionProvisioningState + */ + @JsonCreator + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** + * @return known PrivateEndpointConnectionProvisioningState values + */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateEndpointConnections.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..a1d46c2757118 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateEndpointConnections.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.PrivateEndpointConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PrivateEndpointConnections. + */ +public interface PrivateEndpointConnections extends SupportsCreating, HasInner { + /** + * Gets the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName); + + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName); + + /** + * Deletes the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateEndpointServiceConnectionStatus.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 0000000000000..69408acfcc621 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateEndpointServiceConnectionStatus.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PrivateEndpointServiceConnectionStatus. + */ +public final class PrivateEndpointServiceConnectionStatus extends ExpandableStringEnum { + /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding PrivateEndpointServiceConnectionStatus + */ + @JsonCreator + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** + * @return known PrivateEndpointServiceConnectionStatus values + */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateLinkResourceListResult.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateLinkResourceListResult.java new file mode 100644 index 0000000000000..cbdb5ed3b345b --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateLinkResourceListResult.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.PrivateLinkResourceListResultInner; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.PrivateLinkResourceInner; +import java.util.List; + +/** + * Type representing PrivateLinkResourceListResult. + */ +public interface PrivateLinkResourceListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateLinkResources.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateLinkResources.java new file mode 100644 index 0000000000000..ea7454ab2f56b --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateLinkResources.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.PrivateLinkResourcesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PrivateLinkResources. + */ +public interface PrivateLinkResources extends HasInner { + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByStorageAccountAsync(String resourceGroupName, String accountName); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateLinkServiceConnectionState.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..5e54154887dd5 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PrivateLinkServiceConnectionState.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A collection of information about the state of the connection between + * service consumer and provider. + */ +public class PrivateLinkServiceConnectionState { + /** + * Indicates whether the connection has been Approved/Rejected/Removed by + * the owner of the service. Possible values include: 'Pending', + * 'Approved', 'Rejected'. + */ + @JsonProperty(value = "status") + private PrivateEndpointServiceConnectionStatus status; + + /** + * The reason for approval/rejection of the connection. + */ + @JsonProperty(value = "description") + private String description; + + /** + * A message indicating if changes on the service provider require any + * updates on the consumer. + */ + @JsonProperty(value = "actionRequired") + private String actionRequired; + + /** + * Get indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected'. + * + * @return the status value + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected'. + * + * @param status the status value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the reason for approval/rejection of the connection. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the reason for approval/rejection of the connection. + * + * @param description the description value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get a message indicating if changes on the service provider require any updates on the consumer. + * + * @return the actionRequired value + */ + public String actionRequired() { + return this.actionRequired; + } + + /** + * Set a message indicating if changes on the service provider require any updates on the consumer. + * + * @param actionRequired the actionRequired value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionRequired(String actionRequired) { + this.actionRequired = actionRequired; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ProvisioningState.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ProvisioningState.java new file mode 100644 index 0000000000000..7415f2ee0d7fd --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ProvisioningState.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ProvisioningState. + */ +public enum ProvisioningState { + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value ResolvingDNS. */ + RESOLVING_DNS("ResolvingDNS"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"); + + /** The actual serialized value for a ProvisioningState instance. */ + private String value; + + ProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed ProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static ProvisioningState fromString(String value) { + ProvisioningState[] items = ProvisioningState.values(); + for (ProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PublicAccess.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PublicAccess.java new file mode 100644 index 0000000000000..b55930e50e3fe --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/PublicAccess.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +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/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/QueueServiceProperties.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/QueueServiceProperties.java new file mode 100644 index 0000000000000..32c2341436830 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/QueueServiceProperties.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.QueueServicePropertiesInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import java.util.List; + +/** + * Type representing QueueServiceProperties. + */ +public interface QueueServiceProperties extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the cors value. + */ + CorsRules cors(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the QueueServiceProperties definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithStorageAccount, DefinitionStages.WithCors, DefinitionStages.WithCreate { + } + + /** + * Grouping of QueueServiceProperties definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a QueueServiceProperties definition. + */ + interface Blank extends WithStorageAccount { + } + + /** + * The stage of the queueserviceproperties definition allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only + * @return the next definition stage + */ + WithCors withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the queueserviceproperties definition allowing to specify Cors. + */ + interface WithCors { + /** + * Specifies cors. + * @param cors Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Queue service + * @return the next definition stage + */ + WithCreate withCors(CorsRules cors); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a QueueServiceProperties update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCors { + } + + /** + * Grouping of QueueServiceProperties update stages. + */ + interface UpdateStages { + /** + * The stage of the queueserviceproperties update allowing to specify Cors. + */ + interface WithCors { + /** + * Specifies cors. + * @param cors Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Queue service + * @return the next update stage + */ + Update withCors(CorsRules cors); + } + + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/QueueServices.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/QueueServices.java new file mode 100644 index 0000000000000..79b32046318e3 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/QueueServices.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.QueueServicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing QueueServices. + */ +public interface QueueServices extends SupportsCreating, HasInner { + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName); + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getServicePropertiesAsync(String resourceGroupName, String accountName); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Queues.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Queues.java new file mode 100644 index 0000000000000..d284ede7f29d9 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Queues.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.QueuesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Queues. + */ +public interface Queues extends SupportsCreating, HasInner { + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String queueName); + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String queueName); + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Reason.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Reason.java new file mode 100644 index 0000000000000..20960eb485ae4 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Reason.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Reason. + */ +public enum Reason { + /** Enum value AccountNameInvalid. */ + ACCOUNT_NAME_INVALID("AccountNameInvalid"), + + /** Enum value AlreadyExists. */ + ALREADY_EXISTS("AlreadyExists"); + + /** The actual serialized value for a Reason instance. */ + private String value; + + Reason(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Reason instance. + * + * @param value the serialized value to parse. + * @return the parsed Reason object, or null if unable to parse. + */ + @JsonCreator + public static Reason fromString(String value) { + Reason[] items = Reason.values(); + for (Reason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ReasonCode.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ReasonCode.java new file mode 100644 index 0000000000000..43be31b788d42 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ReasonCode.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ReasonCode. + */ +public final class ReasonCode extends ExpandableStringEnum { + /** Static value QuotaId for ReasonCode. */ + public static final ReasonCode QUOTA_ID = fromString("QuotaId"); + + /** Static value NotAvailableForSubscription for ReasonCode. */ + public static final ReasonCode NOT_AVAILABLE_FOR_SUBSCRIPTION = fromString("NotAvailableForSubscription"); + + /** + * Creates or finds a ReasonCode from its string representation. + * @param name a name to look for + * @return the corresponding ReasonCode + */ + @JsonCreator + public static ReasonCode fromString(String name) { + return fromString(name, ReasonCode.class); + } + + /** + * @return known ReasonCode values + */ + public static Collection values() { + return values(ReasonCode.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ResourceAccessRule.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ResourceAccessRule.java new file mode 100644 index 0000000000000..8d6fa37d7d986 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ResourceAccessRule.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Resource Access Rule. + */ +public class ResourceAccessRule { + /** + * Tenant Id. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /** + * Resource Id. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * Get tenant Id. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set tenant Id. + * + * @param tenantId the tenantId value to set + * @return the ResourceAccessRule object itself. + */ + public ResourceAccessRule withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get resource Id. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set resource Id. + * + * @param resourceId the resourceId value to set + * @return the ResourceAccessRule object itself. + */ + public ResourceAccessRule withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/RestorePolicyProperties.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/RestorePolicyProperties.java new file mode 100644 index 0000000000000..01bb8216313ea --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/RestorePolicyProperties.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The blob service properties for blob restore policy. + */ +public class RestorePolicyProperties { + /** + * Blob restore is enabled if set to true. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /** + * how long this blob can be restored. It should be great than zero and + * less than DeleteRetentionPolicy.days. + */ + @JsonProperty(value = "days") + private Integer days; + + /** + * Deprecated in favor of minRestoreTime property. + */ + @JsonProperty(value = "lastEnabledTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastEnabledTime; + + /** + * Returns the minimum date and time that the restore can be started. + */ + @JsonProperty(value = "minRestoreTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime minRestoreTime; + + /** + * Get blob restore is enabled if set to true. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set blob restore is enabled if set to true. + * + * @param enabled the enabled value to set + * @return the RestorePolicyProperties object itself. + */ + public RestorePolicyProperties withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days. + * + * @return the days value + */ + public Integer days() { + return this.days; + } + + /** + * Set how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days. + * + * @param days the days value to set + * @return the RestorePolicyProperties object itself. + */ + public RestorePolicyProperties withDays(Integer days) { + this.days = days; + return this; + } + + /** + * Get deprecated in favor of minRestoreTime property. + * + * @return the lastEnabledTime value + */ + public DateTime lastEnabledTime() { + return this.lastEnabledTime; + } + + /** + * Get returns the minimum date and time that the restore can be started. + * + * @return the minRestoreTime value + */ + public DateTime minRestoreTime() { + return this.minRestoreTime; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Restriction.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Restriction.java new file mode 100644 index 0000000000000..4b88b070374ec --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Restriction.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The restriction because of which SKU cannot be used. + */ +public class Restriction { + /** + * The type of restrictions. As of now only possible value for this is + * location. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The value of restrictions. If the restriction type is set to location. + * This would be different locations where the SKU is restricted. + */ + @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) + private List values; + + /** + * The reason for the restriction. As of now this can be "QuotaId" or + * "NotAvailableForSubscription". Quota Id is set when the SKU has + * requiredQuotas parameter as the subscription does not belong to that + * quota. The "NotAvailableForSubscription" is related to capacity at DC. + * Possible values include: 'QuotaId', 'NotAvailableForSubscription'. + */ + @JsonProperty(value = "reasonCode") + private ReasonCode reasonCode; + + /** + * Get the type of restrictions. As of now only possible value for this is location. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Get the reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. + * + * @return the reasonCode value + */ + public ReasonCode reasonCode() { + return this.reasonCode; + } + + /** + * Set the reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. + * + * @param reasonCode the reasonCode value to set + * @return the Restriction object itself. + */ + public Restriction withReasonCode(ReasonCode reasonCode) { + this.reasonCode = reasonCode; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/RootSquashType.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/RootSquashType.java new file mode 100644 index 0000000000000..5b920cc47e522 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/RootSquashType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RootSquashType. + */ +public final class RootSquashType extends ExpandableStringEnum { + /** Static value NoRootSquash for RootSquashType. */ + public static final RootSquashType NO_ROOT_SQUASH = fromString("NoRootSquash"); + + /** Static value RootSquash for RootSquashType. */ + public static final RootSquashType ROOT_SQUASH = fromString("RootSquash"); + + /** Static value AllSquash for RootSquashType. */ + public static final RootSquashType ALL_SQUASH = fromString("AllSquash"); + + /** + * Creates or finds a RootSquashType from its string representation. + * @param name a name to look for + * @return the corresponding RootSquashType + */ + @JsonCreator + public static RootSquashType fromString(String name) { + return fromString(name, RootSquashType.class); + } + + /** + * @return known RootSquashType values + */ + public static Collection values() { + return values(RootSquashType.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/RoutingChoice.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/RoutingChoice.java new file mode 100644 index 0000000000000..012f1c07feb20 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/RoutingChoice.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RoutingChoice. + */ +public final class RoutingChoice extends ExpandableStringEnum { + /** Static value MicrosoftRouting for RoutingChoice. */ + public static final RoutingChoice MICROSOFT_ROUTING = fromString("MicrosoftRouting"); + + /** Static value InternetRouting for RoutingChoice. */ + public static final RoutingChoice INTERNET_ROUTING = fromString("InternetRouting"); + + /** + * Creates or finds a RoutingChoice from its string representation. + * @param name a name to look for + * @return the corresponding RoutingChoice + */ + @JsonCreator + public static RoutingChoice fromString(String name) { + return fromString(name, RoutingChoice.class); + } + + /** + * @return known RoutingChoice values + */ + public static Collection values() { + return values(RoutingChoice.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/RoutingPreference.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/RoutingPreference.java new file mode 100644 index 0000000000000..1a2fe8f9985fc --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/RoutingPreference.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Routing preference defines the type of network, either microsoft or internet + * routing to be used to deliver the user data, the default option is microsoft + * routing. + */ +public class RoutingPreference { + /** + * Routing Choice defines the kind of network routing opted by the user. + * Possible values include: 'MicrosoftRouting', 'InternetRouting'. + */ + @JsonProperty(value = "routingChoice") + private RoutingChoice routingChoice; + + /** + * A boolean flag which indicates whether microsoft routing storage + * endpoints are to be published. + */ + @JsonProperty(value = "publishMicrosoftEndpoints") + private Boolean publishMicrosoftEndpoints; + + /** + * A boolean flag which indicates whether internet routing storage + * endpoints are to be published. + */ + @JsonProperty(value = "publishInternetEndpoints") + private Boolean publishInternetEndpoints; + + /** + * Get routing Choice defines the kind of network routing opted by the user. Possible values include: 'MicrosoftRouting', 'InternetRouting'. + * + * @return the routingChoice value + */ + public RoutingChoice routingChoice() { + return this.routingChoice; + } + + /** + * Set routing Choice defines the kind of network routing opted by the user. Possible values include: 'MicrosoftRouting', 'InternetRouting'. + * + * @param routingChoice the routingChoice value to set + * @return the RoutingPreference object itself. + */ + public RoutingPreference withRoutingChoice(RoutingChoice routingChoice) { + this.routingChoice = routingChoice; + return this; + } + + /** + * Get a boolean flag which indicates whether microsoft routing storage endpoints are to be published. + * + * @return the publishMicrosoftEndpoints value + */ + public Boolean publishMicrosoftEndpoints() { + return this.publishMicrosoftEndpoints; + } + + /** + * Set a boolean flag which indicates whether microsoft routing storage endpoints are to be published. + * + * @param publishMicrosoftEndpoints the publishMicrosoftEndpoints value to set + * @return the RoutingPreference object itself. + */ + public RoutingPreference withPublishMicrosoftEndpoints(Boolean publishMicrosoftEndpoints) { + this.publishMicrosoftEndpoints = publishMicrosoftEndpoints; + return this; + } + + /** + * Get a boolean flag which indicates whether internet routing storage endpoints are to be published. + * + * @return the publishInternetEndpoints value + */ + public Boolean publishInternetEndpoints() { + return this.publishInternetEndpoints; + } + + /** + * Set a boolean flag which indicates whether internet routing storage endpoints are to be published. + * + * @param publishInternetEndpoints the publishInternetEndpoints value to set + * @return the RoutingPreference object itself. + */ + public RoutingPreference withPublishInternetEndpoints(Boolean publishInternetEndpoints) { + this.publishInternetEndpoints = publishInternetEndpoints; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/SKUCapability.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/SKUCapability.java new file mode 100644 index 0000000000000..64d88333bc74b --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/SKUCapability.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The capability information in the specified SKU, including file encryption, + * network ACLs, change notification, etc. + */ +public class SKUCapability { + /** + * The name of capability, The capability information in the specified SKU, + * including file encryption, network ACLs, change notification, etc. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * A string value to indicate states of given capability. Possibly 'true' + * or 'false'. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get the name of capability, The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get a string value to indicate states of given capability. Possibly 'true' or 'false'. + * + * @return the value value + */ + public String value() { + return this.value; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ServiceSasParameters.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ServiceSasParameters.java new file mode 100644 index 0000000000000..a329da30db70d --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ServiceSasParameters.java @@ -0,0 +1,493 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters to list service SAS credentials of a specific resource. + */ +public class ServiceSasParameters { + /** + * The canonical path to the signed resource. + */ + @JsonProperty(value = "canonicalizedResource", required = true) + private String canonicalizedResource; + + /** + * The signed services accessible with the service SAS. Possible values + * include: Blob (b), Container (c), File (f), Share (s). Possible values + * include: 'b', 'c', 'f', 's'. + */ + @JsonProperty(value = "signedResource") + private SignedResource resource; + + /** + * The signed permissions for the service SAS. Possible values include: + * Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update + * (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', + * 'c', 'u', 'p'. + */ + @JsonProperty(value = "signedPermission") + private Permissions permissions; + + /** + * An IP address or a range of IP addresses from which to accept requests. + */ + @JsonProperty(value = "signedIp") + private String iPAddressOrRange; + + /** + * The protocol permitted for a request made with the account SAS. Possible + * values include: 'https,http', 'https'. + */ + @JsonProperty(value = "signedProtocol") + private HttpProtocol protocols; + + /** + * The time at which the SAS becomes valid. + */ + @JsonProperty(value = "signedStart") + private DateTime sharedAccessStartTime; + + /** + * The time at which the shared access signature becomes invalid. + */ + @JsonProperty(value = "signedExpiry") + private DateTime sharedAccessExpiryTime; + + /** + * A unique value up to 64 characters in length that correlates to an + * access policy specified for the container, queue, or table. + */ + @JsonProperty(value = "signedIdentifier") + private String identifier; + + /** + * The start of partition key. + */ + @JsonProperty(value = "startPk") + private String partitionKeyStart; + + /** + * The end of partition key. + */ + @JsonProperty(value = "endPk") + private String partitionKeyEnd; + + /** + * The start of row key. + */ + @JsonProperty(value = "startRk") + private String rowKeyStart; + + /** + * The end of row key. + */ + @JsonProperty(value = "endRk") + private String rowKeyEnd; + + /** + * The key to sign the account SAS token with. + */ + @JsonProperty(value = "keyToSign") + private String keyToSign; + + /** + * The response header override for cache control. + */ + @JsonProperty(value = "rscc") + private String cacheControl; + + /** + * The response header override for content disposition. + */ + @JsonProperty(value = "rscd") + private String contentDisposition; + + /** + * The response header override for content encoding. + */ + @JsonProperty(value = "rsce") + private String contentEncoding; + + /** + * The response header override for content language. + */ + @JsonProperty(value = "rscl") + private String contentLanguage; + + /** + * The response header override for content type. + */ + @JsonProperty(value = "rsct") + private String contentType; + + /** + * Get the canonical path to the signed resource. + * + * @return the canonicalizedResource value + */ + public String canonicalizedResource() { + return this.canonicalizedResource; + } + + /** + * Set the canonical path to the signed resource. + * + * @param canonicalizedResource the canonicalizedResource value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withCanonicalizedResource(String canonicalizedResource) { + this.canonicalizedResource = canonicalizedResource; + return this; + } + + /** + * Get the signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). Possible values include: 'b', 'c', 'f', 's'. + * + * @return the resource value + */ + public SignedResource resource() { + return this.resource; + } + + /** + * Set the signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). Possible values include: 'b', 'c', 'f', 's'. + * + * @param resource the resource value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withResource(SignedResource resource) { + this.resource = resource; + return this; + } + + /** + * Get the signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. + * + * @return the permissions value + */ + public Permissions permissions() { + return this.permissions; + } + + /** + * Set the signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p'. + * + * @param permissions the permissions value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withPermissions(Permissions permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get an IP address or a range of IP addresses from which to accept requests. + * + * @return the iPAddressOrRange value + */ + public String iPAddressOrRange() { + return this.iPAddressOrRange; + } + + /** + * Set an IP address or a range of IP addresses from which to accept requests. + * + * @param iPAddressOrRange the iPAddressOrRange value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withIPAddressOrRange(String iPAddressOrRange) { + this.iPAddressOrRange = iPAddressOrRange; + return this; + } + + /** + * Get the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. + * + * @return the protocols value + */ + public HttpProtocol protocols() { + return this.protocols; + } + + /** + * Set the protocol permitted for a request made with the account SAS. Possible values include: 'https,http', 'https'. + * + * @param protocols the protocols value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withProtocols(HttpProtocol protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the time at which the SAS becomes valid. + * + * @return the sharedAccessStartTime value + */ + public DateTime sharedAccessStartTime() { + return this.sharedAccessStartTime; + } + + /** + * Set the time at which the SAS becomes valid. + * + * @param sharedAccessStartTime the sharedAccessStartTime value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withSharedAccessStartTime(DateTime sharedAccessStartTime) { + this.sharedAccessStartTime = sharedAccessStartTime; + return this; + } + + /** + * Get the time at which the shared access signature becomes invalid. + * + * @return the sharedAccessExpiryTime value + */ + public DateTime sharedAccessExpiryTime() { + return this.sharedAccessExpiryTime; + } + + /** + * Set the time at which the shared access signature becomes invalid. + * + * @param sharedAccessExpiryTime the sharedAccessExpiryTime value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withSharedAccessExpiryTime(DateTime sharedAccessExpiryTime) { + this.sharedAccessExpiryTime = sharedAccessExpiryTime; + return this; + } + + /** + * Get a unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. + * + * @return the identifier value + */ + public String identifier() { + return this.identifier; + } + + /** + * Set a unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. + * + * @param identifier the identifier value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withIdentifier(String identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the start of partition key. + * + * @return the partitionKeyStart value + */ + public String partitionKeyStart() { + return this.partitionKeyStart; + } + + /** + * Set the start of partition key. + * + * @param partitionKeyStart the partitionKeyStart value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withPartitionKeyStart(String partitionKeyStart) { + this.partitionKeyStart = partitionKeyStart; + return this; + } + + /** + * Get the end of partition key. + * + * @return the partitionKeyEnd value + */ + public String partitionKeyEnd() { + return this.partitionKeyEnd; + } + + /** + * Set the end of partition key. + * + * @param partitionKeyEnd the partitionKeyEnd value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withPartitionKeyEnd(String partitionKeyEnd) { + this.partitionKeyEnd = partitionKeyEnd; + return this; + } + + /** + * Get the start of row key. + * + * @return the rowKeyStart value + */ + public String rowKeyStart() { + return this.rowKeyStart; + } + + /** + * Set the start of row key. + * + * @param rowKeyStart the rowKeyStart value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withRowKeyStart(String rowKeyStart) { + this.rowKeyStart = rowKeyStart; + return this; + } + + /** + * Get the end of row key. + * + * @return the rowKeyEnd value + */ + public String rowKeyEnd() { + return this.rowKeyEnd; + } + + /** + * Set the end of row key. + * + * @param rowKeyEnd the rowKeyEnd value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withRowKeyEnd(String rowKeyEnd) { + this.rowKeyEnd = rowKeyEnd; + return this; + } + + /** + * Get the key to sign the account SAS token with. + * + * @return the keyToSign value + */ + public String keyToSign() { + return this.keyToSign; + } + + /** + * Set the key to sign the account SAS token with. + * + * @param keyToSign the keyToSign value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withKeyToSign(String keyToSign) { + this.keyToSign = keyToSign; + return this; + } + + /** + * Get the response header override for cache control. + * + * @return the cacheControl value + */ + public String cacheControl() { + return this.cacheControl; + } + + /** + * Set the response header override for cache control. + * + * @param cacheControl the cacheControl value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withCacheControl(String cacheControl) { + this.cacheControl = cacheControl; + return this; + } + + /** + * Get the response header override for content disposition. + * + * @return the contentDisposition value + */ + public String contentDisposition() { + return this.contentDisposition; + } + + /** + * Set the response header override for content disposition. + * + * @param contentDisposition the contentDisposition value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withContentDisposition(String contentDisposition) { + this.contentDisposition = contentDisposition; + return this; + } + + /** + * Get the response header override for content encoding. + * + * @return the contentEncoding value + */ + public String contentEncoding() { + return this.contentEncoding; + } + + /** + * Set the response header override for content encoding. + * + * @param contentEncoding the contentEncoding value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withContentEncoding(String contentEncoding) { + this.contentEncoding = contentEncoding; + return this; + } + + /** + * Get the response header override for content language. + * + * @return the contentLanguage value + */ + public String contentLanguage() { + return this.contentLanguage; + } + + /** + * Set the response header override for content language. + * + * @param contentLanguage the contentLanguage value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withContentLanguage(String contentLanguage) { + this.contentLanguage = contentLanguage; + return this; + } + + /** + * Get the response header override for content type. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the response header override for content type. + * + * @param contentType the contentType value to set + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withContentType(String contentType) { + this.contentType = contentType; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ServiceSpecification.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ServiceSpecification.java new file mode 100644 index 0000000000000..c0bb17e60aa11 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ServiceSpecification.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * One property of operation, include metric specifications. + */ +public class ServiceSpecification { + /** + * Metric specifications of operation. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get metric specifications of operation. + * + * @return the metricSpecifications value + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set metric specifications of operation. + * + * @param metricSpecifications the metricSpecifications value to set + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Services.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Services.java new file mode 100644 index 0000000000000..e612974007170 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Services.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Services. + */ +public final class Services extends ExpandableStringEnum { + /** Static value b for Services. */ + public static final Services B = fromString("b"); + + /** Static value q for Services. */ + public static final Services Q = fromString("q"); + + /** Static value t for Services. */ + public static final Services T = fromString("t"); + + /** Static value f for Services. */ + public static final Services F = fromString("f"); + + /** + * Creates or finds a Services from its string representation. + * @param name a name to look for + * @return the corresponding Services + */ + @JsonCreator + public static Services fromString(String name) { + return fromString(name, Services.class); + } + + /** + * @return known Services values + */ + public static Collection values() { + return values(Services.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ShareAccessTier.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ShareAccessTier.java new file mode 100644 index 0000000000000..12d5f3e0204ee --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/ShareAccessTier.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ShareAccessTier. + */ +public final class ShareAccessTier extends ExpandableStringEnum { + /** Static value TransactionOptimized for ShareAccessTier. */ + public static final ShareAccessTier TRANSACTION_OPTIMIZED = fromString("TransactionOptimized"); + + /** Static value Hot for ShareAccessTier. */ + public static final ShareAccessTier HOT = fromString("Hot"); + + /** Static value Cool for ShareAccessTier. */ + public static final ShareAccessTier COOL = fromString("Cool"); + + /** Static value Premium for ShareAccessTier. */ + public static final ShareAccessTier PREMIUM = fromString("Premium"); + + /** + * Creates or finds a ShareAccessTier from its string representation. + * @param name a name to look for + * @return the corresponding ShareAccessTier + */ + @JsonCreator + public static ShareAccessTier fromString(String name) { + return fromString(name, ShareAccessTier.class); + } + + /** + * @return known ShareAccessTier values + */ + public static Collection values() { + return values(ShareAccessTier.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/SignedResource.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/SignedResource.java new file mode 100644 index 0000000000000..5e733041734b4 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/SignedResource.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SignedResource. + */ +public final class SignedResource extends ExpandableStringEnum { + /** Static value b for SignedResource. */ + public static final SignedResource B = fromString("b"); + + /** Static value c for SignedResource. */ + public static final SignedResource C = fromString("c"); + + /** Static value f for SignedResource. */ + public static final SignedResource F = fromString("f"); + + /** Static value s for SignedResource. */ + public static final SignedResource S = fromString("s"); + + /** + * Creates or finds a SignedResource from its string representation. + * @param name a name to look for + * @return the corresponding SignedResource + */ + @JsonCreator + public static SignedResource fromString(String name) { + return fromString(name, SignedResource.class); + } + + /** + * @return known SignedResource values + */ + public static Collection values() { + return values(SignedResource.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/SignedResourceTypes.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/SignedResourceTypes.java new file mode 100644 index 0000000000000..cb5e4f1349325 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/SignedResourceTypes.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SignedResourceTypes. + */ +public final class SignedResourceTypes extends ExpandableStringEnum { + /** Static value s for SignedResourceTypes. */ + public static final SignedResourceTypes S = fromString("s"); + + /** Static value c for SignedResourceTypes. */ + public static final SignedResourceTypes C = fromString("c"); + + /** Static value o for SignedResourceTypes. */ + public static final SignedResourceTypes O = fromString("o"); + + /** + * Creates or finds a SignedResourceTypes from its string representation. + * @param name a name to look for + * @return the corresponding SignedResourceTypes + */ + @JsonCreator + public static SignedResourceTypes fromString(String name) { + return fromString(name, SignedResourceTypes.class); + } + + /** + * @return known SignedResourceTypes values + */ + public static Collection values() { + return values(SignedResourceTypes.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/SkuInformation.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/SkuInformation.java new file mode 100644 index 0000000000000..22375951b30e4 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/SkuInformation.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.SkuInformationInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import java.util.List; + +/** + * Type representing SkuInformation. + */ +public interface SkuInformation extends HasInner, HasManager { + /** + * @return the capabilities value. + */ + List capabilities(); + + /** + * @return the kind value. + */ + Kind kind(); + + /** + * @return the locations value. + */ + List locations(); + + /** + * @return the name value. + */ + SkuName name(); + + /** + * @return the resourceType value. + */ + String resourceType(); + + /** + * @return the restrictions value. + */ + List restrictions(); + + /** + * @return the tier value. + */ + SkuTier tier(); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/SkuName.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/SkuName.java new file mode 100644 index 0000000000000..4057936b961b7 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/SkuName.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuName. + */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Standard_LRS for SkuName. */ + public static final SkuName STANDARD_LRS = fromString("Standard_LRS"); + + /** Static value Standard_GRS for SkuName. */ + public static final SkuName STANDARD_GRS = fromString("Standard_GRS"); + + /** Static value Standard_RAGRS for SkuName. */ + public static final SkuName STANDARD_RAGRS = fromString("Standard_RAGRS"); + + /** Static value Standard_ZRS for SkuName. */ + public static final SkuName STANDARD_ZRS = fromString("Standard_ZRS"); + + /** Static value Premium_LRS for SkuName. */ + public static final SkuName PREMIUM_LRS = fromString("Premium_LRS"); + + /** Static value Premium_ZRS for SkuName. */ + public static final SkuName PREMIUM_ZRS = fromString("Premium_ZRS"); + + /** Static value Standard_GZRS for SkuName. */ + public static final SkuName STANDARD_GZRS = fromString("Standard_GZRS"); + + /** Static value Standard_RAGZRS for SkuName. */ + public static final SkuName STANDARD_RAGZRS = fromString("Standard_RAGZRS"); + + /** + * Creates or finds a SkuName from its string representation. + * @param name a name to look for + * @return the corresponding SkuName + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * @return known SkuName values + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/SkuTier.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/SkuTier.java new file mode 100644 index 0000000000000..cdd1ea2004e56 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/SkuTier.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SkuTier. + */ +public enum SkuTier { + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a SkuTier instance. */ + private String value; + + SkuTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuTier instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuTier object, or null if unable to parse. + */ + @JsonCreator + public static SkuTier fromString(String value) { + SkuTier[] items = SkuTier.values(); + for (SkuTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Skus.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Skus.java new file mode 100644 index 0000000000000..e29661bab1717 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Skus.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.SkusInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Skus. + */ +public interface Skus extends SupportsListing, HasInner { +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/State.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/State.java new file mode 100644 index 0000000000000..2854549cb55f1 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/State.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for State. + */ +public enum State { + /** Enum value provisioning. */ + PROVISIONING("provisioning"), + + /** Enum value deprovisioning. */ + DEPROVISIONING("deprovisioning"), + + /** Enum value succeeded. */ + SUCCEEDED("succeeded"), + + /** Enum value failed. */ + FAILED("failed"), + + /** Enum value networkSourceDeleted. */ + NETWORK_SOURCE_DELETED("networkSourceDeleted"); + + /** The actual serialized value for a State instance. */ + private String value; + + State(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a State instance. + * + * @param value the serialized value to parse. + * @return the parsed State object, or null if unable to parse. + */ + @JsonCreator + public static State fromString(String value) { + State[] items = State.values(); + for (State item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccount.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccount.java new file mode 100644 index 0000000000000..5230783dad8bb --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccount.java @@ -0,0 +1,547 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.SkuInner; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageAccountInner; + +/** + * Type representing StorageAccount. + */ +public interface StorageAccount extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the accessTier value. + */ + AccessTier accessTier(); + + /** + * @return the allowBlobPublicAccess value. + */ + Boolean allowBlobPublicAccess(); + + /** + * @return the azureFilesIdentityBasedAuthentication value. + */ + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication(); + + /** + * @return the blobRestoreStatus value. + */ + BlobRestoreStatus blobRestoreStatus(); + + /** + * @return the creationTime value. + */ + DateTime creationTime(); + + /** + * @return the customDomain value. + */ + CustomDomain customDomain(); + + /** + * @return the enableHttpsTrafficOnly value. + */ + Boolean enableHttpsTrafficOnly(); + + /** + * @return the encryption value. + */ + Encryption encryption(); + + /** + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * @return the failoverInProgress value. + */ + Boolean failoverInProgress(); + + /** + * @return the geoReplicationStats value. + */ + GeoReplicationStats geoReplicationStats(); + + /** + * @return the identity value. + */ + Identity identity(); + + /** + * @return the isHnsEnabled value. + */ + Boolean isHnsEnabled(); + + /** + * @return the kind value. + */ + Kind kind(); + + /** + * @return the largeFileSharesState value. + */ + LargeFileSharesState largeFileSharesState(); + + /** + * @return the lastGeoFailoverTime value. + */ + DateTime lastGeoFailoverTime(); + + /** + * @return the minimumTlsVersion value. + */ + MinimumTlsVersion minimumTlsVersion(); + + /** + * @return the networkRuleSet value. + */ + NetworkRuleSet networkRuleSet(); + + /** + * @return the primaryEndpoints value. + */ + Endpoints primaryEndpoints(); + + /** + * @return the primaryLocation value. + */ + String primaryLocation(); + + /** + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the routingPreference value. + */ + RoutingPreference routingPreference(); + + /** + * @return the secondaryEndpoints value. + */ + Endpoints secondaryEndpoints(); + + /** + * @return the secondaryLocation value. + */ + String secondaryLocation(); + + /** + * @return the sku value. + */ + SkuInner sku(); + + /** + * @return the statusOfPrimary value. + */ + AccountStatus statusOfPrimary(); + + /** + * @return the statusOfSecondary value. + */ + AccountStatus statusOfSecondary(); + + /** + * The entirety of the StorageAccount definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithKind, DefinitionStages.WithSku, DefinitionStages.WithCreate { + } + + /** + * Grouping of StorageAccount definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a StorageAccount definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the StorageAccount definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the storageaccount definition allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + * @param kind Required. Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + * @return the next definition stage +*/ + WithSku withKind(Kind kind); + } + + /** + * The stage of the storageaccount definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku Required. Gets or sets the SKU name + * @return the next definition stage +*/ + WithCreate withSku(SkuInner sku); + } + + /** + * The stage of the storageaccount definition allowing to specify AccessTier. + */ + interface WithAccessTier { + /** + * Specifies accessTier. + * @param accessTier Required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool' + * @return the next definition stage + */ + WithCreate withAccessTier(AccessTier accessTier); + } + + /** + * The stage of the storageaccount definition allowing to specify AllowBlobPublicAccess. + */ + interface WithAllowBlobPublicAccess { + /** + * Specifies allowBlobPublicAccess. + * @param allowBlobPublicAccess Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property + * @return the next definition stage + */ + WithCreate withAllowBlobPublicAccess(Boolean allowBlobPublicAccess); + } + + /** + * The stage of the storageaccount definition allowing to specify AzureFilesIdentityBasedAuthentication. + */ + interface WithAzureFilesIdentityBasedAuthentication { + /** + * Specifies azureFilesIdentityBasedAuthentication. + * @param azureFilesIdentityBasedAuthentication Provides the identity based authentication settings for Azure Files + * @return the next definition stage + */ + WithCreate withAzureFilesIdentityBasedAuthentication(AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication); + } + + /** + * The stage of the storageaccount definition allowing to specify CustomDomain. + */ + interface WithCustomDomain { + /** + * Specifies customDomain. + * @param customDomain User domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property + * @return the next definition stage + */ + WithCreate withCustomDomain(CustomDomain customDomain); + } + + /** + * The stage of the storageaccount definition allowing to specify EnableHttpsTrafficOnly. + */ + interface WithEnableHttpsTrafficOnly { + /** + * Specifies enableHttpsTrafficOnly. + * @param enableHttpsTrafficOnly Allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01 + * @return the next definition stage + */ + WithCreate withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly); + } + + /** + * The stage of the storageaccount definition allowing to specify Encryption. + */ + interface WithEncryption { + /** + * Specifies encryption. + * @param encryption Not applicable. Azure Storage encryption is enabled for all storage accounts and cannot be disabled + * @return the next definition stage + */ + WithCreate withEncryption(Encryption encryption); + } + + /** + * The stage of the storageaccount definition allowing to specify ExtendedLocation. + */ + interface WithExtendedLocation { + /** + * Specifies extendedLocation. + * @param extendedLocation Optional. Set the extended location of the resource. If not set, the storage account will be created in Azure main region. Otherwise it will be created in the specified extended location + * @return the next definition stage + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + + /** + * The stage of the storageaccount definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the resource + * @return the next definition stage + */ + WithCreate withIdentity(Identity identity); + } + + /** + * The stage of the storageaccount definition allowing to specify IsHnsEnabled. + */ + interface WithIsHnsEnabled { + /** + * Specifies isHnsEnabled. + * @param isHnsEnabled Account HierarchicalNamespace enabled if sets to true + * @return the next definition stage + */ + WithCreate withIsHnsEnabled(Boolean isHnsEnabled); + } + + /** + * The stage of the storageaccount definition allowing to specify LargeFileSharesState. + */ + interface WithLargeFileSharesState { + /** + * Specifies largeFileSharesState. + * @param largeFileSharesState Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. Possible values include: 'Disabled', 'Enabled' + * @return the next definition stage + */ + WithCreate withLargeFileSharesState(LargeFileSharesState largeFileSharesState); + } + + /** + * The stage of the storageaccount definition allowing to specify MinimumTlsVersion. + */ + interface WithMinimumTlsVersion { + /** + * Specifies minimumTlsVersion. + * @param minimumTlsVersion Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2' + * @return the next definition stage + */ + WithCreate withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion); + } + + /** + * The stage of the storageaccount definition allowing to specify NetworkRuleSet. + */ + interface WithNetworkRuleSet { + /** + * Specifies networkRuleSet. + * @param networkRuleSet Network rule set + * @return the next definition stage + */ + WithCreate withNetworkRuleSet(NetworkRuleSet networkRuleSet); + } + + /** + * The stage of the storageaccount definition allowing to specify RoutingPreference. + */ + interface WithRoutingPreference { + /** + * Specifies routingPreference. + * @param routingPreference Maintains information about the network routing choice opted by the user for data transfer + * @return the next definition stage + */ + WithCreate withRoutingPreference(RoutingPreference routingPreference); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAccessTier, DefinitionStages.WithAllowBlobPublicAccess, DefinitionStages.WithAzureFilesIdentityBasedAuthentication, DefinitionStages.WithCustomDomain, DefinitionStages.WithEnableHttpsTrafficOnly, DefinitionStages.WithEncryption, DefinitionStages.WithExtendedLocation, DefinitionStages.WithIdentity, DefinitionStages.WithIsHnsEnabled, DefinitionStages.WithLargeFileSharesState, DefinitionStages.WithMinimumTlsVersion, DefinitionStages.WithNetworkRuleSet, DefinitionStages.WithRoutingPreference { + } + } + /** + * The template for a StorageAccount update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAccessTier, UpdateStages.WithAllowBlobPublicAccess, UpdateStages.WithAzureFilesIdentityBasedAuthentication, UpdateStages.WithCustomDomain, UpdateStages.WithEnableHttpsTrafficOnly, UpdateStages.WithEncryption, UpdateStages.WithIdentity, UpdateStages.WithKind, UpdateStages.WithLargeFileSharesState, UpdateStages.WithMinimumTlsVersion, UpdateStages.WithNetworkRuleSet, UpdateStages.WithRoutingPreference, UpdateStages.WithSku { + } + + /** + * Grouping of StorageAccount update stages. + */ + interface UpdateStages { + /** + * The stage of the storageaccount update allowing to specify AccessTier. + */ + interface WithAccessTier { + /** + * Specifies accessTier. + * @param accessTier Required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool' + * @return the next update stage + */ + Update withAccessTier(AccessTier accessTier); + } + + /** + * The stage of the storageaccount update allowing to specify AllowBlobPublicAccess. + */ + interface WithAllowBlobPublicAccess { + /** + * Specifies allowBlobPublicAccess. + * @param allowBlobPublicAccess Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property + * @return the next update stage + */ + Update withAllowBlobPublicAccess(Boolean allowBlobPublicAccess); + } + + /** + * The stage of the storageaccount update allowing to specify AzureFilesIdentityBasedAuthentication. + */ + interface WithAzureFilesIdentityBasedAuthentication { + /** + * Specifies azureFilesIdentityBasedAuthentication. + * @param azureFilesIdentityBasedAuthentication Provides the identity based authentication settings for Azure Files + * @return the next update stage + */ + Update withAzureFilesIdentityBasedAuthentication(AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication); + } + + /** + * The stage of the storageaccount update allowing to specify CustomDomain. + */ + interface WithCustomDomain { + /** + * Specifies customDomain. + * @param customDomain Custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property + * @return the next update stage + */ + Update withCustomDomain(CustomDomain customDomain); + } + + /** + * The stage of the storageaccount update allowing to specify EnableHttpsTrafficOnly. + */ + interface WithEnableHttpsTrafficOnly { + /** + * Specifies enableHttpsTrafficOnly. + * @param enableHttpsTrafficOnly Allows https traffic only to storage service if sets to true + * @return the next update stage + */ + Update withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly); + } + + /** + * The stage of the storageaccount update allowing to specify Encryption. + */ + interface WithEncryption { + /** + * Specifies encryption. + * @param encryption Provides the encryption settings on the account. The default setting is unencrypted + * @return the next update stage + */ + Update withEncryption(Encryption encryption); + } + + /** + * The stage of the storageaccount update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the resource + * @return the next update stage + */ + Update withIdentity(Identity identity); + } + + /** + * The stage of the storageaccount update allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + * @param kind Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + * @return the next update stage + */ + Update withKind(Kind kind); + } + + /** + * The stage of the storageaccount update allowing to specify LargeFileSharesState. + */ + interface WithLargeFileSharesState { + /** + * Specifies largeFileSharesState. + * @param largeFileSharesState Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. Possible values include: 'Disabled', 'Enabled' + * @return the next update stage + */ + Update withLargeFileSharesState(LargeFileSharesState largeFileSharesState); + } + + /** + * The stage of the storageaccount update allowing to specify MinimumTlsVersion. + */ + interface WithMinimumTlsVersion { + /** + * Specifies minimumTlsVersion. + * @param minimumTlsVersion Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2' + * @return the next update stage + */ + Update withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion); + } + + /** + * The stage of the storageaccount update allowing to specify NetworkRuleSet. + */ + interface WithNetworkRuleSet { + /** + * Specifies networkRuleSet. + * @param networkRuleSet Network rule set + * @return the next update stage + */ + Update withNetworkRuleSet(NetworkRuleSet networkRuleSet); + } + + /** + * The stage of the storageaccount update allowing to specify RoutingPreference. + */ + interface WithRoutingPreference { + /** + * Specifies routingPreference. + * @param routingPreference Maintains information about the network routing choice opted by the user for data transfer + * @return the next update stage + */ + Update withRoutingPreference(RoutingPreference routingPreference); + } + + /** + * The stage of the storageaccount update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku Gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other value + * @return the next update stage + */ + Update withSku(SkuInner sku); + } + + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountCheckNameAvailabilityParameters.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountCheckNameAvailabilityParameters.java new file mode 100644 index 0000000000000..ea29111fa788a --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountCheckNameAvailabilityParameters.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters used to check the availability of the storage account name. + */ +public class StorageAccountCheckNameAvailabilityParameters { + /** + * The storage account name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The type of resource, Microsoft.Storage/storageAccounts. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of StorageAccountCheckNameAvailabilityParameters class. + * @param name the storage account name. + */ + public StorageAccountCheckNameAvailabilityParameters() { + type = "Microsoft.Storage/storageAccounts"; + } + + /** + * Get the storage account name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the storage account name. + * + * @param name the name value to set + * @return the StorageAccountCheckNameAvailabilityParameters object itself. + */ + public StorageAccountCheckNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of resource, Microsoft.Storage/storageAccounts. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of resource, Microsoft.Storage/storageAccounts. + * + * @param type the type value to set + * @return the StorageAccountCheckNameAvailabilityParameters object itself. + */ + public StorageAccountCheckNameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountCreateParameters.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountCreateParameters.java new file mode 100644 index 0000000000000..520eb9bd3dba5 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountCreateParameters.java @@ -0,0 +1,486 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.SkuInner; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters used when creating a storage account. + */ +@JsonFlatten +public class StorageAccountCreateParameters { + /** + * Required. Gets or sets the SKU name. + */ + @JsonProperty(value = "sku", required = true) + private SkuInner sku; + + /** + * Required. Indicates the type of storage account. Possible values + * include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage'. + */ + @JsonProperty(value = "kind", required = true) + private Kind kind; + + /** + * Required. Gets or sets the location of the resource. This will be one of + * the supported and registered Azure Geo Regions (e.g. West US, East US, + * Southeast Asia, etc.). The geo region of a resource cannot be changed + * once it is created, but if an identical geo region is specified on + * update, the request will succeed. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Optional. Set the extended location of the resource. If not set, the + * storage account will be created in Azure main region. Otherwise it will + * be created in the specified extended location. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /** + * 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; + + /** + * Not applicable. Azure Storage encryption is enabled for all storage + * accounts and cannot be disabled. + */ + @JsonProperty(value = "properties.encryption") + private Encryption encryption; + + /** + * Network rule set. + */ + @JsonProperty(value = "properties.networkAcls") + private NetworkRuleSet networkRuleSet; + + /** + * Required for storage accounts where kind = BlobStorage. The access tier + * used for billing. Possible values include: 'Hot', 'Cool'. + */ + @JsonProperty(value = "properties.accessTier") + private AccessTier accessTier; + + /** + * Provides the identity based authentication settings for Azure Files. + */ + @JsonProperty(value = "properties.azureFilesIdentityBasedAuthentication") + private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; + + /** + * Allows https traffic only to storage service if sets to true. The + * default value is true since API version 2019-04-01. + */ + @JsonProperty(value = "properties.supportsHttpsTrafficOnly") + private Boolean enableHttpsTrafficOnly; + + /** + * Account HierarchicalNamespace enabled if sets to true. + */ + @JsonProperty(value = "properties.isHnsEnabled") + private Boolean isHnsEnabled; + + /** + * Allow large file shares if sets to Enabled. It cannot be disabled once + * it is enabled. Possible values include: 'Disabled', 'Enabled'. + */ + @JsonProperty(value = "properties.largeFileSharesState") + private LargeFileSharesState largeFileSharesState; + + /** + * Maintains information about the network routing choice opted by the user + * for data transfer. + */ + @JsonProperty(value = "properties.routingPreference") + private RoutingPreference routingPreference; + + /** + * Allow or disallow public access to all blobs or containers in the + * storage account. The default interpretation is true for this property. + */ + @JsonProperty(value = "properties.allowBlobPublicAccess") + private Boolean allowBlobPublicAccess; + + /** + * Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. Possible values + * include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + */ + @JsonProperty(value = "properties.minimumTlsVersion") + private MinimumTlsVersion minimumTlsVersion; + + /** + * Get required. Gets or sets the SKU name. + * + * @return the sku value + */ + public SkuInner sku() { + return this.sku; + } + + /** + * Set required. Gets or sets the SKU name. + * + * @param sku the sku value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withSku(SkuInner sku) { + this.sku = sku; + return this; + } + + /** + * Get required. Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + * + * @return the kind value + */ + public Kind kind() { + return this.kind; + } + + /** + * Set required. Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + * + * @param kind the kind value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withKind(Kind kind) { + this.kind = kind; + return this; + } + + /** + * Get required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. + * + * @param location the location value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get optional. Set the extended location of the resource. If not set, the storage account will be created in Azure main region. Otherwise it will be created in the specified extended location. + * + * @return the extendedLocation value + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set optional. Set the extended location of the resource. If not set, the storage account will be created in Azure main region. Otherwise it will be created in the specified extended location. + * + * @param extendedLocation the extendedLocation value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + 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 not applicable. Azure Storage encryption is enabled for all storage accounts and cannot be disabled. + * + * @return the encryption value + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Set not applicable. Azure Storage encryption is enabled for all storage accounts and cannot be disabled. + * + * @param encryption the encryption value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withEncryption(Encryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get network rule set. + * + * @return the networkRuleSet value + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Set network rule set. + * + * @param networkRuleSet the networkRuleSet value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + this.networkRuleSet = networkRuleSet; + return this; + } + + /** + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. + * + * @return the accessTier value + */ + public AccessTier accessTier() { + return this.accessTier; + } + + /** + * Set required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. + * + * @param accessTier the accessTier value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAccessTier(AccessTier accessTier) { + this.accessTier = accessTier; + return this; + } + + /** + * Get provides the identity based authentication settings for Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value + */ + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.azureFilesIdentityBasedAuthentication; + } + + /** + * Set provides the identity based authentication settings for Azure Files. + * + * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAzureFilesIdentityBasedAuthentication(AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + this.azureFilesIdentityBasedAuthentication = azureFilesIdentityBasedAuthentication; + return this; + } + + /** + * Get allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01. + * + * @return the enableHttpsTrafficOnly value + */ + public Boolean enableHttpsTrafficOnly() { + return this.enableHttpsTrafficOnly; + } + + /** + * Set allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; + return this; + } + + /** + * Get account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value + */ + public Boolean isHnsEnabled() { + return this.isHnsEnabled; + } + + /** + * Set account HierarchicalNamespace enabled if sets to true. + * + * @param isHnsEnabled the isHnsEnabled value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withIsHnsEnabled(Boolean isHnsEnabled) { + this.isHnsEnabled = isHnsEnabled; + return this; + } + + /** + * Get allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. Possible values include: 'Disabled', 'Enabled'. + * + * @return the largeFileSharesState value + */ + public LargeFileSharesState largeFileSharesState() { + return this.largeFileSharesState; + } + + /** + * Set allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. Possible values include: 'Disabled', 'Enabled'. + * + * @param largeFileSharesState the largeFileSharesState value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { + this.largeFileSharesState = largeFileSharesState; + return this; + } + + /** + * Get maintains information about the network routing choice opted by the user for data transfer. + * + * @return the routingPreference value + */ + public RoutingPreference routingPreference() { + return this.routingPreference; + } + + /** + * Set maintains information about the network routing choice opted by the user for data transfer. + * + * @param routingPreference the routingPreference value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withRoutingPreference(RoutingPreference routingPreference) { + this.routingPreference = routingPreference; + return this; + } + + /** + * Get allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + * + * @return the allowBlobPublicAccess value + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + return this; + } + + /** + * Get set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + * + * @return the minimumTlsVersion value + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + * + * @param minimumTlsVersion the minimumTlsVersion value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountExpand.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountExpand.java new file mode 100644 index 0000000000000..0df82efffa313 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountExpand.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StorageAccountExpand. + */ +public enum StorageAccountExpand { + /** Enum value geoReplicationStats. */ + GEO_REPLICATION_STATS("geoReplicationStats"), + + /** Enum value blobRestoreStatus. */ + BLOB_RESTORE_STATUS("blobRestoreStatus"); + + /** The actual serialized value for a StorageAccountExpand instance. */ + private String value; + + StorageAccountExpand(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StorageAccountExpand instance. + * + * @param value the serialized value to parse. + * @return the parsed StorageAccountExpand object, or null if unable to parse. + */ + @JsonCreator + public static StorageAccountExpand fromString(String value) { + StorageAccountExpand[] items = StorageAccountExpand.values(); + for (StorageAccountExpand item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountInternetEndpoints.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountInternetEndpoints.java new file mode 100644 index 0000000000000..5998e4e4c5f6c --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountInternetEndpoints.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The URIs that are used to perform a retrieval of a public blob, file, web or + * dfs object via a internet routing endpoint. + */ +public class StorageAccountInternetEndpoints { + /** + * Gets the blob endpoint. + */ + @JsonProperty(value = "blob", access = JsonProperty.Access.WRITE_ONLY) + private String blob; + + /** + * Gets the file endpoint. + */ + @JsonProperty(value = "file", access = JsonProperty.Access.WRITE_ONLY) + private String file; + + /** + * Gets the web endpoint. + */ + @JsonProperty(value = "web", access = JsonProperty.Access.WRITE_ONLY) + private String web; + + /** + * Gets the dfs endpoint. + */ + @JsonProperty(value = "dfs", access = JsonProperty.Access.WRITE_ONLY) + private String dfs; + + /** + * Get gets the blob endpoint. + * + * @return the blob value + */ + public String blob() { + return this.blob; + } + + /** + * Get gets the file endpoint. + * + * @return the file value + */ + public String file() { + return this.file; + } + + /** + * Get gets the web endpoint. + * + * @return the web value + */ + public String web() { + return this.web; + } + + /** + * Get gets the dfs endpoint. + * + * @return the dfs value + */ + public String dfs() { + return this.dfs; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountKey.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountKey.java new file mode 100644 index 0000000000000..280a41b0b2b46 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountKey.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An access key for the storage account. + */ +public class StorageAccountKey { + /** + * Name of the key. + */ + @JsonProperty(value = "keyName", access = JsonProperty.Access.WRITE_ONLY) + private String keyName; + + /** + * Base 64-encoded value of the key. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Permissions for the key -- read-only or full permissions. Possible + * values include: 'Read', 'Full'. + */ + @JsonProperty(value = "permissions", access = JsonProperty.Access.WRITE_ONLY) + private KeyPermission permissions; + + /** + * Get name of the key. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Get base 64-encoded value of the key. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Get permissions for the key -- read-only or full permissions. Possible values include: 'Read', 'Full'. + * + * @return the permissions value + */ + public KeyPermission permissions() { + return this.permissions; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountListKeysResult.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountListKeysResult.java new file mode 100644 index 0000000000000..433ad36756c74 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountListKeysResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageAccountListKeysResultInner; +import java.util.List; + +/** + * Type representing StorageAccountListKeysResult. + */ +public interface StorageAccountListKeysResult extends HasInner, HasManager { + /** + * @return the keys value. + */ + List keys(); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountMicrosoftEndpoints.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountMicrosoftEndpoints.java new file mode 100644 index 0000000000000..1f7dabb21f551 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountMicrosoftEndpoints.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The URIs that are used to perform a retrieval of a public blob, queue, + * table, web or dfs object via a microsoft routing endpoint. + */ +public class StorageAccountMicrosoftEndpoints { + /** + * Gets the blob endpoint. + */ + @JsonProperty(value = "blob", access = JsonProperty.Access.WRITE_ONLY) + private String blob; + + /** + * Gets the queue endpoint. + */ + @JsonProperty(value = "queue", access = JsonProperty.Access.WRITE_ONLY) + private String queue; + + /** + * Gets the table endpoint. + */ + @JsonProperty(value = "table", access = JsonProperty.Access.WRITE_ONLY) + private String table; + + /** + * Gets the file endpoint. + */ + @JsonProperty(value = "file", access = JsonProperty.Access.WRITE_ONLY) + private String file; + + /** + * Gets the web endpoint. + */ + @JsonProperty(value = "web", access = JsonProperty.Access.WRITE_ONLY) + private String web; + + /** + * Gets the dfs endpoint. + */ + @JsonProperty(value = "dfs", access = JsonProperty.Access.WRITE_ONLY) + private String dfs; + + /** + * Get gets the blob endpoint. + * + * @return the blob value + */ + public String blob() { + return this.blob; + } + + /** + * Get gets the queue endpoint. + * + * @return the queue value + */ + public String queue() { + return this.queue; + } + + /** + * Get gets the table endpoint. + * + * @return the table value + */ + public String table() { + return this.table; + } + + /** + * Get gets the file endpoint. + * + * @return the file value + */ + public String file() { + return this.file; + } + + /** + * Get gets the web endpoint. + * + * @return the web value + */ + public String web() { + return this.web; + } + + /** + * Get gets the dfs endpoint. + * + * @return the dfs value + */ + public String dfs() { + return this.dfs; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountRegenerateKeyParameters.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountRegenerateKeyParameters.java new file mode 100644 index 0000000000000..be246115afb13 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountRegenerateKeyParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters used to regenerate the storage account key. + */ +public class StorageAccountRegenerateKeyParameters { + /** + * The name of storage keys that want to be regenerated, possible values + * are key1, key2, kerb1, kerb2. + */ + @JsonProperty(value = "keyName", required = true) + private String keyName; + + /** + * Get the name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. + * + * @param keyName the keyName value to set + * @return the StorageAccountRegenerateKeyParameters object itself. + */ + public StorageAccountRegenerateKeyParameters withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountUpdateParameters.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountUpdateParameters.java new file mode 100644 index 0000000000000..0446479444b02 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccountUpdateParameters.java @@ -0,0 +1,404 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.SkuInner; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters that can be provided when updating the storage account + * properties. + */ +@JsonFlatten +public class StorageAccountUpdateParameters { + /** + * Gets or sets the SKU name. Note that the SKU name cannot be updated to + * Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU + * names be updated to any other value. + */ + @JsonProperty(value = "sku") + private SkuInner sku; + + /** + * Gets or sets a list of key value pairs that describe the resource. These + * tags can be used in viewing and grouping this resource (across resource + * groups). A maximum of 15 tags can be provided for a resource. Each tag + * must have a key no greater in length than 128 characters and a value no + * greater in length than 256 characters. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /** + * Custom domain assigned to the storage account by the user. Name is the + * CNAME source. Only one custom domain is supported per storage account at + * this time. To clear the existing custom domain, use an empty string for + * the custom domain name property. + */ + @JsonProperty(value = "properties.customDomain") + private CustomDomain customDomain; + + /** + * Provides the encryption settings on the account. The default setting is + * unencrypted. + */ + @JsonProperty(value = "properties.encryption") + private Encryption encryption; + + /** + * Required for storage accounts where kind = BlobStorage. The access tier + * used for billing. Possible values include: 'Hot', 'Cool'. + */ + @JsonProperty(value = "properties.accessTier") + private AccessTier accessTier; + + /** + * Provides the identity based authentication settings for Azure Files. + */ + @JsonProperty(value = "properties.azureFilesIdentityBasedAuthentication") + private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; + + /** + * Allows https traffic only to storage service if sets to true. + */ + @JsonProperty(value = "properties.supportsHttpsTrafficOnly") + private Boolean enableHttpsTrafficOnly; + + /** + * Network rule set. + */ + @JsonProperty(value = "properties.networkAcls") + private NetworkRuleSet networkRuleSet; + + /** + * Allow large file shares if sets to Enabled. It cannot be disabled once + * it is enabled. Possible values include: 'Disabled', 'Enabled'. + */ + @JsonProperty(value = "properties.largeFileSharesState") + private LargeFileSharesState largeFileSharesState; + + /** + * Maintains information about the network routing choice opted by the user + * for data transfer. + */ + @JsonProperty(value = "properties.routingPreference") + private RoutingPreference routingPreference; + + /** + * Allow or disallow public access to all blobs or containers in the + * storage account. The default interpretation is true for this property. + */ + @JsonProperty(value = "properties.allowBlobPublicAccess") + private Boolean allowBlobPublicAccess; + + /** + * Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. Possible values + * include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + */ + @JsonProperty(value = "properties.minimumTlsVersion") + private MinimumTlsVersion minimumTlsVersion; + + /** + * Optional. Indicates the type of storage account. Currently only + * StorageV2 value supported by server. Possible values include: 'Storage', + * 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + */ + @JsonProperty(value = "kind") + private Kind kind; + + /** + * Get gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other value. + * + * @return the sku value + */ + public SkuInner sku() { + return this.sku; + } + + /** + * Set gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other value. + * + * @param sku the sku value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withSku(SkuInner sku) { + this.sku = sku; + return this; + } + + /** + * Get gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. + * + * @param tags the tags value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity of the resource. + * + * @return the identity value + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity of the resource. + * + * @param identity the identity value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. + * + * @return the customDomain value + */ + public CustomDomain customDomain() { + return this.customDomain; + } + + /** + * Set custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. + * + * @param customDomain the customDomain value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withCustomDomain(CustomDomain customDomain) { + this.customDomain = customDomain; + return this; + } + + /** + * Get provides the encryption settings on the account. The default setting is unencrypted. + * + * @return the encryption value + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Set provides the encryption settings on the account. The default setting is unencrypted. + * + * @param encryption the encryption value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withEncryption(Encryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. + * + * @return the accessTier value + */ + public AccessTier accessTier() { + return this.accessTier; + } + + /** + * Set required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. + * + * @param accessTier the accessTier value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAccessTier(AccessTier accessTier) { + this.accessTier = accessTier; + return this; + } + + /** + * Get provides the identity based authentication settings for Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value + */ + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.azureFilesIdentityBasedAuthentication; + } + + /** + * Set provides the identity based authentication settings for Azure Files. + * + * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAzureFilesIdentityBasedAuthentication(AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + this.azureFilesIdentityBasedAuthentication = azureFilesIdentityBasedAuthentication; + return this; + } + + /** + * Get allows https traffic only to storage service if sets to true. + * + * @return the enableHttpsTrafficOnly value + */ + public Boolean enableHttpsTrafficOnly() { + return this.enableHttpsTrafficOnly; + } + + /** + * Set allows https traffic only to storage service if sets to true. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; + return this; + } + + /** + * Get network rule set. + * + * @return the networkRuleSet value + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Set network rule set. + * + * @param networkRuleSet the networkRuleSet value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + this.networkRuleSet = networkRuleSet; + return this; + } + + /** + * Get allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. Possible values include: 'Disabled', 'Enabled'. + * + * @return the largeFileSharesState value + */ + public LargeFileSharesState largeFileSharesState() { + return this.largeFileSharesState; + } + + /** + * Set allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. Possible values include: 'Disabled', 'Enabled'. + * + * @param largeFileSharesState the largeFileSharesState value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { + this.largeFileSharesState = largeFileSharesState; + return this; + } + + /** + * Get maintains information about the network routing choice opted by the user for data transfer. + * + * @return the routingPreference value + */ + public RoutingPreference routingPreference() { + return this.routingPreference; + } + + /** + * Set maintains information about the network routing choice opted by the user for data transfer. + * + * @param routingPreference the routingPreference value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withRoutingPreference(RoutingPreference routingPreference) { + this.routingPreference = routingPreference; + return this; + } + + /** + * Get allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + * + * @return the allowBlobPublicAccess value + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + return this; + } + + /** + * Get set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + * + * @return the minimumTlsVersion value + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + * + * @param minimumTlsVersion the minimumTlsVersion value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + + /** + * Get optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + * + * @return the kind value + */ + public Kind kind() { + return this.kind; + } + + /** + * Set optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + * + * @param kind the kind value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withKind(Kind kind) { + this.kind = kind; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccounts.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccounts.java new file mode 100644 index 0000000000000..6afb0b3b37ad1 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageAccounts.java @@ -0,0 +1,112 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageAccountsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StorageAccounts. + */ +public interface StorageAccounts extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String accountName); + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeyAsync(String resourceGroupName, String accountName, String keyName); + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAccountSASAsync(String resourceGroupName, String accountName, AccountSasParameters parameters); + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listServiceSASAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters); + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable failoverAsync(String resourceGroupName, String accountName); + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable restoreBlobRangesAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List blobRanges); + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable revokeUserDelegationKeysAsync(String resourceGroupName, String accountName); + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param name The storage account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String name); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageQueue.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageQueue.java new file mode 100644 index 0000000000000..2ab4e0fa8bbce --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/StorageQueue.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageQueueInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import java.util.Map; + +/** + * Type representing StorageQueue. + */ +public interface StorageQueue extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the approximateMessageCount value. + */ + Integer approximateMessageCount(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the metadata value. + */ + Map metadata(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the StorageQueue definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithQueueService, DefinitionStages.WithMetadata, DefinitionStages.WithCreate { + } + + /** + * Grouping of StorageQueue definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a StorageQueue definition. + */ + interface Blank extends WithQueueService { + } + + /** + * The stage of the storagequeue definition allowing to specify QueueService. + */ + interface WithQueueService { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only + * @return the next definition stage + */ + WithMetadata withExistingQueueService(String resourceGroupName, String accountName); + } + + /** + * The stage of the storagequeue definition allowing to specify Metadata. + */ + interface WithMetadata { + /** + * Specifies metadata. + * @param metadata A name-value pair that represents queue metadata + * @return the next definition stage + */ + WithCreate withMetadata(Map metadata); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a StorageQueue update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithMetadata { + } + + /** + * Grouping of StorageQueue update stages. + */ + interface UpdateStages { + /** + * The stage of the storagequeue update allowing to specify Metadata. + */ + interface WithMetadata { + /** + * Specifies metadata. + * @param metadata A name-value pair that represents queue metadata + * @return the next update stage + */ + Update withMetadata(Map metadata); + } + + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Table.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Table.java new file mode 100644 index 0000000000000..63ef22eec3cf8 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Table.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.TableInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; + +/** + * Type representing Table. + */ +public interface Table extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the tableName value. + */ + String tableName(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Table definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithTableService, DefinitionStages.WithCreate { + } + + /** + * Grouping of Table definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Table definition. + */ + interface Blank extends WithTableService { + } + + /** + * The stage of the table definition allowing to specify TableService. + */ + interface WithTableService { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only + * @return the next definition stage + */ + WithCreate withExistingTableService(String resourceGroupName, String accountName); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a Table update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable
{ + } + + /** + * Grouping of Table update stages. + */ + interface UpdateStages { + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/TableServiceProperties.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/TableServiceProperties.java new file mode 100644 index 0000000000000..57c533ca97887 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/TableServiceProperties.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.TableServicePropertiesInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; +import java.util.List; + +/** + * Type representing TableServiceProperties. + */ +public interface TableServiceProperties extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the cors value. + */ + CorsRules cors(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the TableServiceProperties definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithStorageAccount, DefinitionStages.WithCors, DefinitionStages.WithCreate { + } + + /** + * Grouping of TableServiceProperties definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a TableServiceProperties definition. + */ + interface Blank extends WithStorageAccount { + } + + /** + * The stage of the tableserviceproperties definition allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only + * @return the next definition stage + */ + WithCors withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the tableserviceproperties definition allowing to specify Cors. + */ + interface WithCors { + /** + * Specifies cors. + * @param cors Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Table service + * @return the next definition stage + */ + WithCreate withCors(CorsRules cors); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a TableServiceProperties update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCors { + } + + /** + * Grouping of TableServiceProperties update stages. + */ + interface UpdateStages { + /** + * The stage of the tableserviceproperties update allowing to specify Cors. + */ + interface WithCors { + /** + * Specifies cors. + * @param cors Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Table service + * @return the next update stage + */ + Update withCors(CorsRules cors); + } + + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/TableServices.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/TableServices.java new file mode 100644 index 0000000000000..afb450115e774 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/TableServices.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.TableServicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing TableServices. + */ +public interface TableServices extends SupportsCreating, HasInner { + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName); + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getServicePropertiesAsync(String resourceGroupName, String accountName); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Tables.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Tables.java new file mode 100644 index 0000000000000..e335e061650c5 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Tables.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.TablesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Tables. + */ +public interface Tables extends SupportsCreating, HasInner { + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable
getAsync(String resourceGroupName, String accountName, String tableName); + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String tableName); + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable
listAsync(final String resourceGroupName, final String accountName); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/TagFilter.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/TagFilter.java new file mode 100644 index 0000000000000..488b315368659 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/TagFilter.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Blob index tag based filtering for blob objects. + */ +public class TagFilter { + /** + * This is the filter tag name, it can have 1 - 128 characters. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * This is the comparison operator which is used for object comparison and + * filtering. Only == (equality operator) is currently supported. + */ + @JsonProperty(value = "op", required = true) + private String op; + + /** + * This is the filter tag value field used for tag based filtering, it can + * have 0 - 256 characters. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get this is the filter tag name, it can have 1 - 128 characters. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set this is the filter tag name, it can have 1 - 128 characters. + * + * @param name the name value to set + * @return the TagFilter object itself. + */ + public TagFilter withName(String name) { + this.name = name; + return this; + } + + /** + * Get this is the comparison operator which is used for object comparison and filtering. Only == (equality operator) is currently supported. + * + * @return the op value + */ + public String op() { + return this.op; + } + + /** + * Set this is the comparison operator which is used for object comparison and filtering. Only == (equality operator) is currently supported. + * + * @param op the op value to set + * @return the TagFilter object itself. + */ + public TagFilter withOp(String op) { + this.op = op; + return this; + } + + /** + * Get this is the filter tag value field used for tag based filtering, it can have 0 - 256 characters. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set this is the filter tag value field used for tag based filtering, it can have 0 - 256 characters. + * + * @param value the value value to set + * @return the TagFilter object itself. + */ + public TagFilter withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/TagProperty.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/TagProperty.java new file mode 100644 index 0000000000000..7bb453bd0a1cb --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/TagProperty.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +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/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/UpdateHistoryProperty.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/UpdateHistoryProperty.java new file mode 100644 index 0000000000000..8bc4fb9a991d7 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/UpdateHistoryProperty.java @@ -0,0 +1,113 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +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/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Usage.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Usage.java new file mode 100644 index 0000000000000..3546d1fd7b9c8 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Usage.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.UsageInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.StorageManager; + +/** + * Type representing Usage. + */ +public interface Usage extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Integer currentValue(); + + /** + * @return the limit value. + */ + Integer limit(); + + /** + * @return the name value. + */ + UsageName name(); + + /** + * @return the unit value. + */ + UsageUnit unit(); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/UsageName.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/UsageName.java new file mode 100644 index 0000000000000..112eb67b0e4d4 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/UsageName.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The usage names that can be used; currently limited to StorageAccount. + */ +public class UsageName { + /** + * Gets a string describing the resource name. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Gets a localized string describing the resource name. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /** + * Get gets a string describing the resource name. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Get gets a localized string describing the resource name. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/UsageUnit.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/UsageUnit.java new file mode 100644 index 0000000000000..9efa43224e54b --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/UsageUnit.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for UsageUnit. + */ +public enum UsageUnit { + /** Enum value Count. */ + COUNT("Count"), + + /** Enum value Bytes. */ + BYTES("Bytes"), + + /** Enum value Seconds. */ + SECONDS("Seconds"), + + /** Enum value Percent. */ + PERCENT("Percent"), + + /** Enum value CountsPerSecond. */ + COUNTS_PER_SECOND("CountsPerSecond"), + + /** Enum value BytesPerSecond. */ + BYTES_PER_SECOND("BytesPerSecond"); + + /** The actual serialized value for a UsageUnit instance. */ + private String value; + + UsageUnit(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a UsageUnit instance. + * + * @param value the serialized value to parse. + * @return the parsed UsageUnit object, or null if unable to parse. + */ + @JsonCreator + public static UsageUnit fromString(String value) { + UsageUnit[] items = UsageUnit.values(); + for (UsageUnit item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Usages.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Usages.java new file mode 100644 index 0000000000000..05e86e5dd172e --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/Usages.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.implementation.UsagesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Usages. + */ +public interface Usages extends HasInner { + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByLocationAsync(String location); + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/VirtualNetworkRule.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/VirtualNetworkRule.java new file mode 100644 index 0000000000000..280c47c29c605 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/VirtualNetworkRule.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Virtual Network rule. + */ +public class VirtualNetworkRule { + /** + * Resource ID of a subnet, for example: + * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + */ + @JsonProperty(value = "id", required = true) + private String virtualNetworkResourceId; + + /** + * The action of virtual network rule. Possible values include: 'Allow'. + */ + @JsonProperty(value = "action") + private Action action; + + /** + * Gets the state of virtual network rule. Possible values include: + * 'provisioning', 'deprovisioning', 'succeeded', 'failed', + * 'networkSourceDeleted'. + */ + @JsonProperty(value = "state") + private State state; + + /** + * Get resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + * + * @return the virtualNetworkResourceId value + */ + public String virtualNetworkResourceId() { + return this.virtualNetworkResourceId; + } + + /** + * Set resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + * + * @param virtualNetworkResourceId the virtualNetworkResourceId value to set + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withVirtualNetworkResourceId(String virtualNetworkResourceId) { + this.virtualNetworkResourceId = virtualNetworkResourceId; + return this; + } + + /** + * Get the action of virtual network rule. Possible values include: 'Allow'. + * + * @return the action value + */ + public Action action() { + return this.action; + } + + /** + * Set the action of virtual network rule. Possible values include: 'Allow'. + * + * @param action the action value to set + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withAction(Action action) { + this.action = action; + return this; + } + + /** + * Get gets the state of virtual network rule. Possible values include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', 'networkSourceDeleted'. + * + * @return the state value + */ + public State state() { + return this.state; + } + + /** + * Set gets the state of virtual network rule. Possible values include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', 'networkSourceDeleted'. + * + * @param state the state value to set + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withState(State state) { + this.state = state; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobContainerImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobContainerImpl.java new file mode 100644 index 0000000000000..c566b1b63841c --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobContainerImpl.java @@ -0,0 +1,211 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainer; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_08_01_preview.PublicAccess; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LeaseStatus; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LeaseState; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LeaseDuration; +import java.util.Map; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ImmutabilityPolicyProperties; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LegalHoldProperties; + +class BlobContainerImpl extends CreatableUpdatableImpl implements BlobContainer, BlobContainer.Definition, BlobContainer.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private String containerName; + + BlobContainerImpl(String name, StorageManager manager) { + super(name, new BlobContainerInner()); + this.manager = manager; + // Set resource name + this.containerName = name; + // + } + + BlobContainerImpl(BlobContainerInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.containerName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + this.containerName = IdParsingUtils.getValueFromIdByName(inner.id(), "containers"); + // + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + BlobContainersInner client = this.manager().inner().blobContainers(); + return client.createAsync(this.resourceGroupName, this.accountName, this.containerName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + BlobContainersInner client = this.manager().inner().blobContainers(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.containerName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + BlobContainersInner client = this.manager().inner().blobContainers(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String defaultEncryptionScope() { + return this.inner().defaultEncryptionScope(); + } + + @Override + public Boolean deleted() { + return this.inner().deleted(); + } + + @Override + public DateTime deletedTime() { + return this.inner().deletedTime(); + } + + @Override + public Boolean denyEncryptionScopeOverride() { + return this.inner().denyEncryptionScopeOverride(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Boolean hasImmutabilityPolicy() { + return this.inner().hasImmutabilityPolicy(); + } + + @Override + public Boolean hasLegalHold() { + return this.inner().hasLegalHold(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public ImmutabilityPolicyProperties immutabilityPolicy() { + return this.inner().immutabilityPolicy(); + } + + @Override + public DateTime lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public LeaseDuration leaseDuration() { + return this.inner().leaseDuration(); + } + + @Override + public LeaseState leaseState() { + return this.inner().leaseState(); + } + + @Override + public LeaseStatus leaseStatus() { + return this.inner().leaseStatus(); + } + + @Override + public LegalHoldProperties legalHold() { + return this.inner().legalHold(); + } + + @Override + public Map metadata() { + return this.inner().metadata(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PublicAccess publicAccess() { + return this.inner().publicAccess(); + } + + @Override + public Integer remainingRetentionDays() { + return this.inner().remainingRetentionDays(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String version() { + return this.inner().version(); + } + + @Override + public BlobContainerImpl withExistingBlobService(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public BlobContainerImpl withDefaultEncryptionScope(String defaultEncryptionScope) { + this.inner().withDefaultEncryptionScope(defaultEncryptionScope); + return this; + } + + @Override + public BlobContainerImpl withDenyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride) { + this.inner().withDenyEncryptionScopeOverride(denyEncryptionScopeOverride); + return this; + } + + @Override + public BlobContainerImpl withMetadata(Map metadata) { + this.inner().withMetadata(metadata); + return this; + } + + @Override + public BlobContainerImpl withPublicAccess(PublicAccess publicAccess) { + this.inner().withPublicAccess(publicAccess); + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobContainerInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobContainerInner.java new file mode 100644 index 0000000000000..c72a82e9da2ca --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobContainerInner.java @@ -0,0 +1,325 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_08_01_preview.PublicAccess; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LeaseStatus; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LeaseState; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LeaseDuration; +import java.util.Map; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ImmutabilityPolicyProperties; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LegalHoldProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.storage.v2019_08_01_preview.AzureEntityResource; + +/** + * Properties of the blob container, including Id, resource name, resource + * type, Etag. + */ +@JsonFlatten +public class BlobContainerInner extends AzureEntityResource { + /** + * The version of the deleted blob container. + */ + @JsonProperty(value = "properties.version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /** + * Indicates whether the blob container was deleted. + */ + @JsonProperty(value = "properties.deleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean deleted; + + /** + * Blob container deletion time. + */ + @JsonProperty(value = "properties.deletedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime deletedTime; + + /** + * Remaining retention days for soft deleted blob container. + */ + @JsonProperty(value = "properties.remainingRetentionDays", access = JsonProperty.Access.WRITE_ONLY) + private Integer remainingRetentionDays; + + /** + * Default the container to use specified encryption scope for all writes. + */ + @JsonProperty(value = "properties.defaultEncryptionScope") + private String defaultEncryptionScope; + + /** + * Block override of encryption scope from the container default. + */ + @JsonProperty(value = "properties.denyEncryptionScopeOverride") + private Boolean denyEncryptionScopeOverride; + + /** + * 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 the version of the deleted blob container. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Get indicates whether the blob container was deleted. + * + * @return the deleted value + */ + public Boolean deleted() { + return this.deleted; + } + + /** + * Get blob container deletion time. + * + * @return the deletedTime value + */ + public DateTime deletedTime() { + return this.deletedTime; + } + + /** + * Get remaining retention days for soft deleted blob container. + * + * @return the remainingRetentionDays value + */ + public Integer remainingRetentionDays() { + return this.remainingRetentionDays; + } + + /** + * Get default the container to use specified encryption scope for all writes. + * + * @return the defaultEncryptionScope value + */ + public String defaultEncryptionScope() { + return this.defaultEncryptionScope; + } + + /** + * Set default the container to use specified encryption scope for all writes. + * + * @param defaultEncryptionScope the defaultEncryptionScope value to set + * @return the BlobContainerInner object itself. + */ + public BlobContainerInner withDefaultEncryptionScope(String defaultEncryptionScope) { + this.defaultEncryptionScope = defaultEncryptionScope; + return this; + } + + /** + * Get block override of encryption scope from the container default. + * + * @return the denyEncryptionScopeOverride value + */ + public Boolean denyEncryptionScopeOverride() { + return this.denyEncryptionScopeOverride; + } + + /** + * Set block override of encryption scope from the container default. + * + * @param denyEncryptionScopeOverride the denyEncryptionScopeOverride value to set + * @return the BlobContainerInner object itself. + */ + public BlobContainerInner withDenyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride) { + this.denyEncryptionScopeOverride = denyEncryptionScopeOverride; + return this; + } + + /** + * 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/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobContainersImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobContainersImpl.java new file mode 100644 index 0000000000000..09c3376b7e1f3 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobContainersImpl.java @@ -0,0 +1,189 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainers; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ListContainerItem; +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainer; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LegalHold; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LeaseContainerResponse; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ImmutabilityPolicy; + +class BlobContainersImpl extends WrapperImpl implements BlobContainers { + private final StorageManager manager; + + BlobContainersImpl(StorageManager manager) { + super(manager.inner().blobContainers()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public BlobContainerImpl defineContainer(String name) { + return wrapContainerModel(name); + } + + @Override + public ImmutabilityPolicyImpl defineImmutabilityPolicy(String name) { + return wrapImmutabilityPolicyModel(name); + } + + private BlobContainerImpl wrapContainerModel(String name) { + return new BlobContainerImpl(name, this.manager()); + } + + private ImmutabilityPolicyImpl wrapImmutabilityPolicyModel(String name) { + return new ImmutabilityPolicyImpl(name, this.manager()); + } + + private BlobContainerImpl wrapBlobContainerModel(BlobContainerInner inner) { + return new BlobContainerImpl(inner, manager()); + } + + private ImmutabilityPolicyImpl wrapImmutabilityPolicyModel(ImmutabilityPolicyInner inner) { + return new ImmutabilityPolicyImpl(inner, manager()); + } + + private Observable getImmutabilityPolicyInnerUsingBlobContainersInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String accountName = IdParsingUtils.getValueFromIdByName(id, "storageAccounts"); + String containerName = IdParsingUtils.getValueFromIdByName(id, "containers"); + BlobContainersInner client = this.inner(); + return client.getImmutabilityPolicyAsync(resourceGroupName, accountName, containerName); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + BlobContainersInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ListContainerItem call(ListContainerItemInner inner) { + return new ListContainerItemImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String containerName) { + BlobContainersInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, containerName) + .map(new Func1() { + @Override + public BlobContainer call(BlobContainerInner inner) { + return new BlobContainerImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String containerName) { + BlobContainersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, containerName).toCompletable(); + } + + @Override + public Observable setLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags) { + BlobContainersInner client = this.inner(); + return client.setLegalHoldAsync(resourceGroupName, accountName, containerName, tags) + .map(new Func1() { + @Override + public LegalHold call(LegalHoldInner inner) { + return new LegalHoldImpl(inner, manager()); + } + }); + } + + @Override + public Observable clearLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List tags) { + BlobContainersInner client = this.inner(); + return client.clearLegalHoldAsync(resourceGroupName, accountName, containerName, tags) + .map(new Func1() { + @Override + public LegalHold call(LegalHoldInner inner) { + return new LegalHoldImpl(inner, manager()); + } + }); + } + + @Override + public Observable leaseAsync(String resourceGroupName, String accountName, String containerName) { + BlobContainersInner client = this.inner(); + return client.leaseAsync(resourceGroupName, accountName, containerName) + .map(new Func1() { + @Override + public LeaseContainerResponse call(LeaseContainerResponseInner inner) { + return new LeaseContainerResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable getImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName) { + BlobContainersInner client = this.inner(); + return client.getImmutabilityPolicyAsync(resourceGroupName, accountName, containerName) + .flatMap(new Func1>() { + @Override + public Observable call(ImmutabilityPolicyInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ImmutabilityPolicy)wrapImmutabilityPolicyModel(inner)); + } + } + }); + } + + @Override + public Completable deleteImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch) { + BlobContainersInner client = this.inner(); + return client.deleteImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch).toCompletable(); + } + + @Override + public Observable lockImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch) { + BlobContainersInner client = this.inner(); + return client.lockImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch) + .map(new Func1() { + @Override + public ImmutabilityPolicy call(ImmutabilityPolicyInner inner) { + return new ImmutabilityPolicyImpl(inner, manager()); + } + }); + } + + @Override + public Observable extendImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch) { + BlobContainersInner client = this.inner(); + return client.extendImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch) + .map(new Func1() { + @Override + public ImmutabilityPolicy call(ImmutabilityPolicyInner inner) { + return new ImmutabilityPolicyImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobContainersInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobContainersInner.java new file mode 100644 index 0000000000000..2efa4df6d0a04 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobContainersInner.java @@ -0,0 +1,2084 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainersCreateOrUpdateImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainersDeleteImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainersExtendImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainersGetImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainersLockImmutabilityPolicyHeaders; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LeaseContainerRequest; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ListContainersInclude; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BlobContainers. + */ +public class BlobContainersInner { + /** The Retrofit service to perform REST calls. */ + private BlobContainersService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of BlobContainersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BlobContainersInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(BlobContainersService.class); + this.client = client; + } + + /** + * The interface defining all the services for BlobContainers to be + * used by Retrofit to perform actually REST calls. + */ + interface BlobContainersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainers list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$maxpagesize") String maxpagesize, @Query("$filter") String filter, @Query("$include") ListContainersInclude include, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.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, @Body BlobContainerInner blobContainer, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.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, @Body BlobContainerInner blobContainer, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainers get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainers delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainers setLegalHold" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold") + Observable> setLegalHold(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LegalHoldInner legalHold, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainers clearLegalHold" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold") + Observable> clearLegalHold(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LegalHoldInner legalHold, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainers createOrUpdateImmutabilityPolicy" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}") + Observable> createOrUpdateImmutabilityPolicy(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("immutabilityPolicyName") String immutabilityPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Header("accept-language") String acceptLanguage, @Body ImmutabilityPolicyInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainers getImmutabilityPolicy" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}") + Observable> getImmutabilityPolicy(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("immutabilityPolicyName") String immutabilityPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainers deleteImmutabilityPolicy" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}", method = "DELETE", hasBody = true) + Observable> deleteImmutabilityPolicy(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("immutabilityPolicyName") String immutabilityPolicyName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainers lockImmutabilityPolicy" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock") + Observable> lockImmutabilityPolicy(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainers extendImmutabilityPolicy" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend") + Observable> extendImmutabilityPolicy(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Header("accept-language") String acceptLanguage, @Body ImmutabilityPolicyInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainers lease" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease") + Observable> lease(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("containerName") String containerName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body LeaseContainerRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainers listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ListContainerItemInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ListContainerItemInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ListContainerItemInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ListContainerItemInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String maxpagesize = null; + final String filter = null; + final ListContainersInclude include = null; + return service.list(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), maxpagesize, filter, include, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @param include Optional, used to include the properties for soft deleted blob containers. Possible values include: 'deleted' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ListContainerItemInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListContainersInclude include) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @param include Optional, used to include the properties for soft deleted blob containers. Possible values include: 'deleted' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListContainersInclude include, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @param include Optional, used to include the properties for soft deleted blob containers. Possible values include: 'deleted' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ListContainerItemInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListContainersInclude include) { + return listWithServiceResponseAsync(resourceGroupName, accountName, maxpagesize, filter, include) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @param include Optional, used to include the properties for soft deleted blob containers. Possible values include: 'deleted' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ListContainerItemInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListContainersInclude include) { + return listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + ServiceResponse> * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ServiceResponse> * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + ServiceResponse> * @param filter Optional. When specified, only container names starting with the filter will be listed. + ServiceResponse> * @param include Optional, used to include the properties for soft deleted blob containers. Possible values include: 'deleted' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ListContainerItemInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListContainersInclude include) { + 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(), maxpagesize, filter, include, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties of the blob container to create. + * @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, BlobContainerInner blobContainer) { + return createWithServiceResponseAsync(resourceGroupName, accountName, containerName, blobContainer).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 blobContainer Properties of the blob container to create. + * @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, BlobContainerInner blobContainer, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, containerName, blobContainer), 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 blobContainer Properties of the blob container to create. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer) { + return createWithServiceResponseAsync(resourceGroupName, accountName, containerName, blobContainer).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 blobContainer Properties of the blob container to create. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer) { + 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 (blobContainer == null) { + throw new IllegalArgumentException("Parameter blobContainer 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(blobContainer); + return service.create(resourceGroupName, accountName, containerName, this.client.subscriptionId(), blobContainer, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties to update for the blob container. + * @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, BlobContainerInner blobContainer) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, containerName, blobContainer).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 blobContainer Properties to update for the blob container. + * @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, BlobContainerInner blobContainer, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, containerName, blobContainer), 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 blobContainer Properties to update for the blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, containerName, blobContainer).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 blobContainer Properties to update for the blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobContainerInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer) { + 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 (blobContainer == null) { + throw new IllegalArgumentException("Parameter blobContainer 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(blobContainer); + return service.update(resourceGroupName, accountName, containerName, this.client.subscriptionId(), blobContainer, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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. + * @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) { + return createOrUpdateImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName).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 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, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createOrUpdateImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName), 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable createOrUpdateImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName) { + return createOrUpdateImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName).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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable> createOrUpdateImmutabilityPolicyWithServiceResponseAsync(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; + final Integer immutabilityPeriodSinceCreationInDays = null; + final Boolean allowProtectedAppendWrites = null; + ImmutabilityPolicyInner parameters = new ImmutabilityPolicyInner(); + parameters.withImmutabilityPeriodSinceCreationInDays(null); + parameters.withAllowProtectedAppendWrites(null); + 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 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 allowProtectedAppendWrites This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API + * @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, String ifMatch, Integer immutabilityPeriodSinceCreationInDays, Boolean allowProtectedAppendWrites) { + return createOrUpdateImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays, allowProtectedAppendWrites).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 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 allowProtectedAppendWrites This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API + * @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, String ifMatch, Integer immutabilityPeriodSinceCreationInDays, Boolean allowProtectedAppendWrites, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createOrUpdateImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays, allowProtectedAppendWrites), 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 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 allowProtectedAppendWrites This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable createOrUpdateImmutabilityPolicyAsync(String resourceGroupName, String accountName, String containerName, String ifMatch, Integer immutabilityPeriodSinceCreationInDays, Boolean allowProtectedAppendWrites) { + return createOrUpdateImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays, allowProtectedAppendWrites).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 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 allowProtectedAppendWrites This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImmutabilityPolicyInner object + */ + public Observable> createOrUpdateImmutabilityPolicyWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, String ifMatch, Integer immutabilityPeriodSinceCreationInDays, Boolean allowProtectedAppendWrites) { + 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 = null; + if (immutabilityPeriodSinceCreationInDays != null || allowProtectedAppendWrites != null) { + parameters = new ImmutabilityPolicyInner(); + parameters.withImmutabilityPeriodSinceCreationInDays(immutabilityPeriodSinceCreationInDays); + parameters.withAllowProtectedAppendWrites(allowProtectedAppendWrites); + } + 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, the only way is to delete the container after deleting all expired blobs inside the policy locked 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, the only way is to delete the container after deleting all expired blobs inside the policy locked 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, the only way is to delete the container after deleting all expired blobs inside the policy locked 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, the only way is to delete the container after deleting all expired blobs inside the policy locked 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. + * @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) { + return extendImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch).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 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, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(extendImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch), 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. + * @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) { + return extendImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch).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. + * @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) { + 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 Integer immutabilityPeriodSinceCreationInDays = null; + final Boolean allowProtectedAppendWrites = null; + ImmutabilityPolicyInner parameters = new ImmutabilityPolicyInner(); + parameters.withImmutabilityPeriodSinceCreationInDays(null); + parameters.withAllowProtectedAppendWrites(null); + 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); + } + } + }); + } + + /** + * 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 allowProtectedAppendWrites This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API + * @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, Integer immutabilityPeriodSinceCreationInDays, Boolean allowProtectedAppendWrites) { + return extendImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays, allowProtectedAppendWrites).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 allowProtectedAppendWrites This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API + * @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, Integer immutabilityPeriodSinceCreationInDays, Boolean allowProtectedAppendWrites, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(extendImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays, allowProtectedAppendWrites), 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. + * @param allowProtectedAppendWrites This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API + * @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, Integer immutabilityPeriodSinceCreationInDays, Boolean allowProtectedAppendWrites) { + return extendImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, ifMatch, immutabilityPeriodSinceCreationInDays, allowProtectedAppendWrites).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. + * @param allowProtectedAppendWrites This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API + * @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, Integer immutabilityPeriodSinceCreationInDays, Boolean allowProtectedAppendWrites) { + 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 = null; + if (immutabilityPeriodSinceCreationInDays != null || allowProtectedAppendWrites != null) { + parameters = new ImmutabilityPolicyInner(); + parameters.withImmutabilityPeriodSinceCreationInDays(immutabilityPeriodSinceCreationInDays); + parameters.withAllowProtectedAppendWrites(allowProtectedAppendWrites); + } + return service.extendImmutabilityPolicy(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = extendImmutabilityPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders extendImmutabilityPolicyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, BlobContainersExtendImmutabilityPolicyHeaders.class); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LeaseContainerResponseInner object if successful. + */ + public LeaseContainerResponseInner lease(String resourceGroupName, String accountName, String containerName) { + return leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName).toBlocking().single().body(); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture leaseAsync(String resourceGroupName, String accountName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName), serviceCallback); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LeaseContainerResponseInner object + */ + public Observable leaseAsync(String resourceGroupName, String accountName, String containerName) { + return leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName).map(new Func1, LeaseContainerResponseInner>() { + @Override + public LeaseContainerResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LeaseContainerResponseInner object + */ + public Observable> leaseWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final LeaseContainerRequest parameters = null; + return service.lease(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = leaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LeaseContainerResponseInner object if successful. + */ + public LeaseContainerResponseInner lease(String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters) { + return leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName, parameters).toBlocking().single().body(); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture leaseAsync(String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName, parameters), serviceCallback); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LeaseContainerResponseInner object + */ + public Observable leaseAsync(String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters) { + return leaseWithServiceResponseAsync(resourceGroupName, accountName, containerName, parameters).map(new Func1, LeaseContainerResponseInner>() { + @Override + public LeaseContainerResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LeaseContainerResponseInner object + */ + public Observable> leaseWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.lease(resourceGroupName, accountName, containerName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = leaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse leaseDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ListContainerItemInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ListContainerItemInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ListContainerItemInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ListContainerItemInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobRestoreStatusImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobRestoreStatusImpl.java new file mode 100644 index 0000000000000..374d13a72e1c7 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobRestoreStatusImpl.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobRestoreStatus; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobRestoreParameters; +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobRestoreProgressStatus; + +class BlobRestoreStatusImpl extends WrapperImpl implements BlobRestoreStatus { + private final StorageManager manager; + BlobRestoreStatusImpl(BlobRestoreStatusInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String failureReason() { + return this.inner().failureReason(); + } + + @Override + public BlobRestoreParameters parameters() { + return this.inner().parameters(); + } + + @Override + public String restoreId() { + return this.inner().restoreId(); + } + + @Override + public BlobRestoreProgressStatus status() { + return this.inner().status(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobRestoreStatusInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobRestoreStatusInner.java new file mode 100644 index 0000000000000..1c067476ed270 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobRestoreStatusInner.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobRestoreProgressStatus; +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobRestoreParameters; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Blob restore status. + */ +public class BlobRestoreStatusInner { + /** + * The status of blob restore progress. Possible values are: - InProgress: + * Indicates that blob restore is ongoing. - Complete: Indicates that blob + * restore has been completed successfully. - Failed: Indicates that blob + * restore is failed. Possible values include: 'InProgress', 'Complete', + * 'Failed'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private BlobRestoreProgressStatus status; + + /** + * Failure reason when blob restore is failed. + */ + @JsonProperty(value = "failureReason", access = JsonProperty.Access.WRITE_ONLY) + private String failureReason; + + /** + * Id for tracking blob restore request. + */ + @JsonProperty(value = "restoreId", access = JsonProperty.Access.WRITE_ONLY) + private String restoreId; + + /** + * Blob restore request parameters. + */ + @JsonProperty(value = "parameters", access = JsonProperty.Access.WRITE_ONLY) + private BlobRestoreParameters parameters; + + /** + * Get the status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - Complete: Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is failed. Possible values include: 'InProgress', 'Complete', 'Failed'. + * + * @return the status value + */ + public BlobRestoreProgressStatus status() { + return this.status; + } + + /** + * Get failure reason when blob restore is failed. + * + * @return the failureReason value + */ + public String failureReason() { + return this.failureReason; + } + + /** + * Get id for tracking blob restore request. + * + * @return the restoreId value + */ + public String restoreId() { + return this.restoreId; + } + + /** + * Get blob restore request parameters. + * + * @return the parameters value + */ + public BlobRestoreParameters parameters() { + return this.parameters; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobServicePropertiesImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobServicePropertiesImpl.java new file mode 100644 index 0000000000000..9b4eb8aa3f88c --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobServicePropertiesImpl.java @@ -0,0 +1,189 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobServiceProperties; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.CorsRules; +import com.microsoft.azure.management.storage.v2019_08_01_preview.DeleteRetentionPolicy; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ChangeFeed; +import com.microsoft.azure.management.storage.v2019_08_01_preview.RestorePolicyProperties; + +class BlobServicePropertiesImpl extends CreatableUpdatableImpl implements BlobServiceProperties, BlobServiceProperties.Definition, BlobServiceProperties.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + + BlobServicePropertiesImpl(String name, StorageManager manager) { + super(name, new BlobServicePropertiesInner()); + this.manager = manager; + // Set resource name + this.accountName = name; + // + } + + BlobServicePropertiesImpl(BlobServicePropertiesInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.accountName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + // + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + BlobServicesInner client = this.manager().inner().blobServices(); + return client.setServicePropertiesAsync(this.resourceGroupName, this.accountName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + BlobServicesInner client = this.manager().inner().blobServices(); + return client.setServicePropertiesAsync(this.resourceGroupName, this.accountName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + BlobServicesInner client = this.manager().inner().blobServices(); + return client.getServicePropertiesAsync(this.resourceGroupName, this.accountName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean automaticSnapshotPolicyEnabled() { + return this.inner().automaticSnapshotPolicyEnabled(); + } + + @Override + public ChangeFeed changeFeed() { + return this.inner().changeFeed(); + } + + @Override + public DeleteRetentionPolicy containerDeleteRetentionPolicy() { + return this.inner().containerDeleteRetentionPolicy(); + } + + @Override + public CorsRules cors() { + return this.inner().cors(); + } + + @Override + public String defaultServiceVersion() { + return this.inner().defaultServiceVersion(); + } + + @Override + public DeleteRetentionPolicy deleteRetentionPolicy() { + return this.inner().deleteRetentionPolicy(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Boolean isVersioningEnabled() { + return this.inner().isVersioningEnabled(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public RestorePolicyProperties restorePolicy() { + return this.inner().restorePolicy(); + } + + @Override + public SkuInner sku() { + return this.inner().sku(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public BlobServicePropertiesImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public BlobServicePropertiesImpl withAutomaticSnapshotPolicyEnabled(Boolean automaticSnapshotPolicyEnabled) { + this.inner().withAutomaticSnapshotPolicyEnabled(automaticSnapshotPolicyEnabled); + return this; + } + + @Override + public BlobServicePropertiesImpl withChangeFeed(ChangeFeed changeFeed) { + this.inner().withChangeFeed(changeFeed); + return this; + } + + @Override + public BlobServicePropertiesImpl withContainerDeleteRetentionPolicy(DeleteRetentionPolicy containerDeleteRetentionPolicy) { + this.inner().withContainerDeleteRetentionPolicy(containerDeleteRetentionPolicy); + return this; + } + + @Override + public BlobServicePropertiesImpl withCors(CorsRules cors) { + this.inner().withCors(cors); + return this; + } + + @Override + public BlobServicePropertiesImpl withDefaultServiceVersion(String defaultServiceVersion) { + this.inner().withDefaultServiceVersion(defaultServiceVersion); + return this; + } + + @Override + public BlobServicePropertiesImpl withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy) { + this.inner().withDeleteRetentionPolicy(deleteRetentionPolicy); + return this; + } + + @Override + public BlobServicePropertiesImpl withIsVersioningEnabled(Boolean isVersioningEnabled) { + this.inner().withIsVersioningEnabled(isVersioningEnabled); + return this; + } + + @Override + public BlobServicePropertiesImpl withRestorePolicy(RestorePolicyProperties restorePolicy) { + this.inner().withRestorePolicy(restorePolicy); + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobServicePropertiesInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobServicePropertiesInner.java new file mode 100644 index 0000000000000..83f8d01120afe --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobServicePropertiesInner.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.CorsRules; +import com.microsoft.azure.management.storage.v2019_08_01_preview.DeleteRetentionPolicy; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ChangeFeed; +import com.microsoft.azure.management.storage.v2019_08_01_preview.RestorePolicyProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The properties of a storage account’s Blob service. + */ +@JsonFlatten +public class BlobServicePropertiesInner extends ProxyResource { + /** + * Specifies CORS rules for the Blob service. You can include up to five + * CorsRule elements in the request. If no CorsRule elements are included + * in the request body, all CORS rules will be deleted, and CORS will be + * disabled for the Blob service. + */ + @JsonProperty(value = "properties.cors") + private CorsRules cors; + + /** + * DefaultServiceVersion indicates the default version to use for requests + * to the Blob service if an incoming request’s version is not specified. + * Possible values include version 2008-10-27 and all more recent versions. + */ + @JsonProperty(value = "properties.defaultServiceVersion") + private String defaultServiceVersion; + + /** + * The blob service properties for blob soft delete. + */ + @JsonProperty(value = "properties.deleteRetentionPolicy") + private DeleteRetentionPolicy deleteRetentionPolicy; + + /** + * Versioning is enabled if set to true. + */ + @JsonProperty(value = "properties.isVersioningEnabled") + private Boolean isVersioningEnabled; + + /** + * Deprecated in favor of isVersioningEnabled property. + */ + @JsonProperty(value = "properties.automaticSnapshotPolicyEnabled") + private Boolean automaticSnapshotPolicyEnabled; + + /** + * The blob service properties for change feed events. + */ + @JsonProperty(value = "properties.changeFeed") + private ChangeFeed changeFeed; + + /** + * The blob service properties for blob restore policy. + */ + @JsonProperty(value = "properties.restorePolicy") + private RestorePolicyProperties restorePolicy; + + /** + * The blob service properties for container soft delete. + */ + @JsonProperty(value = "properties.containerDeleteRetentionPolicy") + private DeleteRetentionPolicy containerDeleteRetentionPolicy; + + /** + * Sku name and tier. + */ + @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) + private SkuInner sku; + + /** + * Get specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service. + * + * @return the cors value + */ + public CorsRules cors() { + return this.cors; + } + + /** + * Set specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service. + * + * @param cors the cors value to set + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withCors(CorsRules cors) { + this.cors = cors; + return this; + } + + /** + * Get defaultServiceVersion indicates the default version to use for requests to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 and all more recent versions. + * + * @return the defaultServiceVersion value + */ + public String defaultServiceVersion() { + return this.defaultServiceVersion; + } + + /** + * Set defaultServiceVersion indicates the default version to use for requests to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 and all more recent versions. + * + * @param defaultServiceVersion the defaultServiceVersion value to set + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withDefaultServiceVersion(String defaultServiceVersion) { + this.defaultServiceVersion = defaultServiceVersion; + return this; + } + + /** + * Get the blob service properties for blob soft delete. + * + * @return the deleteRetentionPolicy value + */ + public DeleteRetentionPolicy deleteRetentionPolicy() { + return this.deleteRetentionPolicy; + } + + /** + * Set the blob service properties for blob soft delete. + * + * @param deleteRetentionPolicy the deleteRetentionPolicy value to set + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy) { + this.deleteRetentionPolicy = deleteRetentionPolicy; + return this; + } + + /** + * Get versioning is enabled if set to true. + * + * @return the isVersioningEnabled value + */ + public Boolean isVersioningEnabled() { + return this.isVersioningEnabled; + } + + /** + * Set versioning is enabled if set to true. + * + * @param isVersioningEnabled the isVersioningEnabled value to set + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withIsVersioningEnabled(Boolean isVersioningEnabled) { + this.isVersioningEnabled = isVersioningEnabled; + return this; + } + + /** + * Get deprecated in favor of isVersioningEnabled property. + * + * @return the automaticSnapshotPolicyEnabled value + */ + public Boolean automaticSnapshotPolicyEnabled() { + return this.automaticSnapshotPolicyEnabled; + } + + /** + * Set deprecated in favor of isVersioningEnabled property. + * + * @param automaticSnapshotPolicyEnabled the automaticSnapshotPolicyEnabled value to set + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withAutomaticSnapshotPolicyEnabled(Boolean automaticSnapshotPolicyEnabled) { + this.automaticSnapshotPolicyEnabled = automaticSnapshotPolicyEnabled; + return this; + } + + /** + * Get the blob service properties for change feed events. + * + * @return the changeFeed value + */ + public ChangeFeed changeFeed() { + return this.changeFeed; + } + + /** + * Set the blob service properties for change feed events. + * + * @param changeFeed the changeFeed value to set + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withChangeFeed(ChangeFeed changeFeed) { + this.changeFeed = changeFeed; + return this; + } + + /** + * Get the blob service properties for blob restore policy. + * + * @return the restorePolicy value + */ + public RestorePolicyProperties restorePolicy() { + return this.restorePolicy; + } + + /** + * Set the blob service properties for blob restore policy. + * + * @param restorePolicy the restorePolicy value to set + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withRestorePolicy(RestorePolicyProperties restorePolicy) { + this.restorePolicy = restorePolicy; + return this; + } + + /** + * Get the blob service properties for container soft delete. + * + * @return the containerDeleteRetentionPolicy value + */ + public DeleteRetentionPolicy containerDeleteRetentionPolicy() { + return this.containerDeleteRetentionPolicy; + } + + /** + * Set the blob service properties for container soft delete. + * + * @param containerDeleteRetentionPolicy the containerDeleteRetentionPolicy value to set + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withContainerDeleteRetentionPolicy(DeleteRetentionPolicy containerDeleteRetentionPolicy) { + this.containerDeleteRetentionPolicy = containerDeleteRetentionPolicy; + return this; + } + + /** + * Get sku name and tier. + * + * @return the sku value + */ + public SkuInner sku() { + return this.sku; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobServicesImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobServicesImpl.java new file mode 100644 index 0000000000000..16f2faf67de64 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobServicesImpl.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobServices; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobServiceProperties; + +class BlobServicesImpl extends WrapperImpl implements BlobServices { + private final StorageManager manager; + + BlobServicesImpl(StorageManager manager) { + super(manager.inner().blobServices()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public BlobServicePropertiesImpl define(String name) { + return wrapModel(name); + } + + private BlobServicePropertiesImpl wrapModel(BlobServicePropertiesInner inner) { + return new BlobServicePropertiesImpl(inner, manager()); + } + + private BlobServicePropertiesImpl wrapModel(String name) { + return new BlobServicePropertiesImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName) { + BlobServicesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public BlobServiceProperties call(BlobServicePropertiesInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getServicePropertiesAsync(String resourceGroupName, String accountName) { + BlobServicesInner client = this.inner(); + return client.getServicePropertiesAsync(resourceGroupName, accountName) + .flatMap(new Func1>() { + @Override + public Observable call(BlobServicePropertiesInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((BlobServiceProperties)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobServicesInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobServicesInner.java new file mode 100644 index 0000000000000..944f2a52edfcc --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/BlobServicesInner.java @@ -0,0 +1,345 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BlobServices. + */ +public class BlobServicesInner { + /** The Retrofit service to perform REST calls. */ + private BlobServicesService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of BlobServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BlobServicesInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(BlobServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for BlobServices to be + * used by Retrofit to perform actually REST calls. + */ + interface BlobServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.BlobServices list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices") + 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.v2019_08_01_preview.BlobServices setServiceProperties" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}") + Observable> setServiceProperties(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("BlobServicesName") String blobServicesName, @Query("api-version") String apiVersion, @Body BlobServicePropertiesInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.BlobServices getServiceProperties" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}") + Observable> getServiceProperties(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("BlobServicesName") String blobServicesName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within 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 List<BlobServicePropertiesInner> object if successful. + */ + public List list(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the 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); + } + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within 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 List<BlobServicePropertiesInner> object + */ + public Observable> listAsync(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within 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 List<BlobServicePropertiesInner> 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> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BlobServicePropertiesInner object if successful. + */ + public BlobServicePropertiesInner setServiceProperties(String resourceGroupName, String accountName, BlobServicePropertiesInner parameters) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setServicePropertiesAsync(String resourceGroupName, String accountName, BlobServicePropertiesInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobServicePropertiesInner object + */ + public Observable setServicePropertiesAsync(String resourceGroupName, String accountName, BlobServicePropertiesInner parameters) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, BlobServicePropertiesInner>() { + @Override + public BlobServicePropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobServicePropertiesInner object + */ + public Observable> setServicePropertiesWithServiceResponseAsync(String resourceGroupName, String accountName, BlobServicePropertiesInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String blobServicesName = "default"; + return service.setServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), blobServicesName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setServicePropertiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse setServicePropertiesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BlobServicePropertiesInner object if successful. + */ + public BlobServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) { + return getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServicePropertiesAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobServicePropertiesInner object + */ + public Observable getServicePropertiesAsync(String resourceGroupName, String accountName) { + return getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, BlobServicePropertiesInner>() { + @Override + public BlobServicePropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobServicePropertiesInner object + */ + public Observable> getServicePropertiesWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String blobServicesName = "default"; + return service.getServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), blobServicesName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServicePropertiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getServicePropertiesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/CheckNameAvailabilityResultImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/CheckNameAvailabilityResultImpl.java new file mode 100644 index 0000000000000..203999e3d5480 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/CheckNameAvailabilityResultImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.CheckNameAvailabilityResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Reason; + +class CheckNameAvailabilityResultImpl extends WrapperImpl implements CheckNameAvailabilityResult { + private final StorageManager manager; + CheckNameAvailabilityResultImpl(CheckNameAvailabilityResultInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public Reason reason() { + return this.inner().reason(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/CheckNameAvailabilityResultInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/CheckNameAvailabilityResultInner.java new file mode 100644 index 0000000000000..5683a11ba2a8a --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/CheckNameAvailabilityResultInner.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.Reason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CheckNameAvailability operation response. + */ +public class CheckNameAvailabilityResultInner { + /** + * Gets a boolean value that indicates whether the name is available for + * you to use. If true, the name is available. If false, the name has + * already been taken or is invalid and cannot be used. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /** + * Gets the reason that a storage account name could not be used. The + * Reason element is only returned if NameAvailable is false. Possible + * values include: 'AccountNameInvalid', 'AlreadyExists'. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private Reason reason; + + /** + * Gets an error message explaining the Reason value in more detail. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'AccountNameInvalid', 'AlreadyExists'. + * + * @return the reason value + */ + public Reason reason() { + return this.reason; + } + + /** + * Get gets an error message explaining the Reason value in more detail. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/DeletedAccountImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/DeletedAccountImpl.java new file mode 100644 index 0000000000000..20f8a80839f13 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/DeletedAccountImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.DeletedAccount; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; + +class DeletedAccountImpl extends IndexableRefreshableWrapperImpl implements DeletedAccount { + private final StorageManager manager; + private String deletedAccountName; + private String location; + + DeletedAccountImpl(DeletedAccountInner inner, StorageManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.deletedAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "deletedAccounts"); + this.location = IdParsingUtils.getValueFromIdByName(inner.id(), "locations"); + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + DeletedAccountsInner client = this.manager().inner().deletedAccounts(); + return client.getAsync(this.deletedAccountName, this.location); + } + + + + @Override + public String creationTime() { + return this.inner().creationTime(); + } + + @Override + public String deletionTime() { + return this.inner().deletionTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String restoreReference() { + return this.inner().restoreReference(); + } + + @Override + public String storageAccountResourceId() { + return this.inner().storageAccountResourceId(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/DeletedAccountInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/DeletedAccountInner.java new file mode 100644 index 0000000000000..9a47d5c6b8747 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/DeletedAccountInner.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Deleted storage account. + */ +@JsonFlatten +public class DeletedAccountInner extends ProxyResource { + /** + * Full resource id of the original storage account. + */ + @JsonProperty(value = "properties.storageAccountResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String storageAccountResourceId; + + /** + * Location of the deleted account. + */ + @JsonProperty(value = "properties.location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * Can be used to attempt recovering this deleted account via + * PutStorageAccount API. + */ + @JsonProperty(value = "properties.restoreReference", access = JsonProperty.Access.WRITE_ONLY) + private String restoreReference; + + /** + * Creation time of the deleted account. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private String creationTime; + + /** + * Deletion time of the deleted account. + */ + @JsonProperty(value = "properties.deletionTime", access = JsonProperty.Access.WRITE_ONLY) + private String deletionTime; + + /** + * Get full resource id of the original storage account. + * + * @return the storageAccountResourceId value + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Get location of the deleted account. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Get can be used to attempt recovering this deleted account via PutStorageAccount API. + * + * @return the restoreReference value + */ + public String restoreReference() { + return this.restoreReference; + } + + /** + * Get creation time of the deleted account. + * + * @return the creationTime value + */ + public String creationTime() { + return this.creationTime; + } + + /** + * Get deletion time of the deleted account. + * + * @return the deletionTime value + */ + public String deletionTime() { + return this.deletionTime; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/DeletedAccountsImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/DeletedAccountsImpl.java new file mode 100644 index 0000000000000..925bcb0b78d5c --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/DeletedAccountsImpl.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.DeletedAccounts; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.storage.v2019_08_01_preview.DeletedAccount; + +class DeletedAccountsImpl extends WrapperImpl implements DeletedAccounts { + private final StorageManager manager; + + DeletedAccountsImpl(StorageManager manager) { + super(manager.inner().deletedAccounts()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + private DeletedAccountImpl wrapModel(DeletedAccountInner inner) { + return new DeletedAccountImpl(inner, manager()); + } + + @Override + public Observable listAsync() { + DeletedAccountsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DeletedAccount call(DeletedAccountInner inner) { + return new DeletedAccountImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String deletedAccountName, String location) { + DeletedAccountsInner client = this.inner(); + return client.getAsync(deletedAccountName, location) + .flatMap(new Func1>() { + @Override + public Observable call(DeletedAccountInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DeletedAccount)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/DeletedAccountsInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/DeletedAccountsInner.java new file mode 100644 index 0000000000000..dcb14fd1ecc4e --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/DeletedAccountsInner.java @@ -0,0 +1,378 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DeletedAccounts. + */ +public class DeletedAccountsInner { + /** The Retrofit service to perform REST calls. */ + private DeletedAccountsService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of DeletedAccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DeletedAccountsInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(DeletedAccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for DeletedAccounts to be + * used by Retrofit to perform actually REST calls. + */ + interface DeletedAccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.DeletedAccounts list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Storage/deletedAccounts") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.DeletedAccounts get" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName}") + Observable> get(@Path("deletedAccountName") String deletedAccountName, @Path("location") String location, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.DeletedAccounts listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists deleted accounts under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedAccountInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists deleted accounts under the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists deleted accounts under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedAccountInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists deleted accounts under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedAccountInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists deleted accounts under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeletedAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DeletedAccountInner object if successful. + */ + public DeletedAccountInner get(String deletedAccountName, String location) { + return getWithServiceResponseAsync(deletedAccountName, location).toBlocking().single().body(); + } + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String deletedAccountName, String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(deletedAccountName, location), serviceCallback); + } + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedAccountInner object + */ + public Observable getAsync(String deletedAccountName, String location) { + return getWithServiceResponseAsync(deletedAccountName, location).map(new Func1, DeletedAccountInner>() { + @Override + public DeletedAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DeletedAccountInner object + */ + public Observable> getWithServiceResponseAsync(String deletedAccountName, String location) { + if (deletedAccountName == null) { + throw new IllegalArgumentException("Parameter deletedAccountName is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location 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(deletedAccountName, location, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists deleted accounts under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DeletedAccountInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists deleted accounts under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists deleted accounts under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedAccountInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists deleted accounts under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedAccountInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists deleted accounts under the subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeletedAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/EncryptionScopeImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/EncryptionScopeImpl.java new file mode 100644 index 0000000000000..01c4b0fe75c44 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/EncryptionScopeImpl.java @@ -0,0 +1,141 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.EncryptionScope; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.EncryptionScopeSource; +import com.microsoft.azure.management.storage.v2019_08_01_preview.EncryptionScopeState; +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_08_01_preview.EncryptionScopeKeyVaultProperties; + +class EncryptionScopeImpl extends CreatableUpdatableImpl implements EncryptionScope, EncryptionScope.Definition, EncryptionScope.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private String encryptionScopeName; + + EncryptionScopeImpl(String name, StorageManager manager) { + super(name, new EncryptionScopeInner()); + this.manager = manager; + // Set resource name + this.encryptionScopeName = name; + // + } + + EncryptionScopeImpl(EncryptionScopeInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.encryptionScopeName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + this.encryptionScopeName = IdParsingUtils.getValueFromIdByName(inner.id(), "encryptionScopes"); + // + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + EncryptionScopesInner client = this.manager().inner().encryptionScopes(); + return client.putAsync(this.resourceGroupName, this.accountName, this.encryptionScopeName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + EncryptionScopesInner client = this.manager().inner().encryptionScopes(); + return client.patchAsync(this.resourceGroupName, this.accountName, this.encryptionScopeName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + EncryptionScopesInner client = this.manager().inner().encryptionScopes(); + return client.getAsync(this.resourceGroupName, this.accountName, this.encryptionScopeName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DateTime creationTime() { + return this.inner().creationTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public EncryptionScopeKeyVaultProperties keyVaultProperties() { + return this.inner().keyVaultProperties(); + } + + @Override + public DateTime lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public EncryptionScopeSource source() { + return this.inner().source(); + } + + @Override + public EncryptionScopeState state() { + return this.inner().state(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public EncryptionScopeImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public EncryptionScopeImpl withKeyVaultProperties(EncryptionScopeKeyVaultProperties keyVaultProperties) { + this.inner().withKeyVaultProperties(keyVaultProperties); + return this; + } + + @Override + public EncryptionScopeImpl withSource(EncryptionScopeSource source) { + this.inner().withSource(source); + return this; + } + + @Override + public EncryptionScopeImpl withState(EncryptionScopeState state) { + this.inner().withState(state); + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/EncryptionScopeInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/EncryptionScopeInner.java new file mode 100644 index 0000000000000..57bae1aef4cf9 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/EncryptionScopeInner.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.EncryptionScopeSource; +import com.microsoft.azure.management.storage.v2019_08_01_preview.EncryptionScopeState; +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_08_01_preview.EncryptionScopeKeyVaultProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The Encryption Scope resource. + */ +@JsonFlatten +public class EncryptionScopeInner extends ProxyResource { + /** + * The provider for the encryption scope. Possible values + * (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. Possible + * values include: 'Microsoft.Storage', 'Microsoft.KeyVault'. + */ + @JsonProperty(value = "properties.source") + private EncryptionScopeSource source; + + /** + * The state of the encryption scope. Possible values (case-insensitive): + * Enabled, Disabled. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.state") + private EncryptionScopeState state; + + /** + * Gets the creation date and time of the encryption scope in UTC. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationTime; + + /** + * Gets the last modification date and time of the encryption scope in UTC. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * The key vault properties for the encryption scope. This is a required + * field if encryption scope 'source' attribute is set to + * 'Microsoft.KeyVault'. + */ + @JsonProperty(value = "properties.keyVaultProperties") + private EncryptionScopeKeyVaultProperties keyVaultProperties; + + /** + * Get the provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. Possible values include: 'Microsoft.Storage', 'Microsoft.KeyVault'. + * + * @return the source value + */ + public EncryptionScopeSource source() { + return this.source; + } + + /** + * Set the provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. Possible values include: 'Microsoft.Storage', 'Microsoft.KeyVault'. + * + * @param source the source value to set + * @return the EncryptionScopeInner object itself. + */ + public EncryptionScopeInner withSource(EncryptionScopeSource source) { + this.source = source; + return this; + } + + /** + * Get the state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. Possible values include: 'Enabled', 'Disabled'. + * + * @return the state value + */ + public EncryptionScopeState state() { + return this.state; + } + + /** + * Set the state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. Possible values include: 'Enabled', 'Disabled'. + * + * @param state the state value to set + * @return the EncryptionScopeInner object itself. + */ + public EncryptionScopeInner withState(EncryptionScopeState state) { + this.state = state; + return this; + } + + /** + * Get gets the creation date and time of the encryption scope in UTC. + * + * @return the creationTime value + */ + public DateTime creationTime() { + return this.creationTime; + } + + /** + * Get gets the last modification date and time of the encryption scope in UTC. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + * + * @return the keyVaultProperties value + */ + public EncryptionScopeKeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + * + * @param keyVaultProperties the keyVaultProperties value to set + * @return the EncryptionScopeInner object itself. + */ + public EncryptionScopeInner withKeyVaultProperties(EncryptionScopeKeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/EncryptionScopesImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/EncryptionScopesImpl.java new file mode 100644 index 0000000000000..5d5a75dc0d7bd --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/EncryptionScopesImpl.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.EncryptionScopes; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.storage.v2019_08_01_preview.EncryptionScope; + +class EncryptionScopesImpl extends WrapperImpl implements EncryptionScopes { + private final StorageManager manager; + + EncryptionScopesImpl(StorageManager manager) { + super(manager.inner().encryptionScopes()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public EncryptionScopeImpl define(String name) { + return wrapModel(name); + } + + private EncryptionScopeImpl wrapModel(EncryptionScopeInner inner) { + return new EncryptionScopeImpl(inner, manager()); + } + + private EncryptionScopeImpl wrapModel(String name) { + return new EncryptionScopeImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + EncryptionScopesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public EncryptionScope call(EncryptionScopeInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String encryptionScopeName) { + EncryptionScopesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, encryptionScopeName) + .flatMap(new Func1>() { + @Override + public Observable call(EncryptionScopeInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((EncryptionScope)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/EncryptionScopesInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/EncryptionScopesInner.java new file mode 100644 index 0000000000000..b3d0bfb0ddc61 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/EncryptionScopesInner.java @@ -0,0 +1,617 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in EncryptionScopes. + */ +public class EncryptionScopesInner { + /** The Retrofit service to perform REST calls. */ + private EncryptionScopesService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of EncryptionScopesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public EncryptionScopesInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(EncryptionScopesService.class); + this.client = client; + } + + /** + * The interface defining all the services for EncryptionScopes to be + * used by Retrofit to perform actually REST calls. + */ + interface EncryptionScopesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.EncryptionScopes put" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}") + Observable> put(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("encryptionScopeName") String encryptionScopeName, @Query("api-version") String apiVersion, @Body EncryptionScopeInner encryptionScope, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.EncryptionScopes patch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}") + Observable> patch(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("encryptionScopeName") String encryptionScopeName, @Query("api-version") String apiVersion, @Body EncryptionScopeInner encryptionScope, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.EncryptionScopes get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("encryptionScopeName") String encryptionScopeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.EncryptionScopes list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes") + 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.v2019_08_01_preview.EncryptionScopes listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope is already created and a subsequent request is issued with different properties, the encryption scope properties will be updated per the specified 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 encryptionScopeName The name of the encryption scope within the specified storage account. Encryption scope 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 encryptionScope Encryption scope properties to be used for the create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EncryptionScopeInner object if successful. + */ + public EncryptionScopeInner put(String resourceGroupName, String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope) { + return putWithServiceResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope).toBlocking().single().body(); + } + + /** + * Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope is already created and a subsequent request is issued with different properties, the encryption scope properties will be updated per the specified 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 encryptionScopeName The name of the encryption scope within the specified storage account. Encryption scope 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 encryptionScope Encryption scope properties to be used for the create or update. + * @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 putAsync(String resourceGroupName, String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putWithServiceResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope), serviceCallback); + } + + /** + * Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope is already created and a subsequent request is issued with different properties, the encryption scope properties will be updated per the specified 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 encryptionScopeName The name of the encryption scope within the specified storage account. Encryption scope 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 encryptionScope Encryption scope properties to be used for the create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EncryptionScopeInner object + */ + public Observable putAsync(String resourceGroupName, String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope) { + return putWithServiceResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope).map(new Func1, EncryptionScopeInner>() { + @Override + public EncryptionScopeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope is already created and a subsequent request is issued with different properties, the encryption scope properties will be updated per the specified 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 encryptionScopeName The name of the encryption scope within the specified storage account. Encryption scope 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 encryptionScope Encryption scope properties to be used for the create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EncryptionScopeInner object + */ + public Observable> putWithServiceResponseAsync(String resourceGroupName, String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope) { + 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 (encryptionScopeName == null) { + throw new IllegalArgumentException("Parameter encryptionScopeName 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 (encryptionScope == null) { + throw new IllegalArgumentException("Parameter encryptionScope is required and cannot be null."); + } + Validator.validate(encryptionScope); + return service.put(resourceGroupName, accountName, this.client.subscriptionId(), encryptionScopeName, this.client.apiVersion(), encryptionScope, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does not 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 encryptionScopeName The name of the encryption scope within the specified storage account. Encryption scope 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 encryptionScope Encryption scope properties to be used for the update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EncryptionScopeInner object if successful. + */ + public EncryptionScopeInner patch(String resourceGroupName, String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope) { + return patchWithServiceResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope).toBlocking().single().body(); + } + + /** + * Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does not 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 encryptionScopeName The name of the encryption scope within the specified storage account. Encryption scope 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 encryptionScope Encryption scope properties to be used for the update. + * @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 patchAsync(String resourceGroupName, String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope), serviceCallback); + } + + /** + * Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does not 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 encryptionScopeName The name of the encryption scope within the specified storage account. Encryption scope 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 encryptionScope Encryption scope properties to be used for the update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EncryptionScopeInner object + */ + public Observable patchAsync(String resourceGroupName, String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope) { + return patchWithServiceResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope).map(new Func1, EncryptionScopeInner>() { + @Override + public EncryptionScopeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does not 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 encryptionScopeName The name of the encryption scope within the specified storage account. Encryption scope 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 encryptionScope Encryption scope properties to be used for the update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EncryptionScopeInner object + */ + public Observable> patchWithServiceResponseAsync(String resourceGroupName, String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope) { + 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 (encryptionScopeName == null) { + throw new IllegalArgumentException("Parameter encryptionScopeName 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 (encryptionScope == null) { + throw new IllegalArgumentException("Parameter encryptionScope is required and cannot be null."); + } + Validator.validate(encryptionScope); + return service.patch(resourceGroupName, accountName, this.client.subscriptionId(), encryptionScopeName, this.client.apiVersion(), encryptionScope, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse patchDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption scope 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EncryptionScopeInner object if successful. + */ + public EncryptionScopeInner get(String resourceGroupName, String accountName, String encryptionScopeName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, encryptionScopeName).toBlocking().single().body(); + } + + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption scope 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 encryptionScopeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, encryptionScopeName), serviceCallback); + } + + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption scope 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 EncryptionScopeInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String encryptionScopeName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, encryptionScopeName).map(new Func1, EncryptionScopeInner>() { + @Override + public EncryptionScopeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption scope 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 EncryptionScopeInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String encryptionScopeName) { + 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 (encryptionScopeName == null) { + throw new IllegalArgumentException("Parameter encryptionScopeName 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, this.client.subscriptionId(), encryptionScopeName, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the encryption scopes available under 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 PagedList<EncryptionScopeInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the encryption scopes available under 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> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the encryption scopes available under 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 PagedList<EncryptionScopeInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the encryption scopes available under 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 PagedList<EncryptionScopeInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + ServiceResponse> * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EncryptionScopeInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + 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> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EncryptionScopeInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EncryptionScopeInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EncryptionScopeInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EncryptionScopeInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileServiceItemsImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileServiceItemsImpl.java new file mode 100644 index 0000000000000..e8e0663c28169 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileServiceItemsImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.FileServiceItems; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class FileServiceItemsImpl extends WrapperImpl implements FileServiceItems { + private final StorageManager manager; + FileServiceItemsImpl(FileServiceItemsInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileServiceItemsInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileServiceItemsInner.java new file mode 100644 index 0000000000000..1a82ccc24ca85 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileServiceItemsInner.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The FileServiceItemsInner model. + */ +public class FileServiceItemsInner { + /** + * List of file services returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get list of file services returned. + * + * @return the value value + */ + public List value() { + return this.value; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileServicePropertiesImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileServicePropertiesImpl.java new file mode 100644 index 0000000000000..482e5bde4a729 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileServicePropertiesImpl.java @@ -0,0 +1,163 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.FileServiceProperties; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.CorsRules; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_08_01_preview.DeleteRetentionPolicy; +import rx.functions.Func1; + +class FileServicePropertiesImpl extends CreatableUpdatableImpl implements FileServiceProperties, FileServiceProperties.Definition, FileServiceProperties.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private CorsRules ccors; + private DeleteRetentionPolicy cshareDeleteRetentionPolicy; + private CorsRules ucors; + private DeleteRetentionPolicy ushareDeleteRetentionPolicy; + + FileServicePropertiesImpl(String name, StorageManager manager) { + super(name, new FileServicePropertiesInner()); + this.manager = manager; + // Set resource name + this.accountName = name; + // + this.ccors = new CorsRules(); + this.cshareDeleteRetentionPolicy = new DeleteRetentionPolicy(); + this.ucors = new CorsRules(); + this.ushareDeleteRetentionPolicy = new DeleteRetentionPolicy(); + } + + FileServicePropertiesImpl(FileServicePropertiesInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.accountName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + // + this.ccors = new CorsRules(); + this.cshareDeleteRetentionPolicy = new DeleteRetentionPolicy(); + this.ucors = new CorsRules(); + this.ushareDeleteRetentionPolicy = new DeleteRetentionPolicy(); + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + FileServicesInner client = this.manager().inner().fileServices(); + return client.setServicePropertiesAsync(this.resourceGroupName, this.accountName, this.ccors, this.cshareDeleteRetentionPolicy) + .map(new Func1() { + @Override + public FileServicePropertiesInner call(FileServicePropertiesInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + FileServicesInner client = this.manager().inner().fileServices(); + return client.setServicePropertiesAsync(this.resourceGroupName, this.accountName, this.ucors, this.ushareDeleteRetentionPolicy) + .map(new Func1() { + @Override + public FileServicePropertiesInner call(FileServicePropertiesInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + FileServicesInner client = this.manager().inner().fileServices(); + return client.getServicePropertiesAsync(this.resourceGroupName, this.accountName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.ccors = new CorsRules(); + this.cshareDeleteRetentionPolicy = new DeleteRetentionPolicy(); + this.ucors = new CorsRules(); + this.ushareDeleteRetentionPolicy = new DeleteRetentionPolicy(); + } + + @Override + public CorsRules cors() { + return this.inner().cors(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public DeleteRetentionPolicy shareDeleteRetentionPolicy() { + return this.inner().shareDeleteRetentionPolicy(); + } + + @Override + public SkuInner sku() { + return this.inner().sku(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public FileServicePropertiesImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public FileServicePropertiesImpl withCors(CorsRules cors) { + if (isInCreateMode()) { + this.ccors = cors; + } else { + this.ucors = cors; + } + return this; + } + + @Override + public FileServicePropertiesImpl withShareDeleteRetentionPolicy(DeleteRetentionPolicy shareDeleteRetentionPolicy) { + if (isInCreateMode()) { + this.cshareDeleteRetentionPolicy = shareDeleteRetentionPolicy; + } else { + this.ushareDeleteRetentionPolicy = shareDeleteRetentionPolicy; + } + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileServicePropertiesInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileServicePropertiesInner.java new file mode 100644 index 0000000000000..73f4c2943ecc8 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileServicePropertiesInner.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.CorsRules; +import com.microsoft.azure.management.storage.v2019_08_01_preview.DeleteRetentionPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The properties of File services in storage account. + */ +@JsonFlatten +public class FileServicePropertiesInner extends ProxyResource { + /** + * Specifies CORS rules for the File service. You can include up to five + * CorsRule elements in the request. If no CorsRule elements are included + * in the request body, all CORS rules will be deleted, and CORS will be + * disabled for the File service. + */ + @JsonProperty(value = "properties.cors") + private CorsRules cors; + + /** + * The file service properties for share soft delete. + */ + @JsonProperty(value = "properties.shareDeleteRetentionPolicy") + private DeleteRetentionPolicy shareDeleteRetentionPolicy; + + /** + * Sku name and tier. + */ + @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) + private SkuInner sku; + + /** + * Get specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the File service. + * + * @return the cors value + */ + public CorsRules cors() { + return this.cors; + } + + /** + * Set specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the File service. + * + * @param cors the cors value to set + * @return the FileServicePropertiesInner object itself. + */ + public FileServicePropertiesInner withCors(CorsRules cors) { + this.cors = cors; + return this; + } + + /** + * Get the file service properties for share soft delete. + * + * @return the shareDeleteRetentionPolicy value + */ + public DeleteRetentionPolicy shareDeleteRetentionPolicy() { + return this.shareDeleteRetentionPolicy; + } + + /** + * Set the file service properties for share soft delete. + * + * @param shareDeleteRetentionPolicy the shareDeleteRetentionPolicy value to set + * @return the FileServicePropertiesInner object itself. + */ + public FileServicePropertiesInner withShareDeleteRetentionPolicy(DeleteRetentionPolicy shareDeleteRetentionPolicy) { + this.shareDeleteRetentionPolicy = shareDeleteRetentionPolicy; + return this; + } + + /** + * Get sku name and tier. + * + * @return the sku value + */ + public SkuInner sku() { + return this.sku; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileServicesImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileServicesImpl.java new file mode 100644 index 0000000000000..516dafa2fcc40 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileServicesImpl.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.FileServices; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.storage.v2019_08_01_preview.FileServiceItems; +import com.microsoft.azure.management.storage.v2019_08_01_preview.FileServiceProperties; + +class FileServicesImpl extends WrapperImpl implements FileServices { + private final StorageManager manager; + + FileServicesImpl(StorageManager manager) { + super(manager.inner().fileServices()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public FileServicePropertiesImpl define(String name) { + return wrapModel(name); + } + + private FileServicePropertiesImpl wrapModel(FileServicePropertiesInner inner) { + return new FileServicePropertiesImpl(inner, manager()); + } + + private FileServicePropertiesImpl wrapModel(String name) { + return new FileServicePropertiesImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName) { + FileServicesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public FileServiceItems call(FileServiceItemsInner inner) { + return new FileServiceItemsImpl(inner, manager()); + } + }); + } + + @Override + public Observable getServicePropertiesAsync(String resourceGroupName, String accountName) { + FileServicesInner client = this.inner(); + return client.getServicePropertiesAsync(resourceGroupName, accountName) + .flatMap(new Func1>() { + @Override + public Observable call(FileServicePropertiesInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((FileServiceProperties)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileServicesInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileServicesInner.java new file mode 100644 index 0000000000000..e97550269495f --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileServicesInner.java @@ -0,0 +1,431 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.storage.v2019_08_01_preview.CorsRules; +import com.microsoft.azure.management.storage.v2019_08_01_preview.DeleteRetentionPolicy; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in FileServices. + */ +public class FileServicesInner { + /** The Retrofit service to perform REST calls. */ + private FileServicesService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of FileServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public FileServicesInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(FileServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for FileServices to be + * used by Retrofit to perform actually REST calls. + */ + interface FileServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.FileServices list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices") + 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.v2019_08_01_preview.FileServices setServiceProperties" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}") + Observable> setServiceProperties(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("FileServicesName") String fileServicesName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body FileServicePropertiesInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.FileServices getServiceProperties" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}") + Observable> getServiceProperties(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("FileServicesName") String fileServicesName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within 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 FileServiceItemsInner object if successful. + */ + public FileServiceItemsInner list(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the 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); + } + + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within 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 FileServiceItemsInner object + */ + public Observable listAsync(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, FileServiceItemsInner>() { + @Override + public FileServiceItemsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within 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 FileServiceItemsInner 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); + } + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FileServicePropertiesInner object if successful. + */ + public FileServicePropertiesInner setServiceProperties(String resourceGroupName, String accountName) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setServicePropertiesAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FileServicePropertiesInner object + */ + public Observable setServicePropertiesAsync(String resourceGroupName, String accountName) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, FileServicePropertiesInner>() { + @Override + public FileServicePropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FileServicePropertiesInner object + */ + public Observable> setServicePropertiesWithServiceResponseAsync(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 fileServicesName = "default"; + final CorsRules cors = null; + final DeleteRetentionPolicy shareDeleteRetentionPolicy = null; + FileServicePropertiesInner parameters = new FileServicePropertiesInner(); + parameters.withCors(null); + parameters.withShareDeleteRetentionPolicy(null); + return service.setServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), fileServicesName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setServicePropertiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param cors Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the File service. + * @param shareDeleteRetentionPolicy The file service properties for share soft delete. + * @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 FileServicePropertiesInner object if successful. + */ + public FileServicePropertiesInner setServiceProperties(String resourceGroupName, String accountName, CorsRules cors, DeleteRetentionPolicy shareDeleteRetentionPolicy) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, cors, shareDeleteRetentionPolicy).toBlocking().single().body(); + } + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param cors Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the File service. + * @param shareDeleteRetentionPolicy The file service properties for share soft delete. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setServicePropertiesAsync(String resourceGroupName, String accountName, CorsRules cors, DeleteRetentionPolicy shareDeleteRetentionPolicy, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, cors, shareDeleteRetentionPolicy), serviceCallback); + } + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param cors Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the File service. + * @param shareDeleteRetentionPolicy The file service properties for share soft delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FileServicePropertiesInner object + */ + public Observable setServicePropertiesAsync(String resourceGroupName, String accountName, CorsRules cors, DeleteRetentionPolicy shareDeleteRetentionPolicy) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, cors, shareDeleteRetentionPolicy).map(new Func1, FileServicePropertiesInner>() { + @Override + public FileServicePropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param cors Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the File service. + * @param shareDeleteRetentionPolicy The file service properties for share soft delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FileServicePropertiesInner object + */ + public Observable> setServicePropertiesWithServiceResponseAsync(String resourceGroupName, String accountName, CorsRules cors, DeleteRetentionPolicy shareDeleteRetentionPolicy) { + 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."); + } + Validator.validate(cors); + Validator.validate(shareDeleteRetentionPolicy); + final String fileServicesName = "default"; + FileServicePropertiesInner parameters = new FileServicePropertiesInner(); + parameters.withCors(cors); + parameters.withShareDeleteRetentionPolicy(shareDeleteRetentionPolicy); + return service.setServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), fileServicesName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setServicePropertiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse setServicePropertiesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FileServicePropertiesInner object if successful. + */ + public FileServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) { + return getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServicePropertiesAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FileServicePropertiesInner object + */ + public Observable getServicePropertiesAsync(String resourceGroupName, String accountName) { + return getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, FileServicePropertiesInner>() { + @Override + public FileServicePropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FileServicePropertiesInner object + */ + public Observable> getServicePropertiesWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String fileServicesName = "default"; + return service.getServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), fileServicesName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServicePropertiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getServicePropertiesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileShareImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileShareImpl.java new file mode 100644 index 0000000000000..b70d62d1bb8ba --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileShareImpl.java @@ -0,0 +1,199 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.FileShare; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.Map; +import com.microsoft.azure.management.storage.v2019_08_01_preview.EnabledProtocols; +import com.microsoft.azure.management.storage.v2019_08_01_preview.RootSquashType; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ShareAccessTier; + +class FileShareImpl extends CreatableUpdatableImpl implements FileShare, FileShare.Definition, FileShare.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private String shareName; + + FileShareImpl(String name, StorageManager manager) { + super(name, new FileShareInner()); + this.manager = manager; + // Set resource name + this.shareName = name; + // + } + + FileShareImpl(FileShareInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.shareName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + this.shareName = IdParsingUtils.getValueFromIdByName(inner.id(), "shares"); + // + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + FileSharesInner client = this.manager().inner().fileShares(); + return client.createAsync(this.resourceGroupName, this.accountName, this.shareName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + FileSharesInner client = this.manager().inner().fileShares(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.shareName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + FileSharesInner client = this.manager().inner().fileShares(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public ShareAccessTier accessTier() { + return this.inner().accessTier(); + } + + @Override + public DateTime accessTierChangeTime() { + return this.inner().accessTierChangeTime(); + } + + @Override + public String accessTierStatus() { + return this.inner().accessTierStatus(); + } + + @Override + public Boolean deleted() { + return this.inner().deleted(); + } + + @Override + public DateTime deletedTime() { + return this.inner().deletedTime(); + } + + @Override + public EnabledProtocols enabledProtocols() { + return this.inner().enabledProtocols(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public Map metadata() { + return this.inner().metadata(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer remainingRetentionDays() { + return this.inner().remainingRetentionDays(); + } + + @Override + public RootSquashType rootSquash() { + return this.inner().rootSquash(); + } + + @Override + public Integer shareQuota() { + return this.inner().shareQuota(); + } + + @Override + public Long shareUsageBytes() { + return this.inner().shareUsageBytes(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String version() { + return this.inner().version(); + } + + @Override + public FileShareImpl withExistingFileService(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public FileShareImpl withAccessTier(ShareAccessTier accessTier) { + this.inner().withAccessTier(accessTier); + return this; + } + + @Override + public FileShareImpl withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.inner().withEnabledProtocols(enabledProtocols); + return this; + } + + @Override + public FileShareImpl withMetadata(Map metadata) { + this.inner().withMetadata(metadata); + return this; + } + + @Override + public FileShareImpl withRootSquash(RootSquashType rootSquash) { + this.inner().withRootSquash(rootSquash); + return this; + } + + @Override + public FileShareImpl withShareQuota(Integer shareQuota) { + this.inner().withShareQuota(shareQuota); + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileShareInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileShareInner.java new file mode 100644 index 0000000000000..f32aa5801b961 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileShareInner.java @@ -0,0 +1,284 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import org.joda.time.DateTime; +import java.util.Map; +import com.microsoft.azure.management.storage.v2019_08_01_preview.EnabledProtocols; +import com.microsoft.azure.management.storage.v2019_08_01_preview.RootSquashType; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ShareAccessTier; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.storage.v2019_08_01_preview.AzureEntityResource; + +/** + * Properties of the file share, including Id, resource name, resource type, + * Etag. + */ +@JsonFlatten +public class FileShareInner extends AzureEntityResource { + /** + * Returns the date and time the share was last modified. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * A name-value pair to associate with the share as metadata. + */ + @JsonProperty(value = "properties.metadata") + private Map metadata; + + /** + * The maximum size of the share, in gigabytes. Must be greater than 0, and + * less than or equal to 5TB (5120). For Large File Shares, the maximum + * size is 102400. + */ + @JsonProperty(value = "properties.shareQuota") + private Integer shareQuota; + + /** + * The authentication protocol that is used for the file share. Can only be + * specified when creating a share. Possible values include: 'SMB', 'NFS'. + */ + @JsonProperty(value = "properties.enabledProtocols") + private EnabledProtocols enabledProtocols; + + /** + * The property is for NFS share only. The default is NoRootSquash. + * Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + */ + @JsonProperty(value = "properties.rootSquash") + private RootSquashType rootSquash; + + /** + * The version of the share. + */ + @JsonProperty(value = "properties.version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /** + * Indicates whether the share was deleted. + */ + @JsonProperty(value = "properties.deleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean deleted; + + /** + * The deleted time if the share was deleted. + */ + @JsonProperty(value = "properties.deletedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime deletedTime; + + /** + * Remaining retention days for share that was soft deleted. + */ + @JsonProperty(value = "properties.remainingRetentionDays", access = JsonProperty.Access.WRITE_ONLY) + private Integer remainingRetentionDays; + + /** + * Access tier for specific share. GpV2 account can choose between + * TransactionOptimized (default), Hot, and Cool. FileStorage account can + * choose Premium. Possible values include: 'TransactionOptimized', 'Hot', + * 'Cool', 'Premium'. + */ + @JsonProperty(value = "properties.accessTier") + private ShareAccessTier accessTier; + + /** + * Indicates the last modification time for share access tier. + */ + @JsonProperty(value = "properties.accessTierChangeTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime accessTierChangeTime; + + /** + * Indicates if there is a pending transition for access tier. + */ + @JsonProperty(value = "properties.accessTierStatus", access = JsonProperty.Access.WRITE_ONLY) + private String accessTierStatus; + + /** + * The approximate size of the data stored on the share. Note that this + * value may not include all recently created or recently resized files. + */ + @JsonProperty(value = "properties.shareUsageBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long shareUsageBytes; + + /** + * Get returns the date and time the share was last modified. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get a name-value pair to associate with the share as metadata. + * + * @return the metadata value + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set a name-value pair to associate with the share as metadata. + * + * @param metadata the metadata value to set + * @return the FileShareInner object itself. + */ + public FileShareInner withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. + * + * @return the shareQuota value + */ + public Integer shareQuota() { + return this.shareQuota; + } + + /** + * Set the maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. + * + * @param shareQuota the shareQuota value to set + * @return the FileShareInner object itself. + */ + public FileShareInner withShareQuota(Integer shareQuota) { + this.shareQuota = shareQuota; + return this; + } + + /** + * Get the authentication protocol that is used for the file share. Can only be specified when creating a share. Possible values include: 'SMB', 'NFS'. + * + * @return the enabledProtocols value + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set the authentication protocol that is used for the file share. Can only be specified when creating a share. Possible values include: 'SMB', 'NFS'. + * + * @param enabledProtocols the enabledProtocols value to set + * @return the FileShareInner object itself. + */ + public FileShareInner withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.enabledProtocols = enabledProtocols; + return this; + } + + /** + * Get the property is for NFS share only. The default is NoRootSquash. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + * + * @return the rootSquash value + */ + public RootSquashType rootSquash() { + return this.rootSquash; + } + + /** + * Set the property is for NFS share only. The default is NoRootSquash. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + * + * @param rootSquash the rootSquash value to set + * @return the FileShareInner object itself. + */ + public FileShareInner withRootSquash(RootSquashType rootSquash) { + this.rootSquash = rootSquash; + return this; + } + + /** + * Get the version of the share. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Get indicates whether the share was deleted. + * + * @return the deleted value + */ + public Boolean deleted() { + return this.deleted; + } + + /** + * Get the deleted time if the share was deleted. + * + * @return the deletedTime value + */ + public DateTime deletedTime() { + return this.deletedTime; + } + + /** + * Get remaining retention days for share that was soft deleted. + * + * @return the remainingRetentionDays value + */ + public Integer remainingRetentionDays() { + return this.remainingRetentionDays; + } + + /** + * Get access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Possible values include: 'TransactionOptimized', 'Hot', 'Cool', 'Premium'. + * + * @return the accessTier value + */ + public ShareAccessTier accessTier() { + return this.accessTier; + } + + /** + * Set access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Possible values include: 'TransactionOptimized', 'Hot', 'Cool', 'Premium'. + * + * @param accessTier the accessTier value to set + * @return the FileShareInner object itself. + */ + public FileShareInner withAccessTier(ShareAccessTier accessTier) { + this.accessTier = accessTier; + return this; + } + + /** + * Get indicates the last modification time for share access tier. + * + * @return the accessTierChangeTime value + */ + public DateTime accessTierChangeTime() { + return this.accessTierChangeTime; + } + + /** + * Get indicates if there is a pending transition for access tier. + * + * @return the accessTierStatus value + */ + public String accessTierStatus() { + return this.accessTierStatus; + } + + /** + * Get the approximate size of the data stored on the share. Note that this value may not include all recently created or recently resized files. + * + * @return the shareUsageBytes value + */ + public Long shareUsageBytes() { + return this.shareUsageBytes; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileShareItemImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileShareItemImpl.java new file mode 100644 index 0000000000000..77f4b96408e1a --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileShareItemImpl.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.FileShareItem; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ShareAccessTier; +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_08_01_preview.EnabledProtocols; +import java.util.Map; +import com.microsoft.azure.management.storage.v2019_08_01_preview.RootSquashType; + +class FileShareItemImpl extends WrapperImpl implements FileShareItem { + private final StorageManager manager; + FileShareItemImpl(FileShareItemInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public ShareAccessTier accessTier() { + return this.inner().accessTier(); + } + + @Override + public DateTime accessTierChangeTime() { + return this.inner().accessTierChangeTime(); + } + + @Override + public String accessTierStatus() { + return this.inner().accessTierStatus(); + } + + @Override + public Boolean deleted() { + return this.inner().deleted(); + } + + @Override + public DateTime deletedTime() { + return this.inner().deletedTime(); + } + + @Override + public EnabledProtocols enabledProtocols() { + return this.inner().enabledProtocols(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public Map metadata() { + return this.inner().metadata(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer remainingRetentionDays() { + return this.inner().remainingRetentionDays(); + } + + @Override + public RootSquashType rootSquash() { + return this.inner().rootSquash(); + } + + @Override + public Integer shareQuota() { + return this.inner().shareQuota(); + } + + @Override + public Long shareUsageBytes() { + return this.inner().shareUsageBytes(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String version() { + return this.inner().version(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileShareItemInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileShareItemInner.java new file mode 100644 index 0000000000000..9a6c11e98f233 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileShareItemInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import org.joda.time.DateTime; +import java.util.Map; +import com.microsoft.azure.management.storage.v2019_08_01_preview.EnabledProtocols; +import com.microsoft.azure.management.storage.v2019_08_01_preview.RootSquashType; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ShareAccessTier; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.storage.v2019_08_01_preview.AzureEntityResource; + +/** + * The file share properties be listed out. + */ +@JsonFlatten +public class FileShareItemInner extends AzureEntityResource { + /** + * Returns the date and time the share was last modified. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * A name-value pair to associate with the share as metadata. + */ + @JsonProperty(value = "properties.metadata") + private Map metadata; + + /** + * The maximum size of the share, in gigabytes. Must be greater than 0, and + * less than or equal to 5TB (5120). For Large File Shares, the maximum + * size is 102400. + */ + @JsonProperty(value = "properties.shareQuota") + private Integer shareQuota; + + /** + * The authentication protocol that is used for the file share. Can only be + * specified when creating a share. Possible values include: 'SMB', 'NFS'. + */ + @JsonProperty(value = "properties.enabledProtocols") + private EnabledProtocols enabledProtocols; + + /** + * The property is for NFS share only. The default is NoRootSquash. + * Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + */ + @JsonProperty(value = "properties.rootSquash") + private RootSquashType rootSquash; + + /** + * The version of the share. + */ + @JsonProperty(value = "properties.version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /** + * Indicates whether the share was deleted. + */ + @JsonProperty(value = "properties.deleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean deleted; + + /** + * The deleted time if the share was deleted. + */ + @JsonProperty(value = "properties.deletedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime deletedTime; + + /** + * Remaining retention days for share that was soft deleted. + */ + @JsonProperty(value = "properties.remainingRetentionDays", access = JsonProperty.Access.WRITE_ONLY) + private Integer remainingRetentionDays; + + /** + * Access tier for specific share. GpV2 account can choose between + * TransactionOptimized (default), Hot, and Cool. FileStorage account can + * choose Premium. Possible values include: 'TransactionOptimized', 'Hot', + * 'Cool', 'Premium'. + */ + @JsonProperty(value = "properties.accessTier") + private ShareAccessTier accessTier; + + /** + * Indicates the last modification time for share access tier. + */ + @JsonProperty(value = "properties.accessTierChangeTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime accessTierChangeTime; + + /** + * Indicates if there is a pending transition for access tier. + */ + @JsonProperty(value = "properties.accessTierStatus", access = JsonProperty.Access.WRITE_ONLY) + private String accessTierStatus; + + /** + * The approximate size of the data stored on the share. Note that this + * value may not include all recently created or recently resized files. + */ + @JsonProperty(value = "properties.shareUsageBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long shareUsageBytes; + + /** + * Get returns the date and time the share was last modified. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get a name-value pair to associate with the share as metadata. + * + * @return the metadata value + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set a name-value pair to associate with the share as metadata. + * + * @param metadata the metadata value to set + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. + * + * @return the shareQuota value + */ + public Integer shareQuota() { + return this.shareQuota; + } + + /** + * Set the maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. + * + * @param shareQuota the shareQuota value to set + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withShareQuota(Integer shareQuota) { + this.shareQuota = shareQuota; + return this; + } + + /** + * Get the authentication protocol that is used for the file share. Can only be specified when creating a share. Possible values include: 'SMB', 'NFS'. + * + * @return the enabledProtocols value + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set the authentication protocol that is used for the file share. Can only be specified when creating a share. Possible values include: 'SMB', 'NFS'. + * + * @param enabledProtocols the enabledProtocols value to set + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.enabledProtocols = enabledProtocols; + return this; + } + + /** + * Get the property is for NFS share only. The default is NoRootSquash. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + * + * @return the rootSquash value + */ + public RootSquashType rootSquash() { + return this.rootSquash; + } + + /** + * Set the property is for NFS share only. The default is NoRootSquash. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + * + * @param rootSquash the rootSquash value to set + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withRootSquash(RootSquashType rootSquash) { + this.rootSquash = rootSquash; + return this; + } + + /** + * Get the version of the share. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Get indicates whether the share was deleted. + * + * @return the deleted value + */ + public Boolean deleted() { + return this.deleted; + } + + /** + * Get the deleted time if the share was deleted. + * + * @return the deletedTime value + */ + public DateTime deletedTime() { + return this.deletedTime; + } + + /** + * Get remaining retention days for share that was soft deleted. + * + * @return the remainingRetentionDays value + */ + public Integer remainingRetentionDays() { + return this.remainingRetentionDays; + } + + /** + * Get access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Possible values include: 'TransactionOptimized', 'Hot', 'Cool', 'Premium'. + * + * @return the accessTier value + */ + public ShareAccessTier accessTier() { + return this.accessTier; + } + + /** + * Set access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Possible values include: 'TransactionOptimized', 'Hot', 'Cool', 'Premium'. + * + * @param accessTier the accessTier value to set + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withAccessTier(ShareAccessTier accessTier) { + this.accessTier = accessTier; + return this; + } + + /** + * Get indicates the last modification time for share access tier. + * + * @return the accessTierChangeTime value + */ + public DateTime accessTierChangeTime() { + return this.accessTierChangeTime; + } + + /** + * Get indicates if there is a pending transition for access tier. + * + * @return the accessTierStatus value + */ + public String accessTierStatus() { + return this.accessTierStatus; + } + + /** + * Get the approximate size of the data stored on the share. Note that this value may not include all recently created or recently resized files. + * + * @return the shareUsageBytes value + */ + public Long shareUsageBytes() { + return this.shareUsageBytes; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileSharesImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileSharesImpl.java new file mode 100644 index 0000000000000..ba0c80e5615a2 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileSharesImpl.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.FileShares; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.storage.v2019_08_01_preview.FileShareItem; +import com.microsoft.azure.management.storage.v2019_08_01_preview.FileShare; + +class FileSharesImpl extends WrapperImpl implements FileShares { + private final StorageManager manager; + + FileSharesImpl(StorageManager manager) { + super(manager.inner().fileShares()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public FileShareImpl define(String name) { + return wrapModel(name); + } + + private FileShareImpl wrapModel(FileShareInner inner) { + return new FileShareImpl(inner, manager()); + } + + private FileShareImpl wrapModel(String name) { + return new FileShareImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + FileSharesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public FileShareItem call(FileShareItemInner inner) { + return new FileShareItemImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String shareName) { + FileSharesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, shareName) + .map(new Func1() { + @Override + public FileShare call(FileShareInner inner) { + return new FileShareImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String shareName) { + FileSharesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, shareName).toCompletable(); + } + + @Override + public Completable restoreAsync(String resourceGroupName, String accountName, String shareName, String deletedShareName, String deletedShareVersion) { + FileSharesInner client = this.inner(); + return client.restoreAsync(resourceGroupName, accountName, shareName, deletedShareName, deletedShareVersion).toCompletable(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileSharesInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileSharesInner.java new file mode 100644 index 0000000000000..b05ba6b1eda36 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/FileSharesInner.java @@ -0,0 +1,1056 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.storage.v2019_08_01_preview.DeletedShare; +import com.microsoft.azure.management.storage.v2019_08_01_preview.GetShareExpand; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ListSharesExpand; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in FileShares. + */ +public class FileSharesInner { + /** The Retrofit service to perform REST calls. */ + private FileSharesService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of FileSharesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public FileSharesInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(FileSharesService.class); + this.client = client; + } + + /** + * The interface defining all the services for FileShares to be + * used by Retrofit to perform actually REST calls. + */ + interface FileSharesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.FileShares list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$maxpagesize") String maxpagesize, @Query("$filter") String filter, @Query("$expand") ListSharesExpand expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.FileShares create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("shareName") String shareName, @Path("subscriptionId") String subscriptionId, @Body FileShareInner fileShare, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.FileShares update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("shareName") String shareName, @Path("subscriptionId") String subscriptionId, @Body FileShareInner fileShare, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.FileShares get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("shareName") String shareName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") GetShareExpand expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.FileShares delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("shareName") String shareName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.FileShares restore" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore") + Observable> restore(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("shareName") String shareName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DeletedShare deletedShare, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.FileShares listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<FileShareItemInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FileShareItemInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FileShareItemInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<FileShareItemInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String maxpagesize = null; + final String filter = null; + final ListSharesExpand expand = null; + return service.list(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), maxpagesize, filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. + * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Possible values include: 'deleted' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<FileShareItemInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListSharesExpand expand) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. + * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Possible values include: 'deleted' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListSharesExpand expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. + * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Possible values include: 'deleted' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FileShareItemInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListSharesExpand expand) { + return listWithServiceResponseAsync(resourceGroupName, accountName, maxpagesize, filter, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. + * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Possible values include: 'deleted' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FileShareItemInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListSharesExpand expand) { + return listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all shares. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + ServiceResponse> * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ServiceResponse> * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. + ServiceResponse> * @param filter Optional. When specified, only share names starting with the filter will be listed. + ServiceResponse> * @param expand Optional, used to expand the properties within share's properties. Possible values include: 'deleted' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<FileShareItemInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListSharesExpand expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), maxpagesize, filter, expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the files contained by the share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share 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 fileShare Properties of the file share to create. + * @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 FileShareInner object if successful. + */ + public FileShareInner create(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { + return createWithServiceResponseAsync(resourceGroupName, accountName, shareName, fileShare).toBlocking().single().body(); + } + + /** + * Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the files contained by the share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share 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 fileShare Properties of the file share to create. + * @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 shareName, FileShareInner fileShare, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, shareName, fileShare), serviceCallback); + } + + /** + * Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the files contained by the share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share 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 fileShare Properties of the file share to create. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FileShareInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { + return createWithServiceResponseAsync(resourceGroupName, accountName, shareName, fileShare).map(new Func1, FileShareInner>() { + @Override + public FileShareInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the files contained by the share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share 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 fileShare Properties of the file share to create. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FileShareInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { + 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 (shareName == null) { + throw new IllegalArgumentException("Parameter shareName 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 (fileShare == null) { + throw new IllegalArgumentException("Parameter fileShare 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(fileShare); + return service.create(resourceGroupName, accountName, shareName, this.client.subscriptionId(), fileShare, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not 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 shareName The name of the file share within the specified storage account. File share 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 fileShare Properties to update for the file share. + * @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 FileShareInner object if successful. + */ + public FileShareInner update(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, shareName, fileShare).toBlocking().single().body(); + } + + /** + * Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not 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 shareName The name of the file share within the specified storage account. File share 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 fileShare Properties to update for the file share. + * @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 shareName, FileShareInner fileShare, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, shareName, fileShare), serviceCallback); + } + + /** + * Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not 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 shareName The name of the file share within the specified storage account. File share 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 fileShare Properties to update for the file share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FileShareInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, shareName, fileShare).map(new Func1, FileShareInner>() { + @Override + public FileShareInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not 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 shareName The name of the file share within the specified storage account. File share 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 fileShare Properties to update for the file share. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FileShareInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { + 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 (shareName == null) { + throw new IllegalArgumentException("Parameter shareName 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 (fileShare == null) { + throw new IllegalArgumentException("Parameter fileShare 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(fileShare); + return service.update(resourceGroupName, accountName, shareName, this.client.subscriptionId(), fileShare, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share 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 FileShareInner object if successful. + */ + public FileShareInner get(String resourceGroupName, String accountName, String shareName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, shareName).toBlocking().single().body(); + } + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share 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 shareName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, shareName), serviceCallback); + } + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share 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 FileShareInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String shareName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, shareName).map(new Func1, FileShareInner>() { + @Override + public FileShareInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share 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 FileShareInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName) { + 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 (shareName == null) { + throw new IllegalArgumentException("Parameter shareName 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 GetShareExpand expand = null; + return service.get(resourceGroupName, accountName, shareName, this.client.subscriptionId(), this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share 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 expand Optional, used to expand the properties within share's properties. Possible values include: 'stats' + * @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 FileShareInner object if successful. + */ + public FileShareInner get(String resourceGroupName, String accountName, String shareName, GetShareExpand expand) { + return getWithServiceResponseAsync(resourceGroupName, accountName, shareName, expand).toBlocking().single().body(); + } + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share 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 expand Optional, used to expand the properties within share's properties. Possible values include: 'stats' + * @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 shareName, GetShareExpand expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, shareName, expand), serviceCallback); + } + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share 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 expand Optional, used to expand the properties within share's properties. Possible values include: 'stats' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FileShareInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String shareName, GetShareExpand expand) { + return getWithServiceResponseAsync(resourceGroupName, accountName, shareName, expand).map(new Func1, FileShareInner>() { + @Override + public FileShareInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share 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 expand Optional, used to expand the properties within share's properties. Possible values include: 'stats' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FileShareInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName, GetShareExpand expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (shareName == null) { + throw new IllegalArgumentException("Parameter shareName 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, shareName, this.client.subscriptionId(), this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = 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 share 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 shareName The name of the file share within the specified storage account. File share 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 shareName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, shareName).toBlocking().single().body(); + } + + /** + * Deletes specified share 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 shareName The name of the file share within the specified storage account. File share 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 shareName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, shareName), serviceCallback); + } + + /** + * Deletes specified share 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 shareName The name of the file share within the specified storage account. File share 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 shareName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, shareName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes specified share 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 shareName The name of the file share within the specified storage account. File share 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 shareName) { + 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 (shareName == null) { + throw new IllegalArgumentException("Parameter shareName 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, shareName, 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); + } + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share 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 deletedShareName Required. Identify the name of the deleted share that will be restored. + * @param deletedShareVersion Required. Identify the version of the deleted share that will be restored. + * @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 restore(String resourceGroupName, String accountName, String shareName, String deletedShareName, String deletedShareVersion) { + restoreWithServiceResponseAsync(resourceGroupName, accountName, shareName, deletedShareName, deletedShareVersion).toBlocking().single().body(); + } + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share 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 deletedShareName Required. Identify the name of the deleted share that will be restored. + * @param deletedShareVersion Required. Identify the version of the deleted share that will be restored. + * @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 restoreAsync(String resourceGroupName, String accountName, String shareName, String deletedShareName, String deletedShareVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restoreWithServiceResponseAsync(resourceGroupName, accountName, shareName, deletedShareName, deletedShareVersion), serviceCallback); + } + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share 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 deletedShareName Required. Identify the name of the deleted share that will be restored. + * @param deletedShareVersion Required. Identify the version of the deleted share that will be restored. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable restoreAsync(String resourceGroupName, String accountName, String shareName, String deletedShareName, String deletedShareVersion) { + return restoreWithServiceResponseAsync(resourceGroupName, accountName, shareName, deletedShareName, deletedShareVersion).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share 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 deletedShareName Required. Identify the name of the deleted share that will be restored. + * @param deletedShareVersion Required. Identify the version of the deleted share that will be restored. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> restoreWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName, String deletedShareName, String deletedShareVersion) { + 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 (shareName == null) { + throw new IllegalArgumentException("Parameter shareName 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 (deletedShareName == null) { + throw new IllegalArgumentException("Parameter deletedShareName is required and cannot be null."); + } + if (deletedShareVersion == null) { + throw new IllegalArgumentException("Parameter deletedShareVersion is required and cannot be null."); + } + DeletedShare deletedShare = new DeletedShare(); + deletedShare.withDeletedShareName(deletedShareName); + deletedShare.withDeletedShareVersion(deletedShareVersion); + return service.restore(resourceGroupName, accountName, shareName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), deletedShare, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = restoreDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse restoreDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all shares. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<FileShareItemInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all shares. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all shares. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FileShareItemInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all shares. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<FileShareItemInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all shares. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<FileShareItemInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/IdParsingUtils.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..eb4ab66bc8c80 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ImmutabilityPolicyImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ImmutabilityPolicyImpl.java new file mode 100644 index 0000000000000..134a24c03d21f --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ImmutabilityPolicyImpl.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.ImmutabilityPolicy; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ImmutabilityPolicyState; + +class ImmutabilityPolicyImpl extends CreatableUpdatableImpl implements ImmutabilityPolicy, ImmutabilityPolicy.Definition, ImmutabilityPolicy.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private String containerName; + private String cifMatch; + private Integer cimmutabilityPeriodSinceCreationInDays; + private Boolean callowProtectedAppendWrites; + private String uifMatch; + private Integer uimmutabilityPeriodSinceCreationInDays; + private Boolean uallowProtectedAppendWrites; + + ImmutabilityPolicyImpl(String name, StorageManager manager) { + super(name, new ImmutabilityPolicyInner()); + this.manager = manager; + // Set resource name + this.containerName = name; + // + } + + ImmutabilityPolicyImpl(ImmutabilityPolicyInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.containerName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + this.containerName = IdParsingUtils.getValueFromIdByName(inner.id(), "containers"); + // + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + BlobContainersInner client = this.manager().inner().blobContainers(); + return client.createOrUpdateImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName, this.cifMatch, this.cimmutabilityPeriodSinceCreationInDays, this.callowProtectedAppendWrites) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + BlobContainersInner client = this.manager().inner().blobContainers(); + return client.createOrUpdateImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName, this.uifMatch, this.uimmutabilityPeriodSinceCreationInDays, this.uallowProtectedAppendWrites) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + BlobContainersInner client = this.manager().inner().blobContainers(); + return client.getImmutabilityPolicyAsync(this.resourceGroupName, this.accountName, this.containerName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean allowProtectedAppendWrites() { + return this.inner().allowProtectedAppendWrites(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Integer immutabilityPeriodSinceCreationInDays() { + return this.inner().immutabilityPeriodSinceCreationInDays(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ImmutabilityPolicyState state() { + return this.inner().state(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ImmutabilityPolicyImpl withExistingContainer(String resourceGroupName, String accountName, String containerName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.containerName = containerName; + return this; + } + + @Override + public ImmutabilityPolicyImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.cifMatch = ifMatch; + } else { + this.uifMatch = ifMatch; + } + return this; + } + + @Override + public ImmutabilityPolicyImpl withImmutabilityPeriodSinceCreationInDays(Integer immutabilityPeriodSinceCreationInDays) { + if (isInCreateMode()) { + this.cimmutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays; + } else { + this.uimmutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays; + } + return this; + } + + @Override + public ImmutabilityPolicyImpl withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) { + if (isInCreateMode()) { + this.callowProtectedAppendWrites = allowProtectedAppendWrites; + } else { + this.uallowProtectedAppendWrites = allowProtectedAppendWrites; + } + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ImmutabilityPolicyInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ImmutabilityPolicyInner.java new file mode 100644 index 0000000000000..16c7ac3a880da --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ImmutabilityPolicyInner.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.ImmutabilityPolicyState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.storage.v2019_08_01_preview.AzureEntityResource; + +/** + * The ImmutabilityPolicy property of a blob container, including Id, resource + * name, resource type, Etag. + */ +@JsonFlatten +public class ImmutabilityPolicyInner extends AzureEntityResource { + /** + * The immutability period for the blobs in the container since the policy + * creation, in days. + */ + @JsonProperty(value = "properties.immutabilityPeriodSinceCreationInDays") + private Integer 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; + + /** + * This property can only be changed for unlocked time-based retention + * policies. When enabled, new blocks can be written to an append blob + * while maintaining immutability protection and compliance. Only new + * blocks can be added and any existing blocks cannot be modified or + * deleted. This property cannot be changed with ExtendImmutabilityPolicy + * API. + */ + @JsonProperty(value = "properties.allowProtectedAppendWrites") + private Boolean allowProtectedAppendWrites; + + /** + * 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; + } + + /** + * 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(Integer 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 this property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + * + * @return the allowProtectedAppendWrites value + */ + public Boolean allowProtectedAppendWrites() { + return this.allowProtectedAppendWrites; + } + + /** + * Set this property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + * + * @param allowProtectedAppendWrites the allowProtectedAppendWrites value to set + * @return the ImmutabilityPolicyInner object itself. + */ + public ImmutabilityPolicyInner withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) { + this.allowProtectedAppendWrites = allowProtectedAppendWrites; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/LeaseContainerResponseImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/LeaseContainerResponseImpl.java new file mode 100644 index 0000000000000..2b591f6d94789 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/LeaseContainerResponseImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.LeaseContainerResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class LeaseContainerResponseImpl extends WrapperImpl implements LeaseContainerResponse { + private final StorageManager manager; + LeaseContainerResponseImpl(LeaseContainerResponseInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String leaseId() { + return this.inner().leaseId(); + } + + @Override + public String leaseTimeSeconds() { + return this.inner().leaseTimeSeconds(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/LeaseContainerResponseInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/LeaseContainerResponseInner.java new file mode 100644 index 0000000000000..e003f900af24c --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/LeaseContainerResponseInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Lease Container response schema. + */ +public class LeaseContainerResponseInner { + /** + * Returned unique lease ID that must be included with any request to + * delete the container, or to renew, change, or release the lease. + */ + @JsonProperty(value = "leaseId") + private String leaseId; + + /** + * Approximate time remaining in the lease period, in seconds. + */ + @JsonProperty(value = "leaseTimeSeconds") + private String leaseTimeSeconds; + + /** + * Get returned unique lease ID that must be included with any request to delete the container, or to renew, change, or release the lease. + * + * @return the leaseId value + */ + public String leaseId() { + return this.leaseId; + } + + /** + * Set returned unique lease ID that must be included with any request to delete the container, or to renew, change, or release the lease. + * + * @param leaseId the leaseId value to set + * @return the LeaseContainerResponseInner object itself. + */ + public LeaseContainerResponseInner withLeaseId(String leaseId) { + this.leaseId = leaseId; + return this; + } + + /** + * Get approximate time remaining in the lease period, in seconds. + * + * @return the leaseTimeSeconds value + */ + public String leaseTimeSeconds() { + return this.leaseTimeSeconds; + } + + /** + * Set approximate time remaining in the lease period, in seconds. + * + * @param leaseTimeSeconds the leaseTimeSeconds value to set + * @return the LeaseContainerResponseInner object itself. + */ + public LeaseContainerResponseInner withLeaseTimeSeconds(String leaseTimeSeconds) { + this.leaseTimeSeconds = leaseTimeSeconds; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/LegalHoldImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/LegalHoldImpl.java new file mode 100644 index 0000000000000..94022271f3dca --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/LegalHoldImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.LegalHold; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class LegalHoldImpl extends WrapperImpl implements LegalHold { + private final StorageManager manager; + LegalHoldImpl(LegalHoldInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Boolean hasLegalHold() { + return this.inner().hasLegalHold(); + } + + @Override + public List tags() { + return this.inner().tags(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/LegalHoldInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/LegalHoldInner.java new file mode 100644 index 0000000000000..25aee4a432cb2 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/LegalHoldInner.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.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/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListAccountSasResponseImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListAccountSasResponseImpl.java new file mode 100644 index 0000000000000..e8865349d037d --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListAccountSasResponseImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.ListAccountSasResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ListAccountSasResponseImpl extends WrapperImpl implements ListAccountSasResponse { + private final StorageManager manager; + ListAccountSasResponseImpl(ListAccountSasResponseInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String accountSasToken() { + return this.inner().accountSasToken(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListAccountSasResponseInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListAccountSasResponseInner.java new file mode 100644 index 0000000000000..de77908b96e44 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListAccountSasResponseInner.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The List SAS credentials operation response. + */ +public class ListAccountSasResponseInner { + /** + * List SAS credentials of storage account. + */ + @JsonProperty(value = "accountSasToken", access = JsonProperty.Access.WRITE_ONLY) + private String accountSasToken; + + /** + * Get list SAS credentials of storage account. + * + * @return the accountSasToken value + */ + public String accountSasToken() { + return this.accountSasToken; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListContainerItemImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListContainerItemImpl.java new file mode 100644 index 0000000000000..0fb294ac80d15 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListContainerItemImpl.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.ListContainerItem; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ImmutabilityPolicyProperties; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LeaseDuration; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LeaseState; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LeaseStatus; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LegalHoldProperties; +import java.util.Map; +import com.microsoft.azure.management.storage.v2019_08_01_preview.PublicAccess; + +class ListContainerItemImpl extends WrapperImpl implements ListContainerItem { + private final StorageManager manager; + ListContainerItemImpl(ListContainerItemInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String defaultEncryptionScope() { + return this.inner().defaultEncryptionScope(); + } + + @Override + public Boolean deleted() { + return this.inner().deleted(); + } + + @Override + public DateTime deletedTime() { + return this.inner().deletedTime(); + } + + @Override + public Boolean denyEncryptionScopeOverride() { + return this.inner().denyEncryptionScopeOverride(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public Boolean hasImmutabilityPolicy() { + return this.inner().hasImmutabilityPolicy(); + } + + @Override + public Boolean hasLegalHold() { + return this.inner().hasLegalHold(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public ImmutabilityPolicyProperties immutabilityPolicy() { + return this.inner().immutabilityPolicy(); + } + + @Override + public DateTime lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public LeaseDuration leaseDuration() { + return this.inner().leaseDuration(); + } + + @Override + public LeaseState leaseState() { + return this.inner().leaseState(); + } + + @Override + public LeaseStatus leaseStatus() { + return this.inner().leaseStatus(); + } + + @Override + public LegalHoldProperties legalHold() { + return this.inner().legalHold(); + } + + @Override + public Map metadata() { + return this.inner().metadata(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PublicAccess publicAccess() { + return this.inner().publicAccess(); + } + + @Override + public Integer remainingRetentionDays() { + return this.inner().remainingRetentionDays(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String version() { + return this.inner().version(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListContainerItemInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListContainerItemInner.java new file mode 100644 index 0000000000000..ffee3ddf24e87 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListContainerItemInner.java @@ -0,0 +1,324 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_08_01_preview.PublicAccess; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LeaseStatus; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LeaseState; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LeaseDuration; +import java.util.Map; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ImmutabilityPolicyProperties; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LegalHoldProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.storage.v2019_08_01_preview.AzureEntityResource; + +/** + * The blob container properties be listed out. + */ +@JsonFlatten +public class ListContainerItemInner extends AzureEntityResource { + /** + * The version of the deleted blob container. + */ + @JsonProperty(value = "properties.version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /** + * Indicates whether the blob container was deleted. + */ + @JsonProperty(value = "properties.deleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean deleted; + + /** + * Blob container deletion time. + */ + @JsonProperty(value = "properties.deletedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime deletedTime; + + /** + * Remaining retention days for soft deleted blob container. + */ + @JsonProperty(value = "properties.remainingRetentionDays", access = JsonProperty.Access.WRITE_ONLY) + private Integer remainingRetentionDays; + + /** + * Default the container to use specified encryption scope for all writes. + */ + @JsonProperty(value = "properties.defaultEncryptionScope") + private String defaultEncryptionScope; + + /** + * Block override of encryption scope from the container default. + */ + @JsonProperty(value = "properties.denyEncryptionScopeOverride") + private Boolean denyEncryptionScopeOverride; + + /** + * 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 the version of the deleted blob container. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Get indicates whether the blob container was deleted. + * + * @return the deleted value + */ + public Boolean deleted() { + return this.deleted; + } + + /** + * Get blob container deletion time. + * + * @return the deletedTime value + */ + public DateTime deletedTime() { + return this.deletedTime; + } + + /** + * Get remaining retention days for soft deleted blob container. + * + * @return the remainingRetentionDays value + */ + public Integer remainingRetentionDays() { + return this.remainingRetentionDays; + } + + /** + * Get default the container to use specified encryption scope for all writes. + * + * @return the defaultEncryptionScope value + */ + public String defaultEncryptionScope() { + return this.defaultEncryptionScope; + } + + /** + * Set default the container to use specified encryption scope for all writes. + * + * @param defaultEncryptionScope the defaultEncryptionScope value to set + * @return the ListContainerItemInner object itself. + */ + public ListContainerItemInner withDefaultEncryptionScope(String defaultEncryptionScope) { + this.defaultEncryptionScope = defaultEncryptionScope; + return this; + } + + /** + * Get block override of encryption scope from the container default. + * + * @return the denyEncryptionScopeOverride value + */ + public Boolean denyEncryptionScopeOverride() { + return this.denyEncryptionScopeOverride; + } + + /** + * Set block override of encryption scope from the container default. + * + * @param denyEncryptionScopeOverride the denyEncryptionScopeOverride value to set + * @return the ListContainerItemInner object itself. + */ + public ListContainerItemInner withDenyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride) { + this.denyEncryptionScopeOverride = denyEncryptionScopeOverride; + return this; + } + + /** + * Get specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None'. + * + * @return the publicAccess value + */ + public PublicAccess publicAccess() { + return this.publicAccess; + } + + /** + * Set specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'Container', 'Blob', 'None'. + * + * @param publicAccess the publicAccess value to set + * @return the ListContainerItemInner object itself. + */ + public ListContainerItemInner withPublicAccess(PublicAccess publicAccess) { + this.publicAccess = publicAccess; + return this; + } + + /** + * Get returns the date and time the container was last modified. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the lease status of the container. Possible values include: 'Locked', 'Unlocked'. + * + * @return the leaseStatus value + */ + public LeaseStatus leaseStatus() { + return this.leaseStatus; + } + + /** + * Get lease state of the container. Possible values include: 'Available', 'Leased', 'Expired', 'Breaking', 'Broken'. + * + * @return the leaseState value + */ + public LeaseState leaseState() { + return this.leaseState; + } + + /** + * Get specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. Possible values include: 'Infinite', 'Fixed'. + * + * @return the leaseDuration value + */ + public LeaseDuration leaseDuration() { + return this.leaseDuration; + } + + /** + * Get a name-value pair to associate with the container as metadata. + * + * @return the metadata value + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set a name-value pair to associate with the container as metadata. + * + * @param metadata the metadata value to set + * @return the ListContainerItemInner object itself. + */ + public ListContainerItemInner withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the ImmutabilityPolicy property of the container. + * + * @return the immutabilityPolicy value + */ + public ImmutabilityPolicyProperties immutabilityPolicy() { + return this.immutabilityPolicy; + } + + /** + * Get the LegalHold property of the container. + * + * @return the legalHold value + */ + public LegalHoldProperties legalHold() { + return this.legalHold; + } + + /** + * Get the hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. + * + * @return the hasLegalHold value + */ + public Boolean hasLegalHold() { + return this.hasLegalHold; + } + + /** + * Get the hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container. + * + * @return the hasImmutabilityPolicy value + */ + public Boolean hasImmutabilityPolicy() { + return this.hasImmutabilityPolicy; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListQueueImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListQueueImpl.java new file mode 100644 index 0000000000000..d7ee20b6f850b --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListQueueImpl.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.ListQueue; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.Map; + +class ListQueueImpl extends WrapperImpl implements ListQueue { + private final StorageManager manager; + ListQueueImpl(ListQueueInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Map metadata() { + return this.inner().metadata(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListQueueInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListQueueInner.java new file mode 100644 index 0000000000000..b197bd9eab48c --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListQueueInner.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The ListQueueInner model. + */ +@JsonFlatten +public class ListQueueInner extends ProxyResource { + /** + * A name-value pair that represents queue metadata. + */ + @JsonProperty(value = "properties.metadata") + private Map metadata; + + /** + * Get a name-value pair that represents queue metadata. + * + * @return the metadata value + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set a name-value pair that represents queue metadata. + * + * @param metadata the metadata value to set + * @return the ListQueueInner object itself. + */ + public ListQueueInner withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListQueueServicesImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListQueueServicesImpl.java new file mode 100644 index 0000000000000..e56285fef3141 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListQueueServicesImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.ListQueueServices; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class ListQueueServicesImpl extends WrapperImpl implements ListQueueServices { + private final StorageManager manager; + ListQueueServicesImpl(ListQueueServicesInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListQueueServicesInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListQueueServicesInner.java new file mode 100644 index 0000000000000..972dc218d73e6 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListQueueServicesInner.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ListQueueServicesInner model. + */ +public class ListQueueServicesInner { + /** + * List of queue services returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get list of queue services returned. + * + * @return the value value + */ + public List value() { + return this.value; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListServiceSasResponseImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListServiceSasResponseImpl.java new file mode 100644 index 0000000000000..4161c7bc641a4 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListServiceSasResponseImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.ListServiceSasResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ListServiceSasResponseImpl extends WrapperImpl implements ListServiceSasResponse { + private final StorageManager manager; + ListServiceSasResponseImpl(ListServiceSasResponseInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String serviceSasToken() { + return this.inner().serviceSasToken(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListServiceSasResponseInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListServiceSasResponseInner.java new file mode 100644 index 0000000000000..ac31c6a86d747 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListServiceSasResponseInner.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The List service SAS credentials operation response. + */ +public class ListServiceSasResponseInner { + /** + * List service SAS credentials of specific resource. + */ + @JsonProperty(value = "serviceSasToken", access = JsonProperty.Access.WRITE_ONLY) + private String serviceSasToken; + + /** + * Get list service SAS credentials of specific resource. + * + * @return the serviceSasToken value + */ + public String serviceSasToken() { + return this.serviceSasToken; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListTableServicesImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListTableServicesImpl.java new file mode 100644 index 0000000000000..0913684204b0a --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListTableServicesImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.ListTableServices; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class ListTableServicesImpl extends WrapperImpl implements ListTableServices { + private final StorageManager manager; + ListTableServicesImpl(ListTableServicesInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListTableServicesInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListTableServicesInner.java new file mode 100644 index 0000000000000..6563282f26343 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ListTableServicesInner.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ListTableServicesInner model. + */ +public class ListTableServicesInner { + /** + * List of table services returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get list of table services returned. + * + * @return the value value + */ + public List value() { + return this.value; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ManagementPoliciesImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ManagementPoliciesImpl.java new file mode 100644 index 0000000000000..43bbbbf3aff14 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ManagementPoliciesImpl.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ManagementPolicies; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ManagementPolicy; + +class ManagementPoliciesImpl extends WrapperImpl implements ManagementPolicies { + private final StorageManager manager; + + ManagementPoliciesImpl(StorageManager manager) { + super(manager.inner().managementPolicies()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public ManagementPolicyImpl define(String name) { + return wrapModel(name); + } + + private ManagementPolicyImpl wrapModel(ManagementPolicyInner inner) { + return new ManagementPolicyImpl(inner, manager()); + } + + private ManagementPolicyImpl wrapModel(String name) { + return new ManagementPolicyImpl(name, this.manager()); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName) { + ManagementPoliciesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName) + .flatMap(new Func1>() { + @Override + public Observable call(ManagementPolicyInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ManagementPolicy)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName) { + ManagementPoliciesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName).toCompletable(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ManagementPoliciesInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ManagementPoliciesInner.java new file mode 100644 index 0000000000000..1dad2c6266dd5 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ManagementPoliciesInner.java @@ -0,0 +1,345 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ManagementPolicySchema; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ManagementPolicies. + */ +public class ManagementPoliciesInner implements InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private ManagementPoliciesService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of ManagementPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ManagementPoliciesInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(ManagementPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ManagementPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface ManagementPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.ManagementPolicies get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("managementPolicyName") String managementPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.ManagementPolicies createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("managementPolicyName") String managementPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ManagementPolicyInner properties, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.ManagementPolicies delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("managementPolicyName") String managementPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ManagementPolicyInner object if successful. + */ + public ManagementPolicyInner get(String resourceGroupName, String accountName) { + return getWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ManagementPolicyInner object + */ + public Observable getAsync(String resourceGroupName, String accountName) { + return getWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, ManagementPolicyInner>() { + @Override + public ManagementPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ManagementPolicyInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String managementPolicyName = "default"; + return service.get(resourceGroupName, accountName, this.client.subscriptionId(), managementPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Sets the managementpolicy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param policy The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ManagementPolicyInner object if successful. + */ + public ManagementPolicyInner createOrUpdate(String resourceGroupName, String accountName, ManagementPolicySchema policy) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, policy).toBlocking().single().body(); + } + + /** + * Sets the managementpolicy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param policy The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, ManagementPolicySchema policy, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, policy), serviceCallback); + } + + /** + * Sets the managementpolicy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param policy The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ManagementPolicyInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, ManagementPolicySchema policy) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, policy).map(new Func1, ManagementPolicyInner>() { + @Override + public ManagementPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the managementpolicy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param policy The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ManagementPolicyInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, ManagementPolicySchema policy) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (policy == null) { + throw new IllegalArgumentException("Parameter policy is required and cannot be null."); + } + Validator.validate(policy); + final String managementPolicyName = "default"; + ManagementPolicyInner properties = new ManagementPolicyInner(); + properties.withPolicy(policy); + return service.createOrUpdate(resourceGroupName, accountName, this.client.subscriptionId(), managementPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), properties, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String managementPolicyName = "default"; + return service.delete(resourceGroupName, accountName, this.client.subscriptionId(), managementPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ManagementPolicyImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ManagementPolicyImpl.java new file mode 100644 index 0000000000000..5e5ea309d5c2e --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ManagementPolicyImpl.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.ManagementPolicy; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ManagementPolicySchema; +import java.util.List; +import org.joda.time.DateTime; +import rx.functions.Func1; + +class ManagementPolicyImpl extends CreatableUpdatableImpl implements ManagementPolicy, ManagementPolicy.Definition, ManagementPolicy.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private ManagementPolicySchema cpolicy; + private ManagementPolicySchema upolicy; + + ManagementPolicyImpl(String name, StorageManager manager) { + super(name, new ManagementPolicyInner()); + this.manager = manager; + // Set resource name + this.accountName = name; + // + this.cpolicy = new ManagementPolicySchema(); + this.upolicy = new ManagementPolicySchema(); + } + + ManagementPolicyImpl(ManagementPolicyInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.accountName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + // + this.cpolicy = new ManagementPolicySchema(); + this.upolicy = new ManagementPolicySchema(); + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ManagementPoliciesInner client = this.manager().inner().managementPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.cpolicy) + .map(new Func1() { + @Override + public ManagementPolicyInner call(ManagementPolicyInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ManagementPoliciesInner client = this.manager().inner().managementPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.upolicy) + .map(new Func1() { + @Override + public ManagementPolicyInner call(ManagementPolicyInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ManagementPoliciesInner client = this.manager().inner().managementPolicies(); + return client.getAsync(this.resourceGroupName, this.accountName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.cpolicy = new ManagementPolicySchema(); + this.upolicy = new ManagementPolicySchema(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ManagementPolicySchema policy() { + return this.inner().policy(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ManagementPolicyImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public ManagementPolicyImpl withPolicy(ManagementPolicySchema policy) { + if (isInCreateMode()) { + this.cpolicy = policy; + } else { + this.upolicy = policy; + } + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ManagementPolicyInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ManagementPolicyInner.java new file mode 100644 index 0000000000000..83492021e95bf --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ManagementPolicyInner.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ManagementPolicySchema; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The Get Storage Account ManagementPolicies operation response. + */ +@JsonFlatten +public class ManagementPolicyInner extends ProxyResource { + /** + * Returns the date and time the ManagementPolicies was last modified. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModifiedTime; + + /** + * The Storage Account ManagementPolicy, in JSON format. See more details + * in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + */ + @JsonProperty(value = "properties.policy", required = true) + private ManagementPolicySchema policy; + + /** + * Get returns the date and time the ManagementPolicies was last modified. + * + * @return the lastModifiedTime value + */ + public DateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @return the policy value + */ + public ManagementPolicySchema policy() { + return this.policy; + } + + /** + * Set the Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @param policy the policy value to set + * @return the ManagementPolicyInner object itself. + */ + public ManagementPolicyInner withPolicy(ManagementPolicySchema policy) { + this.policy = policy; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ObjectReplicationPoliciesImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ObjectReplicationPoliciesImpl.java new file mode 100644 index 0000000000000..5e54172512721 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ObjectReplicationPoliciesImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ObjectReplicationPolicies; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ObjectReplicationPolicy; + +class ObjectReplicationPoliciesImpl extends WrapperImpl implements ObjectReplicationPolicies { + private final StorageManager manager; + + ObjectReplicationPoliciesImpl(StorageManager manager) { + super(manager.inner().objectReplicationPolicies()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public ObjectReplicationPolicyImpl define(String name) { + return wrapModel(name); + } + + private ObjectReplicationPolicyImpl wrapModel(ObjectReplicationPolicyInner inner) { + return new ObjectReplicationPolicyImpl(inner, manager()); + } + + private ObjectReplicationPolicyImpl wrapModel(String name) { + return new ObjectReplicationPolicyImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName) { + ObjectReplicationPoliciesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public ObjectReplicationPolicy call(ObjectReplicationPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String objectReplicationPolicyId) { + ObjectReplicationPoliciesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, objectReplicationPolicyId) + .flatMap(new Func1>() { + @Override + public Observable call(ObjectReplicationPolicyInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ObjectReplicationPolicy)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String objectReplicationPolicyId) { + ObjectReplicationPoliciesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, objectReplicationPolicyId).toCompletable(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ObjectReplicationPoliciesInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ObjectReplicationPoliciesInner.java new file mode 100644 index 0000000000000..1de985a4f5a41 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ObjectReplicationPoliciesInner.java @@ -0,0 +1,455 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ObjectReplicationPolicies. + */ +public class ObjectReplicationPoliciesInner { + /** The Retrofit service to perform REST calls. */ + private ObjectReplicationPoliciesService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of ObjectReplicationPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ObjectReplicationPoliciesInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(ObjectReplicationPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ObjectReplicationPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface ObjectReplicationPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.ObjectReplicationPolicies list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies") + 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.v2019_08_01_preview.ObjectReplicationPolicies get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("objectReplicationPolicyId") String objectReplicationPolicyId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.ObjectReplicationPolicies createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("objectReplicationPolicyId") String objectReplicationPolicyId, @Query("api-version") String apiVersion, @Body ObjectReplicationPolicyInner properties, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.ObjectReplicationPolicies delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("objectReplicationPolicyId") String objectReplicationPolicyId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List the object replication policies associated with the 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ObjectReplicationPolicyInner> object if successful. + */ + public List list(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * List the object replication policies associated with the 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> listAsync(String resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * List the object replication policies associated with the 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 List<ObjectReplicationPolicyInner> object + */ + public Observable> listAsync(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the object replication policies associated with the 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 List<ObjectReplicationPolicyInner> 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> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ObjectReplicationPolicyInner object if successful. + */ + public ObjectReplicationPolicyInner get(String resourceGroupName, String accountName, String objectReplicationPolicyId) { + return getWithServiceResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId).toBlocking().single().body(); + } + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. + * @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 objectReplicationPolicyId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId), serviceCallback); + } + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ObjectReplicationPolicyInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String objectReplicationPolicyId) { + return getWithServiceResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId).map(new Func1, ObjectReplicationPolicyInner>() { + @Override + public ObjectReplicationPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ObjectReplicationPolicyInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String objectReplicationPolicyId) { + 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 (objectReplicationPolicyId == null) { + throw new IllegalArgumentException("Parameter objectReplicationPolicyId 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, this.client.subscriptionId(), objectReplicationPolicyId, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Create or update the object replication policy of the 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 objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. + * @param properties The object replication policy set to a storage account. A unique policy ID will be created if absent. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ObjectReplicationPolicyInner object if successful. + */ + public ObjectReplicationPolicyInner createOrUpdate(String resourceGroupName, String accountName, String objectReplicationPolicyId, ObjectReplicationPolicyInner properties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId, properties).toBlocking().single().body(); + } + + /** + * Create or update the object replication policy of the 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 objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. + * @param properties The object replication policy set to a storage account. A unique policy ID will be created if absent. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, String objectReplicationPolicyId, ObjectReplicationPolicyInner properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId, properties), serviceCallback); + } + + /** + * Create or update the object replication policy of the 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 objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. + * @param properties The object replication policy set to a storage account. A unique policy ID will be created if absent. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ObjectReplicationPolicyInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, String objectReplicationPolicyId, ObjectReplicationPolicyInner properties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId, properties).map(new Func1, ObjectReplicationPolicyInner>() { + @Override + public ObjectReplicationPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update the object replication policy of the 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 objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. + * @param properties The object replication policy set to a storage account. A unique policy ID will be created if absent. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ObjectReplicationPolicyInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, String objectReplicationPolicyId, ObjectReplicationPolicyInner properties) { + 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 (objectReplicationPolicyId == null) { + throw new IllegalArgumentException("Parameter objectReplicationPolicyId 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 (properties == null) { + throw new IllegalArgumentException("Parameter properties is required and cannot be null."); + } + Validator.validate(properties); + return service.createOrUpdate(resourceGroupName, accountName, this.client.subscriptionId(), objectReplicationPolicyId, this.client.apiVersion(), properties, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the object replication policy 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 objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 objectReplicationPolicyId) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId).toBlocking().single().body(); + } + + /** + * Deletes the object replication policy 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 objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. + * @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 objectReplicationPolicyId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId), serviceCallback); + } + + /** + * Deletes the object replication policy 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 objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String objectReplicationPolicyId) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the object replication policy 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 objectReplicationPolicyId The ID of object replication policy or 'default' if the policy ID is unknown. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String objectReplicationPolicyId) { + 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 (objectReplicationPolicyId == null) { + throw new IllegalArgumentException("Parameter objectReplicationPolicyId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(resourceGroupName, accountName, this.client.subscriptionId(), objectReplicationPolicyId, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ObjectReplicationPolicyImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ObjectReplicationPolicyImpl.java new file mode 100644 index 0000000000000..1f6ce5e0b2fbe --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ObjectReplicationPolicyImpl.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.ObjectReplicationPolicy; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ObjectReplicationPolicyRule; + +class ObjectReplicationPolicyImpl extends CreatableUpdatableImpl implements ObjectReplicationPolicy, ObjectReplicationPolicy.Definition, ObjectReplicationPolicy.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private String objectReplicationPolicyId; + + ObjectReplicationPolicyImpl(String name, StorageManager manager) { + super(name, new ObjectReplicationPolicyInner()); + this.manager = manager; + // Set resource name + this.objectReplicationPolicyId = name; + // + } + + ObjectReplicationPolicyImpl(ObjectReplicationPolicyInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.objectReplicationPolicyId = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + this.objectReplicationPolicyId = IdParsingUtils.getValueFromIdByName(inner.id(), "objectReplicationPolicies"); + // + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ObjectReplicationPoliciesInner client = this.manager().inner().objectReplicationPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.objectReplicationPolicyId, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ObjectReplicationPoliciesInner client = this.manager().inner().objectReplicationPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName, this.objectReplicationPolicyId, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ObjectReplicationPoliciesInner client = this.manager().inner().objectReplicationPolicies(); + return client.getAsync(this.resourceGroupName, this.accountName, this.objectReplicationPolicyId); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String destinationAccount() { + return this.inner().destinationAccount(); + } + + @Override + public DateTime enabledTime() { + return this.inner().enabledTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String policyId() { + return this.inner().policyId(); + } + + @Override + public List rules() { + return this.inner().rules(); + } + + @Override + public String sourceAccount() { + return this.inner().sourceAccount(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ObjectReplicationPolicyImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public ObjectReplicationPolicyImpl withDestinationAccount(String destinationAccount) { + this.inner().withDestinationAccount(destinationAccount); + return this; + } + + @Override + public ObjectReplicationPolicyImpl withSourceAccount(String sourceAccount) { + this.inner().withSourceAccount(sourceAccount); + return this; + } + + @Override + public ObjectReplicationPolicyImpl withRules(List rules) { + this.inner().withRules(rules); + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ObjectReplicationPolicyInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ObjectReplicationPolicyInner.java new file mode 100644 index 0000000000000..c238497f9bba5 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/ObjectReplicationPolicyInner.java @@ -0,0 +1,132 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ObjectReplicationPolicyRule; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The replication policy between two storage accounts. Multiple rules can be + * defined in one policy. + */ +@JsonFlatten +public class ObjectReplicationPolicyInner extends ProxyResource { + /** + * A unique id for object replication policy. + */ + @JsonProperty(value = "properties.policyId", access = JsonProperty.Access.WRITE_ONLY) + private String policyId; + + /** + * Indicates when the policy is enabled on the source account. + */ + @JsonProperty(value = "properties.enabledTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime enabledTime; + + /** + * Required. Source account name. + */ + @JsonProperty(value = "properties.sourceAccount", required = true) + private String sourceAccount; + + /** + * Required. Destination account name. + */ + @JsonProperty(value = "properties.destinationAccount", required = true) + private String destinationAccount; + + /** + * The storage account object replication rules. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /** + * Get a unique id for object replication policy. + * + * @return the policyId value + */ + public String policyId() { + return this.policyId; + } + + /** + * Get indicates when the policy is enabled on the source account. + * + * @return the enabledTime value + */ + public DateTime enabledTime() { + return this.enabledTime; + } + + /** + * Get required. Source account name. + * + * @return the sourceAccount value + */ + public String sourceAccount() { + return this.sourceAccount; + } + + /** + * Set required. Source account name. + * + * @param sourceAccount the sourceAccount value to set + * @return the ObjectReplicationPolicyInner object itself. + */ + public ObjectReplicationPolicyInner withSourceAccount(String sourceAccount) { + this.sourceAccount = sourceAccount; + return this; + } + + /** + * Get required. Destination account name. + * + * @return the destinationAccount value + */ + public String destinationAccount() { + return this.destinationAccount; + } + + /** + * Set required. Destination account name. + * + * @param destinationAccount the destinationAccount value to set + * @return the ObjectReplicationPolicyInner object itself. + */ + public ObjectReplicationPolicyInner withDestinationAccount(String destinationAccount) { + this.destinationAccount = destinationAccount; + return this; + } + + /** + * Get the storage account object replication rules. + * + * @return the rules value + */ + public List rules() { + return this.rules; + } + + /** + * Set the storage account object replication rules. + * + * @param rules the rules value to set + * @return the ObjectReplicationPolicyInner object itself. + */ + public ObjectReplicationPolicyInner withRules(List rules) { + this.rules = rules; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/OperationImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/OperationImpl.java new file mode 100644 index 0000000000000..a1563b8f2db63 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/OperationImpl.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.OperationDisplay; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ServiceSpecification; + +class OperationImpl extends WrapperImpl implements Operation { + private final StorageManager manager; + OperationImpl(OperationInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public ServiceSpecification serviceSpecification() { + return this.inner().serviceSpecification(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/OperationInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/OperationInner.java new file mode 100644 index 0000000000000..e678de178632c --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/OperationInner.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.OperationDisplay; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ServiceSpecification; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Storage REST API operation definition. + */ +@JsonFlatten +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display metadata associated with the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * The origin of operations. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * One property of operation, include metric specifications. + */ + @JsonProperty(value = "properties.serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get display metadata associated with the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set display metadata associated with the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin of operations. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin of operations. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get one property of operation, include metric specifications. + * + * @return the serviceSpecification value + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set one property of operation, include metric specifications. + * + * @param serviceSpecification the serviceSpecification value to set + * @return the OperationInner object itself. + */ + public OperationInner withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/OperationsImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..83ee63437622b --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final StorageManager manager; + + OperationsImpl(StorageManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/OperationsInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..ca83b79d91afb --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/OperationsInner.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.Operations list" }) + @GET("providers/Microsoft.Storage/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<OperationInner> object if successful. + */ + public List list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PageImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..723b1c824eb3b --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PageImpl1.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PageImpl1.java new file mode 100644 index 0000000000000..b3f9f959be661 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PageImpl1.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateEndpointConnectionImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..0ab465659d161 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.PrivateEndpointConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.PrivateEndpoint; +import com.microsoft.azure.management.storage.v2019_08_01_preview.PrivateLinkServiceConnectionState; +import com.microsoft.azure.management.storage.v2019_08_01_preview.PrivateEndpointConnectionProvisioningState; + +class PrivateEndpointConnectionImpl extends CreatableUpdatableImpl implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private String privateEndpointConnectionName; + + PrivateEndpointConnectionImpl(String name, StorageManager manager) { + super(name, new PrivateEndpointConnectionInner()); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = name; + // + } + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + this.privateEndpointConnectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateEndpointConnections"); + // + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.putAsync(this.resourceGroupName, this.accountName, this.privateEndpointConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.putAsync(this.resourceGroupName, this.accountName, this.privateEndpointConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.getAsync(this.resourceGroupName, this.accountName, this.privateEndpointConnectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PrivateEndpoint privateEndpoint() { + return this.inner().privateEndpoint(); + } + + @Override + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.inner().privateLinkServiceConnectionState(); + } + + @Override + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public PrivateEndpointConnectionImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.inner().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + @Override + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.inner().withPrivateEndpoint(privateEndpoint); + return this; + } + + @Override + public PrivateEndpointConnectionImpl withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateEndpointConnectionInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..df3d39969a38c --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateEndpointConnectionInner.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.PrivateEndpoint; +import com.microsoft.azure.management.storage.v2019_08_01_preview.PrivateLinkServiceConnectionState; +import com.microsoft.azure.management.storage.v2019_08_01_preview.PrivateEndpointConnectionProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The Private Endpoint Connection resource. + */ +@JsonFlatten +public class PrivateEndpointConnectionInner extends ProxyResource { + /** + * The resource of private end point. + */ + @JsonProperty(value = "properties.privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /** + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * The provisioning state of the private endpoint connection resource. + * Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState") + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Get the resource of private end point. + * + * @return the privateEndpoint value + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get a collection of information about the state of the connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set a collection of information about the state of the connection between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioning state of the private endpoint connection resource. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the private endpoint connection resource. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed'. + * + * @param provisioningState the provisioningState value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateEndpointConnectionsImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..5c65198b5c888 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.PrivateEndpointConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_08_01_preview.PrivateEndpointConnection; + +class PrivateEndpointConnectionsImpl extends WrapperImpl implements PrivateEndpointConnections { + private final StorageManager manager; + + PrivateEndpointConnectionsImpl(StorageManager manager) { + super(manager.inner().privateEndpointConnections()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public PrivateEndpointConnectionImpl define(String name) { + return wrapModel(name); + } + + private PrivateEndpointConnectionImpl wrapModel(PrivateEndpointConnectionInner inner) { + return new PrivateEndpointConnectionImpl(inner, manager()); + } + + private PrivateEndpointConnectionImpl wrapModel(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public PrivateEndpointConnection call(PrivateEndpointConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, privateEndpointConnectionName) + .flatMap(new Func1>() { + @Override + public Observable call(PrivateEndpointConnectionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((PrivateEndpointConnection)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, privateEndpointConnectionName).toCompletable(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateEndpointConnectionsInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateEndpointConnectionsInner.java new file mode 100644 index 0000000000000..75e5ff2eea5fc --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateEndpointConnectionsInner.java @@ -0,0 +1,456 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateEndpointConnections. + */ +public class PrivateEndpointConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private PrivateEndpointConnectionsService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateEndpointConnectionsInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(PrivateEndpointConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateEndpointConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.PrivateEndpointConnections list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections") + 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.v2019_08_01_preview.PrivateEndpointConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.PrivateEndpointConnections put" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> put(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Body PrivateEndpointConnectionInner properties, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.PrivateEndpointConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all the private endpoint connections associated with the 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 List<PrivateEndpointConnectionInner> object if successful. + */ + public List list(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * List all the private endpoint connections associated with the 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> listAsync(String resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * List all the private endpoint connections associated with the 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 List<PrivateEndpointConnectionInner> object + */ + public Observable> listAsync(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the private endpoint connections associated with the 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 List<PrivateEndpointConnectionInner> 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> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner get(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Gets the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure 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 getAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Gets the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + 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 (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName 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, this.client.subscriptionId(), privateEndpointConnectionName, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Update the state of specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner put(String resourceGroupName, String accountName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { + return putWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, properties).toBlocking().single().body(); + } + + /** + * Update the state of specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @param properties The private endpoint connection properties. + * @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 putAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, properties), serviceCallback); + } + + /** + * Update the state of specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable putAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { + return putWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, properties).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the state of specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> putWithServiceResponseAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { + 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 (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName 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 (properties == null) { + throw new IllegalArgumentException("Parameter properties is required and cannot be null."); + } + Validator.validate(properties); + return service.put(resourceGroupName, accountName, this.client.subscriptionId(), privateEndpointConnectionName, this.client.apiVersion(), properties, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 privateEndpointConnectionName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Deletes the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure 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 deleteAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Deletes the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + 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 (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(resourceGroupName, accountName, this.client.subscriptionId(), privateEndpointConnectionName, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateLinkResourceInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateLinkResourceInner.java new file mode 100644 index 0000000000000..25c84c66f3d6d --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateLinkResourceInner.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A private link resource. + */ +@JsonFlatten +public class PrivateLinkResourceInner extends ProxyResource { + /** + * The private link resource group id. + */ + @JsonProperty(value = "properties.groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /** + * The private link resource required member names. + */ + @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /** + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "properties.requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the private link resource group id. + * + * @return the groupId value + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the private link resource required member names. + * + * @return the requiredMembers value + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateLinkResourceListResultImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateLinkResourceListResultImpl.java new file mode 100644 index 0000000000000..f010d37e332cc --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateLinkResourceListResultImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.PrivateLinkResourceListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class PrivateLinkResourceListResultImpl extends WrapperImpl implements PrivateLinkResourceListResult { + private final StorageManager manager; + PrivateLinkResourceListResultImpl(PrivateLinkResourceListResultInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateLinkResourceListResultInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateLinkResourceListResultInner.java new file mode 100644 index 0000000000000..5b6cb6eb83a9a --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateLinkResourceListResultInner.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A list of private link resources. + */ +public class PrivateLinkResourceListResultInner { + /** + * Array of private link resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get array of private link resources. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set array of private link resources. + * + * @param value the value value to set + * @return the PrivateLinkResourceListResultInner object itself. + */ + public PrivateLinkResourceListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateLinkResourcesImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..da10eba5b36af --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.PrivateLinkResources; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.PrivateLinkResourceListResult; + +class PrivateLinkResourcesImpl extends WrapperImpl implements PrivateLinkResources { + private final StorageManager manager; + + PrivateLinkResourcesImpl(StorageManager manager) { + super(manager.inner().privateLinkResources()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable listByStorageAccountAsync(String resourceGroupName, String accountName) { + PrivateLinkResourcesInner client = this.inner(); + return client.listByStorageAccountAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public PrivateLinkResourceListResult call(PrivateLinkResourceListResultInner inner) { + return new PrivateLinkResourceListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateLinkResourcesInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateLinkResourcesInner.java new file mode 100644 index 0000000000000..f7d4ee0c87024 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/PrivateLinkResourcesInner.java @@ -0,0 +1,146 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateLinkResources. + */ +public class PrivateLinkResourcesInner { + /** The Retrofit service to perform REST calls. */ + private PrivateLinkResourcesService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateLinkResourcesInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(PrivateLinkResourcesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateLinkResources to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateLinkResourcesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.PrivateLinkResources listByStorageAccount" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateLinkResources") + Observable> listByStorageAccount(@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); + + } + + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 PrivateLinkResourceListResultInner object if successful. + */ + public PrivateLinkResourceListResultInner listByStorageAccount(String resourceGroupName, String accountName) { + return listByStorageAccountWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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 listByStorageAccountAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByStorageAccountWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkResourceListResultInner object + */ + public Observable listByStorageAccountAsync(String resourceGroupName, String accountName) { + return listByStorageAccountWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, PrivateLinkResourceListResultInner>() { + @Override + public PrivateLinkResourceListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkResourceListResultInner object + */ + public Observable> listByStorageAccountWithServiceResponseAsync(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.listByStorageAccount(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 = listByStorageAccountDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByStorageAccountDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/QueueServicePropertiesImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/QueueServicePropertiesImpl.java new file mode 100644 index 0000000000000..7882ee475162f --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/QueueServicePropertiesImpl.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.QueueServiceProperties; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.CorsRules; +import java.util.List; +import rx.functions.Func1; + +class QueueServicePropertiesImpl extends CreatableUpdatableImpl implements QueueServiceProperties, QueueServiceProperties.Definition, QueueServiceProperties.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private CorsRules ccors; + private CorsRules ucors; + + QueueServicePropertiesImpl(String name, StorageManager manager) { + super(name, new QueueServicePropertiesInner()); + this.manager = manager; + // Set resource name + this.accountName = name; + // + this.ccors = new CorsRules(); + this.ucors = new CorsRules(); + } + + QueueServicePropertiesImpl(QueueServicePropertiesInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.accountName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + // + this.ccors = new CorsRules(); + this.ucors = new CorsRules(); + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + QueueServicesInner client = this.manager().inner().queueServices(); + return client.setServicePropertiesAsync(this.resourceGroupName, this.accountName, this.ccors) + .map(new Func1() { + @Override + public QueueServicePropertiesInner call(QueueServicePropertiesInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + QueueServicesInner client = this.manager().inner().queueServices(); + return client.setServicePropertiesAsync(this.resourceGroupName, this.accountName, this.ucors) + .map(new Func1() { + @Override + public QueueServicePropertiesInner call(QueueServicePropertiesInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + QueueServicesInner client = this.manager().inner().queueServices(); + return client.getServicePropertiesAsync(this.resourceGroupName, this.accountName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.ccors = new CorsRules(); + this.ucors = new CorsRules(); + } + + @Override + public CorsRules cors() { + return this.inner().cors(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public QueueServicePropertiesImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public QueueServicePropertiesImpl withCors(CorsRules cors) { + if (isInCreateMode()) { + this.ccors = cors; + } else { + this.ucors = cors; + } + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/QueueServicePropertiesInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/QueueServicePropertiesInner.java new file mode 100644 index 0000000000000..9372b410d7817 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/QueueServicePropertiesInner.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.CorsRules; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The properties of a storage account’s Queue service. + */ +@JsonFlatten +public class QueueServicePropertiesInner extends ProxyResource { + /** + * Specifies CORS rules for the Queue service. You can include up to five + * CorsRule elements in the request. If no CorsRule elements are included + * in the request body, all CORS rules will be deleted, and CORS will be + * disabled for the Queue service. + */ + @JsonProperty(value = "properties.cors") + private CorsRules cors; + + /** + * Get specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Queue service. + * + * @return the cors value + */ + public CorsRules cors() { + return this.cors; + } + + /** + * Set specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Queue service. + * + * @param cors the cors value to set + * @return the QueueServicePropertiesInner object itself. + */ + public QueueServicePropertiesInner withCors(CorsRules cors) { + this.cors = cors; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/QueueServicesImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/QueueServicesImpl.java new file mode 100644 index 0000000000000..8506b6ebcfaa4 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/QueueServicesImpl.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.QueueServices; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ListQueueServices; +import com.microsoft.azure.management.storage.v2019_08_01_preview.QueueServiceProperties; + +class QueueServicesImpl extends WrapperImpl implements QueueServices { + private final StorageManager manager; + + QueueServicesImpl(StorageManager manager) { + super(manager.inner().queueServices()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public QueueServicePropertiesImpl define(String name) { + return wrapModel(name); + } + + private QueueServicePropertiesImpl wrapModel(QueueServicePropertiesInner inner) { + return new QueueServicePropertiesImpl(inner, manager()); + } + + private QueueServicePropertiesImpl wrapModel(String name) { + return new QueueServicePropertiesImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName) { + QueueServicesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public ListQueueServices call(ListQueueServicesInner inner) { + return new ListQueueServicesImpl(inner, manager()); + } + }); + } + + @Override + public Observable getServicePropertiesAsync(String resourceGroupName, String accountName) { + QueueServicesInner client = this.inner(); + return client.getServicePropertiesAsync(resourceGroupName, accountName) + .flatMap(new Func1>() { + @Override + public Observable call(QueueServicePropertiesInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((QueueServiceProperties)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/QueueServicesInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/QueueServicesInner.java new file mode 100644 index 0000000000000..5db393459236c --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/QueueServicesInner.java @@ -0,0 +1,422 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.storage.v2019_08_01_preview.CorsRules; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in QueueServices. + */ +public class QueueServicesInner { + /** The Retrofit service to perform REST calls. */ + private QueueServicesService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of QueueServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public QueueServicesInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(QueueServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for QueueServices to be + * used by Retrofit to perform actually REST calls. + */ + interface QueueServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.QueueServices list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices") + 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.v2019_08_01_preview.QueueServices setServiceProperties" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}") + Observable> setServiceProperties(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("queueServiceName") String queueServiceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body QueueServicePropertiesInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.QueueServices getServiceProperties" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}") + Observable> getServiceProperties(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("queueServiceName") String queueServiceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all queue services for the 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 ListQueueServicesInner object if successful. + */ + public ListQueueServicesInner list(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * List all queue services for the 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 listAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * List all queue services for the 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 ListQueueServicesInner object + */ + public Observable listAsync(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, ListQueueServicesInner>() { + @Override + public ListQueueServicesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List all queue services for the 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 ListQueueServicesInner 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); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the QueueServicePropertiesInner object if successful. + */ + public QueueServicePropertiesInner setServiceProperties(String resourceGroupName, String accountName) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setServicePropertiesAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueueServicePropertiesInner object + */ + public Observable setServicePropertiesAsync(String resourceGroupName, String accountName) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, QueueServicePropertiesInner>() { + @Override + public QueueServicePropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueueServicePropertiesInner object + */ + public Observable> setServicePropertiesWithServiceResponseAsync(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 queueServiceName = "default"; + final CorsRules cors = null; + QueueServicePropertiesInner parameters = new QueueServicePropertiesInner(); + parameters.withCors(null); + return service.setServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), queueServiceName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setServicePropertiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param cors Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Queue service. + * @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 QueueServicePropertiesInner object if successful. + */ + public QueueServicePropertiesInner setServiceProperties(String resourceGroupName, String accountName, CorsRules cors) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, cors).toBlocking().single().body(); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param cors Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Queue service. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setServicePropertiesAsync(String resourceGroupName, String accountName, CorsRules cors, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, cors), serviceCallback); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param cors Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Queue service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueueServicePropertiesInner object + */ + public Observable setServicePropertiesAsync(String resourceGroupName, String accountName, CorsRules cors) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, cors).map(new Func1, QueueServicePropertiesInner>() { + @Override + public QueueServicePropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param cors Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Queue service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueueServicePropertiesInner object + */ + public Observable> setServicePropertiesWithServiceResponseAsync(String resourceGroupName, String accountName, CorsRules cors) { + 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."); + } + Validator.validate(cors); + final String queueServiceName = "default"; + QueueServicePropertiesInner parameters = new QueueServicePropertiesInner(); + parameters.withCors(cors); + return service.setServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), queueServiceName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setServicePropertiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse setServicePropertiesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the QueueServicePropertiesInner object if successful. + */ + public QueueServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) { + return getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServicePropertiesAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueueServicePropertiesInner object + */ + public Observable getServicePropertiesAsync(String resourceGroupName, String accountName) { + return getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, QueueServicePropertiesInner>() { + @Override + public QueueServicePropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueueServicePropertiesInner object + */ + public Observable> getServicePropertiesWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String queueServiceName = "default"; + return service.getServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), queueServiceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServicePropertiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getServicePropertiesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/QueuesImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/QueuesImpl.java new file mode 100644 index 0000000000000..ccba3bc7fdf51 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/QueuesImpl.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Queues; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.storage.v2019_08_01_preview.StorageQueue; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ListQueue; + +class QueuesImpl extends WrapperImpl implements Queues { + private final StorageManager manager; + + QueuesImpl(StorageManager manager) { + super(manager.inner().queues()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public StorageQueueImpl define(String name) { + return wrapModel(name); + } + + private StorageQueueImpl wrapModel(StorageQueueInner inner) { + return new StorageQueueImpl(inner, manager()); + } + + private StorageQueueImpl wrapModel(String name) { + return new StorageQueueImpl(name, this.manager()); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String queueName) { + QueuesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, queueName) + .map(new Func1() { + @Override + public StorageQueue call(StorageQueueInner inner) { + return new StorageQueueImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String queueName) { + QueuesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, queueName).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + QueuesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ListQueue call(ListQueueInner inner) { + return new ListQueueImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/QueuesInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/QueuesInner.java new file mode 100644 index 0000000000000..4f41b25802b38 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/QueuesInner.java @@ -0,0 +1,1017 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import 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.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Queues. + */ +public class QueuesInner { + /** The Retrofit service to perform REST calls. */ + private QueuesService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of QueuesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public QueuesInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(QueuesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Queues to be + * used by Retrofit to perform actually REST calls. + */ + interface QueuesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.Queues create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("queueName") String queueName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StorageQueueInner queue, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.Queues update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("queueName") String queueName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StorageQueueInner queue, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.Queues get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("queueName") String queueName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.Queues delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("queueName") String queueName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.Queues list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$maxpagesize") String maxpagesize, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.Queues listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates a new queue with the specified queue name, under the specified 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 queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @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 StorageQueueInner object if successful. + */ + public StorageQueueInner create(String resourceGroupName, String accountName, String queueName) { + return createWithServiceResponseAsync(resourceGroupName, accountName, queueName).toBlocking().single().body(); + } + + /** + * Creates a new queue with the specified queue name, under the specified 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 queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @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 queueName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, queueName), serviceCallback); + } + + /** + * Creates a new queue with the specified queue name, under the specified 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 queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageQueueInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String queueName) { + return createWithServiceResponseAsync(resourceGroupName, accountName, queueName).map(new Func1, StorageQueueInner>() { + @Override + public StorageQueueInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new queue with the specified queue name, under the specified 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 queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageQueueInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String queueName) { + 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 (queueName == null) { + throw new IllegalArgumentException("Parameter queueName 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 Map metadata = null; + StorageQueueInner queue = new StorageQueueInner(); + queue.withMetadata(null); + return service.create(resourceGroupName, accountName, this.client.subscriptionId(), queueName, this.client.apiVersion(), this.client.acceptLanguage(), queue, 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 queue with the specified queue name, under the specified 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 queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param metadata A name-value pair that represents queue 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 StorageQueueInner object if successful. + */ + public StorageQueueInner create(String resourceGroupName, String accountName, String queueName, Map metadata) { + return createWithServiceResponseAsync(resourceGroupName, accountName, queueName, metadata).toBlocking().single().body(); + } + + /** + * Creates a new queue with the specified queue name, under the specified 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 queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param metadata A name-value pair that represents queue 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 queueName, Map metadata, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, queueName, metadata), serviceCallback); + } + + /** + * Creates a new queue with the specified queue name, under the specified 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 queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param metadata A name-value pair that represents queue metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageQueueInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String queueName, Map metadata) { + return createWithServiceResponseAsync(resourceGroupName, accountName, queueName, metadata).map(new Func1, StorageQueueInner>() { + @Override + public StorageQueueInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new queue with the specified queue name, under the specified 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 queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param metadata A name-value pair that represents queue metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageQueueInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String queueName, 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 (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (queueName == null) { + throw new IllegalArgumentException("Parameter queueName 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); + StorageQueueInner queue = new StorageQueueInner(); + queue.withMetadata(metadata); + return service.create(resourceGroupName, accountName, this.client.subscriptionId(), queueName, this.client.apiVersion(), this.client.acceptLanguage(), queue, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a new queue with the specified queue name, under the specified 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 queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @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 StorageQueueInner object if successful. + */ + public StorageQueueInner update(String resourceGroupName, String accountName, String queueName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, queueName).toBlocking().single().body(); + } + + /** + * Creates a new queue with the specified queue name, under the specified 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 queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @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 queueName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, queueName), serviceCallback); + } + + /** + * Creates a new queue with the specified queue name, under the specified 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 queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageQueueInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String queueName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, queueName).map(new Func1, StorageQueueInner>() { + @Override + public StorageQueueInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new queue with the specified queue name, under the specified 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 queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageQueueInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String queueName) { + 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 (queueName == null) { + throw new IllegalArgumentException("Parameter queueName 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 Map metadata = null; + StorageQueueInner queue = new StorageQueueInner(); + queue.withMetadata(null); + return service.update(resourceGroupName, accountName, this.client.subscriptionId(), queueName, this.client.apiVersion(), this.client.acceptLanguage(), queue, 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); + } + } + }); + } + + /** + * Creates a new queue with the specified queue name, under the specified 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 queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param metadata A name-value pair that represents queue 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 StorageQueueInner object if successful. + */ + public StorageQueueInner update(String resourceGroupName, String accountName, String queueName, Map metadata) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, queueName, metadata).toBlocking().single().body(); + } + + /** + * Creates a new queue with the specified queue name, under the specified 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 queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param metadata A name-value pair that represents queue 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 queueName, Map metadata, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, queueName, metadata), serviceCallback); + } + + /** + * Creates a new queue with the specified queue name, under the specified 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 queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param metadata A name-value pair that represents queue metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageQueueInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String queueName, Map metadata) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, queueName, metadata).map(new Func1, StorageQueueInner>() { + @Override + public StorageQueueInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new queue with the specified queue name, under the specified 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 queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param metadata A name-value pair that represents queue metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageQueueInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String queueName, 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 (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (queueName == null) { + throw new IllegalArgumentException("Parameter queueName 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); + StorageQueueInner queue = new StorageQueueInner(); + queue.withMetadata(metadata); + return service.update(resourceGroupName, accountName, this.client.subscriptionId(), queueName, this.client.apiVersion(), this.client.acceptLanguage(), queue, 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 the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @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 StorageQueueInner object if successful. + */ + public StorageQueueInner get(String resourceGroupName, String accountName, String queueName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, queueName).toBlocking().single().body(); + } + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @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 queueName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, queueName), serviceCallback); + } + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageQueueInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String queueName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, queueName).map(new Func1, StorageQueueInner>() { + @Override + public StorageQueueInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageQueueInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String queueName) { + 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 (queueName == null) { + throw new IllegalArgumentException("Parameter queueName 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, this.client.subscriptionId(), queueName, 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 the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @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 queueName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, queueName).toBlocking().single().body(); + } + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @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 queueName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, queueName), serviceCallback); + } + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String queueName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, queueName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String queueName) { + 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 (queueName == null) { + throw new IllegalArgumentException("Parameter queueName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(resourceGroupName, accountName, this.client.subscriptionId(), queueName, 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(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of all the queues under 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 PagedList<ListQueueInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all the queues under 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> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of all the queues under 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 PagedList<ListQueueInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all the queues under 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 PagedList<ListQueueInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of all the queues under 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 PagedList<ListQueueInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String maxpagesize = null; + final String filter = null; + return service.list(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), maxpagesize, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a list of all the queues under 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 maxpagesize Optional, a maximum number of queues that should be included in a list queue response + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ListQueueInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all the queues under 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 maxpagesize Optional, a maximum number of queues that should be included in a list queue response + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be listed. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of all the queues under 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 maxpagesize Optional, a maximum number of queues that should be included in a list queue response + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ListQueueInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter) { + return listWithServiceResponseAsync(resourceGroupName, accountName, maxpagesize, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all the queues under 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 maxpagesize Optional, a maximum number of queues that should be included in a list queue response + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ListQueueInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter) { + return listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + ServiceResponse> * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ServiceResponse> * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response + ServiceResponse> * @param filter Optional, When specified, only the queues with a name starting with the given filter will be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ListQueueInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), maxpagesize, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ListQueueInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ListQueueInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ListQueueInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ListQueueInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/SkuInformationImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/SkuInformationImpl.java new file mode 100644 index 0000000000000..d628d1d08eb19 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/SkuInformationImpl.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.SkuInformation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_08_01_preview.SKUCapability; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Kind; +import com.microsoft.azure.management.storage.v2019_08_01_preview.SkuName; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Restriction; +import com.microsoft.azure.management.storage.v2019_08_01_preview.SkuTier; + +class SkuInformationImpl extends WrapperImpl implements SkuInformation { + private final StorageManager manager; + + SkuInformationImpl(SkuInformationInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + + + @Override + public List capabilities() { + return this.inner().capabilities(); + } + + @Override + public Kind kind() { + return this.inner().kind(); + } + + @Override + public List locations() { + return this.inner().locations(); + } + + @Override + public SkuName name() { + return this.inner().name(); + } + + @Override + public String resourceType() { + return this.inner().resourceType(); + } + + @Override + public List restrictions() { + return this.inner().restrictions(); + } + + @Override + public SkuTier tier() { + return this.inner().tier(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/SkuInformationInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/SkuInformationInner.java new file mode 100644 index 0000000000000..0b55ae0f41145 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/SkuInformationInner.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.SkuName; +import com.microsoft.azure.management.storage.v2019_08_01_preview.SkuTier; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Kind; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_08_01_preview.SKUCapability; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Restriction; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Storage SKU and its properties. + */ +public class SkuInformationInner { + /** + * Possible values include: 'Standard_LRS', 'Standard_GRS', + * 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS', + * 'Standard_GZRS', 'Standard_RAGZRS'. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /** + * Possible values include: 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier") + private SkuTier tier; + + /** + * The type of the resource, usually it is 'storageAccounts'. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /** + * Indicates the type of storage account. Possible values include: + * 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage'. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private Kind kind; + + /** + * The set of locations that the SKU is available. This will be supported + * and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, + * etc.). + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /** + * The capability information in the specified SKU, including file + * encryption, network ACLs, change notification, etc. + */ + @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) + private List capabilities; + + /** + * The restrictions because of which SKU cannot be used. This is empty if + * there are no restrictions. + */ + @JsonProperty(value = "restrictions") + private List restrictions; + + /** + * Get possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'. + * + * @return the name value + */ + public SkuName name() { + return this.name; + } + + /** + * Set possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'. + * + * @param name the name value to set + * @return the SkuInformationInner object itself. + */ + public SkuInformationInner withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get possible values include: 'Standard', 'Premium'. + * + * @return the tier value + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Set possible values include: 'Standard', 'Premium'. + * + * @param tier the tier value to set + * @return the SkuInformationInner object itself. + */ + public SkuInformationInner withTier(SkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the type of the resource, usually it is 'storageAccounts'. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + * + * @return the kind value + */ + public Kind kind() { + return this.kind; + } + + /** + * Get the set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + + /** + * Get the capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. + * + * @return the capabilities value + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Get the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + * + * @return the restrictions value + */ + public List restrictions() { + return this.restrictions; + } + + /** + * Set the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + * + * @param restrictions the restrictions value to set + * @return the SkuInformationInner object itself. + */ + public SkuInformationInner withRestrictions(List restrictions) { + this.restrictions = restrictions; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/SkuInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/SkuInner.java new file mode 100644 index 0000000000000..133d04c0e5bb8 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/SkuInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.SkuName; +import com.microsoft.azure.management.storage.v2019_08_01_preview.SkuTier; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SKU of the storage account. + */ +public class SkuInner { + /** + * Possible values include: 'Standard_LRS', 'Standard_GRS', + * 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS', + * 'Standard_GZRS', 'Standard_RAGZRS'. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /** + * Possible values include: 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier") + private SkuTier tier; + + /** + * Get possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'. + * + * @return the name value + */ + public SkuName name() { + return this.name; + } + + /** + * Set possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'. + * + * @param name the name value to set + * @return the SkuInner object itself. + */ + public SkuInner withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get possible values include: 'Standard', 'Premium'. + * + * @return the tier value + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Set possible values include: 'Standard', 'Premium'. + * + * @param tier the tier value to set + * @return the SkuInner object itself. + */ + public SkuInner withTier(SkuTier tier) { + this.tier = tier; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/SkusImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/SkusImpl.java new file mode 100644 index 0000000000000..3fabcc975e556 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/SkusImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * jkl + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Skus; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.arm.utils.PagedListConverter; +import com.microsoft.azure.management.storage.v2019_08_01_preview.SkuInformation; + +class SkusImpl extends WrapperImpl implements Skus { + private PagedListConverter converter; + private final StorageManager manager; + + SkusImpl(StorageManager manager) { + super(manager.inner().skus()); + this.manager = manager; + this.converter = new PagedListConverter() { + @Override + public Observable typeConvertAsync(SkuInformationInner inner) { + return Observable.just((SkuInformation) wrapModel(inner)); + } + }; + } + + public StorageManager manager() { + return this.manager; + } + + private SkuInformationImpl wrapModel(SkuInformationInner inner) { + return new SkuInformationImpl(inner, manager()); + } + + @Override + public PagedList list() { + SkusInner client = this.inner(); + return converter.convert(client.list()); + } + + @Override + public Observable listAsync() { + SkusInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public SkuInformation call(SkuInformationInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/SkusInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/SkusInner.java new file mode 100644 index 0000000000000..349f31ef16c84 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/SkusInner.java @@ -0,0 +1,144 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Skus. + */ +public class SkusInner { + /** The Retrofit service to perform REST calls. */ + private SkusService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of SkusInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SkusInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(SkusService.class); + this.client = client; + } + + /** + * The interface defining all the services for Skus to be + * used by Retrofit to perform actually REST calls. + */ + interface SkusService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.Skus list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @return the observable to the List<SkuInformationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @return the observable to the List<SkuInformationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageAccountImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageAccountImpl.java new file mode 100644 index 0000000000000..3f10d8fe88cb8 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageAccountImpl.java @@ -0,0 +1,386 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccount; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccountUpdateParameters; +import com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccountCreateParameters; +import com.microsoft.azure.management.storage.v2019_08_01_preview.AccessTier; +import com.microsoft.azure.management.storage.v2019_08_01_preview.AzureFilesIdentityBasedAuthentication; +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobRestoreStatus; +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_08_01_preview.CustomDomain; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Encryption; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ExtendedLocation; +import com.microsoft.azure.management.storage.v2019_08_01_preview.GeoReplicationStats; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Identity; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Kind; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LargeFileSharesState; +import com.microsoft.azure.management.storage.v2019_08_01_preview.MinimumTlsVersion; +import com.microsoft.azure.management.storage.v2019_08_01_preview.NetworkRuleSet; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Endpoints; +import java.util.ArrayList; +import com.microsoft.azure.management.storage.v2019_08_01_preview.PrivateEndpointConnection; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ProvisioningState; +import com.microsoft.azure.management.storage.v2019_08_01_preview.RoutingPreference; +import com.microsoft.azure.management.storage.v2019_08_01_preview.AccountStatus; +import rx.functions.Func1; + +class StorageAccountImpl extends GroupableResourceCoreImpl implements StorageAccount, StorageAccount.Definition, StorageAccount.Update { + private StorageAccountCreateParameters createParameter; + private StorageAccountUpdateParameters updateParameter; + StorageAccountImpl(String name, StorageAccountInner inner, StorageManager manager) { + super(name, inner, manager); + this.createParameter = new StorageAccountCreateParameters(); + this.updateParameter = new StorageAccountUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + StorageAccountsInner client = this.manager().inner().storageAccounts(); + this.createParameter.withLocation(inner().location()); + this.createParameter.withTags(inner().getTags()); + return client.createAsync(this.resourceGroupName(), this.name(), this.createParameter) + .map(new Func1() { + @Override + public StorageAccountInner call(StorageAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + StorageAccountsInner client = this.manager().inner().storageAccounts(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public StorageAccountInner call(StorageAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + StorageAccountsInner client = this.manager().inner().storageAccounts(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new StorageAccountCreateParameters(); + this.updateParameter = new StorageAccountUpdateParameters(); + } + + @Override + public AccessTier accessTier() { + return this.inner().accessTier(); + } + + @Override + public Boolean allowBlobPublicAccess() { + return this.inner().allowBlobPublicAccess(); + } + + @Override + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.inner().azureFilesIdentityBasedAuthentication(); + } + + @Override + public BlobRestoreStatus blobRestoreStatus() { + BlobRestoreStatusInner inner = this.inner().blobRestoreStatus(); + if (inner != null) { + return new BlobRestoreStatusImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public DateTime creationTime() { + return this.inner().creationTime(); + } + + @Override + public CustomDomain customDomain() { + return this.inner().customDomain(); + } + + @Override + public Boolean enableHttpsTrafficOnly() { + return this.inner().enableHttpsTrafficOnly(); + } + + @Override + public Encryption encryption() { + return this.inner().encryption(); + } + + @Override + public ExtendedLocation extendedLocation() { + return this.inner().extendedLocation(); + } + + @Override + public Boolean failoverInProgress() { + return this.inner().failoverInProgress(); + } + + @Override + public GeoReplicationStats geoReplicationStats() { + return this.inner().geoReplicationStats(); + } + + @Override + public Identity identity() { + return this.inner().identity(); + } + + @Override + public Boolean isHnsEnabled() { + return this.inner().isHnsEnabled(); + } + + @Override + public Kind kind() { + return this.inner().kind(); + } + + @Override + public LargeFileSharesState largeFileSharesState() { + return this.inner().largeFileSharesState(); + } + + @Override + public DateTime lastGeoFailoverTime() { + return this.inner().lastGeoFailoverTime(); + } + + @Override + public MinimumTlsVersion minimumTlsVersion() { + return this.inner().minimumTlsVersion(); + } + + @Override + public NetworkRuleSet networkRuleSet() { + return this.inner().networkRuleSet(); + } + + @Override + public Endpoints primaryEndpoints() { + return this.inner().primaryEndpoints(); + } + + @Override + public String primaryLocation() { + return this.inner().primaryLocation(); + } + + @Override + public List privateEndpointConnections() { + List lst = new ArrayList(); + if (this.inner().privateEndpointConnections() != null) { + for (PrivateEndpointConnectionInner inner : this.inner().privateEndpointConnections()) { + lst.add( new PrivateEndpointConnectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public RoutingPreference routingPreference() { + return this.inner().routingPreference(); + } + + @Override + public Endpoints secondaryEndpoints() { + return this.inner().secondaryEndpoints(); + } + + @Override + public String secondaryLocation() { + return this.inner().secondaryLocation(); + } + + @Override + public SkuInner sku() { + return this.inner().sku(); + } + + @Override + public AccountStatus statusOfPrimary() { + return this.inner().statusOfPrimary(); + } + + @Override + public AccountStatus statusOfSecondary() { + return this.inner().statusOfSecondary(); + } + + @Override + public StorageAccountImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.createParameter.withExtendedLocation(extendedLocation); + return this; + } + + @Override + public StorageAccountImpl withIsHnsEnabled(Boolean isHnsEnabled) { + this.createParameter.withIsHnsEnabled(isHnsEnabled); + return this; + } + + @Override + public StorageAccountImpl withKind(Kind kind) { + if (isInCreateMode()) { + this.createParameter.withKind(kind); + } else { + this.updateParameter.withKind(kind); + } + return this; + } + + @Override + public StorageAccountImpl withSku(SkuInner sku) { + if (isInCreateMode()) { + this.createParameter.withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + + @Override + public StorageAccountImpl withAccessTier(AccessTier accessTier) { + if (isInCreateMode()) { + this.createParameter.withAccessTier(accessTier); + } else { + this.updateParameter.withAccessTier(accessTier); + } + return this; + } + + @Override + public StorageAccountImpl withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + if (isInCreateMode()) { + this.createParameter.withAllowBlobPublicAccess(allowBlobPublicAccess); + } else { + this.updateParameter.withAllowBlobPublicAccess(allowBlobPublicAccess); + } + return this; + } + + @Override + public StorageAccountImpl withAzureFilesIdentityBasedAuthentication(AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + if (isInCreateMode()) { + this.createParameter.withAzureFilesIdentityBasedAuthentication(azureFilesIdentityBasedAuthentication); + } else { + this.updateParameter.withAzureFilesIdentityBasedAuthentication(azureFilesIdentityBasedAuthentication); + } + return this; + } + + @Override + public StorageAccountImpl withCustomDomain(CustomDomain customDomain) { + if (isInCreateMode()) { + this.createParameter.withCustomDomain(customDomain); + } else { + this.updateParameter.withCustomDomain(customDomain); + } + return this; + } + + @Override + public StorageAccountImpl withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + if (isInCreateMode()) { + this.createParameter.withEnableHttpsTrafficOnly(enableHttpsTrafficOnly); + } else { + this.updateParameter.withEnableHttpsTrafficOnly(enableHttpsTrafficOnly); + } + return this; + } + + @Override + public StorageAccountImpl withEncryption(Encryption encryption) { + if (isInCreateMode()) { + this.createParameter.withEncryption(encryption); + } else { + this.updateParameter.withEncryption(encryption); + } + return this; + } + + @Override + public StorageAccountImpl withIdentity(Identity identity) { + if (isInCreateMode()) { + this.createParameter.withIdentity(identity); + } else { + this.updateParameter.withIdentity(identity); + } + return this; + } + + @Override + public StorageAccountImpl withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { + if (isInCreateMode()) { + this.createParameter.withLargeFileSharesState(largeFileSharesState); + } else { + this.updateParameter.withLargeFileSharesState(largeFileSharesState); + } + return this; + } + + @Override + public StorageAccountImpl withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + if (isInCreateMode()) { + this.createParameter.withMinimumTlsVersion(minimumTlsVersion); + } else { + this.updateParameter.withMinimumTlsVersion(minimumTlsVersion); + } + return this; + } + + @Override + public StorageAccountImpl withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + if (isInCreateMode()) { + this.createParameter.withNetworkRuleSet(networkRuleSet); + } else { + this.updateParameter.withNetworkRuleSet(networkRuleSet); + } + return this; + } + + @Override + public StorageAccountImpl withRoutingPreference(RoutingPreference routingPreference) { + if (isInCreateMode()) { + this.createParameter.withRoutingPreference(routingPreference); + } else { + this.updateParameter.withRoutingPreference(routingPreference); + } + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageAccountInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageAccountInner.java new file mode 100644 index 0000000000000..e48642f6009b5 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageAccountInner.java @@ -0,0 +1,582 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.Kind; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Identity; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ExtendedLocation; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ProvisioningState; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Endpoints; +import com.microsoft.azure.management.storage.v2019_08_01_preview.AccountStatus; +import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_08_01_preview.CustomDomain; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Encryption; +import com.microsoft.azure.management.storage.v2019_08_01_preview.AccessTier; +import com.microsoft.azure.management.storage.v2019_08_01_preview.AzureFilesIdentityBasedAuthentication; +import com.microsoft.azure.management.storage.v2019_08_01_preview.NetworkRuleSet; +import com.microsoft.azure.management.storage.v2019_08_01_preview.GeoReplicationStats; +import com.microsoft.azure.management.storage.v2019_08_01_preview.LargeFileSharesState; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_08_01_preview.RoutingPreference; +import com.microsoft.azure.management.storage.v2019_08_01_preview.MinimumTlsVersion; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * The storage account. + */ +@JsonFlatten +public class StorageAccountInner extends Resource { + /** + * Gets the SKU. + */ + @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) + private SkuInner sku; + + /** + * Gets the Kind. Possible values include: 'Storage', 'StorageV2', + * 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private Kind kind; + + /** + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /** + * The extendedLocation of the resource. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /** + * Gets the status of the storage account at the time the operation was + * called. Possible values include: 'Creating', 'ResolvingDNS', + * 'Succeeded'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Gets the URLs that are used to perform a retrieval of a public blob, + * queue, or table object. Note that Standard_ZRS and Premium_LRS accounts + * only return the blob endpoint. + */ + @JsonProperty(value = "properties.primaryEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private Endpoints primaryEndpoints; + + /** + * Gets the location of the primary data center for the storage account. + */ + @JsonProperty(value = "properties.primaryLocation", access = JsonProperty.Access.WRITE_ONLY) + private String primaryLocation; + + /** + * Gets the status indicating whether the primary location of the storage + * account is available or unavailable. Possible values include: + * 'available', 'unavailable'. + */ + @JsonProperty(value = "properties.statusOfPrimary", access = JsonProperty.Access.WRITE_ONLY) + private AccountStatus statusOfPrimary; + + /** + * Gets the timestamp of the most recent instance of a failover to the + * secondary location. Only the most recent timestamp is retained. This + * element is not returned if there has never been a failover instance. + * Only available if the accountType is Standard_GRS or Standard_RAGRS. + */ + @JsonProperty(value = "properties.lastGeoFailoverTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastGeoFailoverTime; + + /** + * Gets the location of the geo-replicated secondary for the storage + * account. Only available if the accountType is Standard_GRS or + * Standard_RAGRS. + */ + @JsonProperty(value = "properties.secondaryLocation", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryLocation; + + /** + * Gets the status indicating whether the secondary location of the storage + * account is available or unavailable. Only available if the SKU name is + * Standard_GRS or Standard_RAGRS. Possible values include: 'available', + * 'unavailable'. + */ + @JsonProperty(value = "properties.statusOfSecondary", access = JsonProperty.Access.WRITE_ONLY) + private AccountStatus statusOfSecondary; + + /** + * Gets the creation date and time of the storage account in UTC. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationTime; + + /** + * Gets the custom domain the user assigned to this storage account. + */ + @JsonProperty(value = "properties.customDomain", access = JsonProperty.Access.WRITE_ONLY) + private CustomDomain customDomain; + + /** + * Gets the URLs that are used to perform a retrieval of a public blob, + * queue, or table object from the secondary location of the storage + * account. Only available if the SKU name is Standard_RAGRS. + */ + @JsonProperty(value = "properties.secondaryEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private Endpoints secondaryEndpoints; + + /** + * Gets the encryption settings on the account. If unspecified, the account + * is unencrypted. + */ + @JsonProperty(value = "properties.encryption", access = JsonProperty.Access.WRITE_ONLY) + private Encryption encryption; + + /** + * Required for storage accounts where kind = BlobStorage. The access tier + * used for billing. Possible values include: 'Hot', 'Cool'. + */ + @JsonProperty(value = "properties.accessTier", access = JsonProperty.Access.WRITE_ONLY) + private AccessTier accessTier; + + /** + * Provides the identity based authentication settings for Azure Files. + */ + @JsonProperty(value = "properties.azureFilesIdentityBasedAuthentication") + private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; + + /** + * Allows https traffic only to storage service if sets to true. + */ + @JsonProperty(value = "properties.supportsHttpsTrafficOnly") + private Boolean enableHttpsTrafficOnly; + + /** + * Network rule set. + */ + @JsonProperty(value = "properties.networkAcls", access = JsonProperty.Access.WRITE_ONLY) + private NetworkRuleSet networkRuleSet; + + /** + * Account HierarchicalNamespace enabled if sets to true. + */ + @JsonProperty(value = "properties.isHnsEnabled") + private Boolean isHnsEnabled; + + /** + * Geo Replication Stats. + */ + @JsonProperty(value = "properties.geoReplicationStats", access = JsonProperty.Access.WRITE_ONLY) + private GeoReplicationStats geoReplicationStats; + + /** + * If the failover is in progress, the value will be true, otherwise, it + * will be null. + */ + @JsonProperty(value = "properties.failoverInProgress", access = JsonProperty.Access.WRITE_ONLY) + private Boolean failoverInProgress; + + /** + * Allow large file shares if sets to Enabled. It cannot be disabled once + * it is enabled. Possible values include: 'Disabled', 'Enabled'. + */ + @JsonProperty(value = "properties.largeFileSharesState") + private LargeFileSharesState largeFileSharesState; + + /** + * List of private endpoint connection associated with the specified + * storage account. + */ + @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /** + * Maintains information about the network routing choice opted by the user + * for data transfer. + */ + @JsonProperty(value = "properties.routingPreference") + private RoutingPreference routingPreference; + + /** + * Blob restore status. + */ + @JsonProperty(value = "properties.blobRestoreStatus", access = JsonProperty.Access.WRITE_ONLY) + private BlobRestoreStatusInner blobRestoreStatus; + + /** + * Allow or disallow public access to all blobs or containers in the + * storage account. The default interpretation is true for this property. + */ + @JsonProperty(value = "properties.allowBlobPublicAccess") + private Boolean allowBlobPublicAccess; + + /** + * Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. Possible values + * include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + */ + @JsonProperty(value = "properties.minimumTlsVersion") + private MinimumTlsVersion minimumTlsVersion; + + /** + * Get gets the SKU. + * + * @return the sku value + */ + public SkuInner sku() { + return this.sku; + } + + /** + * Get gets the Kind. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. + * + * @return the kind value + */ + public Kind kind() { + return this.kind; + } + + /** + * Get the identity of the resource. + * + * @return the identity value + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity of the resource. + * + * @param identity the identity value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the extendedLocation of the resource. + * + * @return the extendedLocation value + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation of the resource. + * + * @param extendedLocation the extendedLocation value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get gets the status of the storage account at the time the operation was called. Possible values include: 'Creating', 'ResolvingDNS', 'Succeeded'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint. + * + * @return the primaryEndpoints value + */ + public Endpoints primaryEndpoints() { + return this.primaryEndpoints; + } + + /** + * Get gets the location of the primary data center for the storage account. + * + * @return the primaryLocation value + */ + public String primaryLocation() { + return this.primaryLocation; + } + + /** + * Get gets the status indicating whether the primary location of the storage account is available or unavailable. Possible values include: 'available', 'unavailable'. + * + * @return the statusOfPrimary value + */ + public AccountStatus statusOfPrimary() { + return this.statusOfPrimary; + } + + /** + * Get gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp is retained. This element is not returned if there has never been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS. + * + * @return the lastGeoFailoverTime value + */ + public DateTime lastGeoFailoverTime() { + return this.lastGeoFailoverTime; + } + + /** + * Get gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS or Standard_RAGRS. + * + * @return the secondaryLocation value + */ + public String secondaryLocation() { + return this.secondaryLocation; + } + + /** + * Get gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible values include: 'available', 'unavailable'. + * + * @return the statusOfSecondary value + */ + public AccountStatus statusOfSecondary() { + return this.statusOfSecondary; + } + + /** + * Get gets the creation date and time of the storage account in UTC. + * + * @return the creationTime value + */ + public DateTime creationTime() { + return this.creationTime; + } + + /** + * Get gets the custom domain the user assigned to this storage account. + * + * @return the customDomain value + */ + public CustomDomain customDomain() { + return this.customDomain; + } + + /** + * Get gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location of the storage account. Only available if the SKU name is Standard_RAGRS. + * + * @return the secondaryEndpoints value + */ + public Endpoints secondaryEndpoints() { + return this.secondaryEndpoints; + } + + /** + * Get gets the encryption settings on the account. If unspecified, the account is unencrypted. + * + * @return the encryption value + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. + * + * @return the accessTier value + */ + public AccessTier accessTier() { + return this.accessTier; + } + + /** + * Get provides the identity based authentication settings for Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value + */ + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.azureFilesIdentityBasedAuthentication; + } + + /** + * Set provides the identity based authentication settings for Azure Files. + * + * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withAzureFilesIdentityBasedAuthentication(AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + this.azureFilesIdentityBasedAuthentication = azureFilesIdentityBasedAuthentication; + return this; + } + + /** + * Get allows https traffic only to storage service if sets to true. + * + * @return the enableHttpsTrafficOnly value + */ + public Boolean enableHttpsTrafficOnly() { + return this.enableHttpsTrafficOnly; + } + + /** + * Set allows https traffic only to storage service if sets to true. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; + return this; + } + + /** + * Get network rule set. + * + * @return the networkRuleSet value + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Get account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value + */ + public Boolean isHnsEnabled() { + return this.isHnsEnabled; + } + + /** + * Set account HierarchicalNamespace enabled if sets to true. + * + * @param isHnsEnabled the isHnsEnabled value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withIsHnsEnabled(Boolean isHnsEnabled) { + this.isHnsEnabled = isHnsEnabled; + return this; + } + + /** + * Get geo Replication Stats. + * + * @return the geoReplicationStats value + */ + public GeoReplicationStats geoReplicationStats() { + return this.geoReplicationStats; + } + + /** + * Get if the failover is in progress, the value will be true, otherwise, it will be null. + * + * @return the failoverInProgress value + */ + public Boolean failoverInProgress() { + return this.failoverInProgress; + } + + /** + * Get allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. Possible values include: 'Disabled', 'Enabled'. + * + * @return the largeFileSharesState value + */ + public LargeFileSharesState largeFileSharesState() { + return this.largeFileSharesState; + } + + /** + * Set allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. Possible values include: 'Disabled', 'Enabled'. + * + * @param largeFileSharesState the largeFileSharesState value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { + this.largeFileSharesState = largeFileSharesState; + return this; + } + + /** + * Get list of private endpoint connection associated with the specified storage account. + * + * @return the privateEndpointConnections value + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get maintains information about the network routing choice opted by the user for data transfer. + * + * @return the routingPreference value + */ + public RoutingPreference routingPreference() { + return this.routingPreference; + } + + /** + * Set maintains information about the network routing choice opted by the user for data transfer. + * + * @param routingPreference the routingPreference value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withRoutingPreference(RoutingPreference routingPreference) { + this.routingPreference = routingPreference; + return this; + } + + /** + * Get blob restore status. + * + * @return the blobRestoreStatus value + */ + public BlobRestoreStatusInner blobRestoreStatus() { + return this.blobRestoreStatus; + } + + /** + * Get allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + * + * @return the allowBlobPublicAccess value + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + return this; + } + + /** + * Get set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + * + * @return the minimumTlsVersion value + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + * + * @param minimumTlsVersion the minimumTlsVersion value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageAccountListKeysResultImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageAccountListKeysResultImpl.java new file mode 100644 index 0000000000000..144bd4c1121dc --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageAccountListKeysResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccountListKeysResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccountKey; + +class StorageAccountListKeysResultImpl extends WrapperImpl implements StorageAccountListKeysResult { + private final StorageManager manager; + StorageAccountListKeysResultImpl(StorageAccountListKeysResultInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public List keys() { + return this.inner().keys(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageAccountListKeysResultInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageAccountListKeysResultInner.java new file mode 100644 index 0000000000000..f73d817be9b9b --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageAccountListKeysResultInner.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccountKey; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response from the ListKeys operation. + */ +public class StorageAccountListKeysResultInner { + /** + * Gets the list of storage account keys and their properties for the + * specified storage account. + */ + @JsonProperty(value = "keys", access = JsonProperty.Access.WRITE_ONLY) + private List keys; + + /** + * Get gets the list of storage account keys and their properties for the specified storage account. + * + * @return the keys value + */ + public List keys() { + return this.keys; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageAccountsImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageAccountsImpl.java new file mode 100644 index 0000000000000..364a6bf99bce0 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageAccountsImpl.java @@ -0,0 +1,232 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccounts; +import com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccount; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccountListKeysResult; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ListAccountSasResponse; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ListServiceSasResponse; +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobRestoreStatus; +import com.microsoft.azure.management.storage.v2019_08_01_preview.CheckNameAvailabilityResult; +import com.microsoft.azure.management.storage.v2019_08_01_preview.AccountSasParameters; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ServiceSasParameters; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobRestoreRange; + +class StorageAccountsImpl extends GroupableResourcesCoreImpl implements StorageAccounts { + protected StorageAccountsImpl(StorageManager manager) { + super(manager.inner().storageAccounts(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + StorageAccountsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + StorageAccountsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + StorageAccountsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + StorageAccountsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public StorageAccount call(StorageAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + StorageAccountsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + StorageAccountsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public StorageAccount call(StorageAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public StorageAccountImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String accountName) { + StorageAccountsInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public StorageAccountListKeysResult call(StorageAccountListKeysResultInner inner) { + return new StorageAccountListKeysResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeyAsync(String resourceGroupName, String accountName, String keyName) { + StorageAccountsInner client = this.inner(); + return client.regenerateKeyAsync(resourceGroupName, accountName, keyName) + .map(new Func1() { + @Override + public StorageAccountListKeysResult call(StorageAccountListKeysResultInner inner) { + return new StorageAccountListKeysResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAccountSASAsync(String resourceGroupName, String accountName, AccountSasParameters parameters) { + StorageAccountsInner client = this.inner(); + return client.listAccountSASAsync(resourceGroupName, accountName, parameters) + .map(new Func1() { + @Override + public ListAccountSasResponse call(ListAccountSasResponseInner inner) { + return new ListAccountSasResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable listServiceSASAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters) { + StorageAccountsInner client = this.inner(); + return client.listServiceSASAsync(resourceGroupName, accountName, parameters) + .map(new Func1() { + @Override + public ListServiceSasResponse call(ListServiceSasResponseInner inner) { + return new ListServiceSasResponseImpl(inner, manager()); + } + }); + } + + @Override + public Completable failoverAsync(String resourceGroupName, String accountName) { + StorageAccountsInner client = this.inner(); + return client.failoverAsync(resourceGroupName, accountName).toCompletable(); + } + + @Override + public Observable restoreBlobRangesAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List blobRanges) { + StorageAccountsInner client = this.inner(); + return client.restoreBlobRangesAsync(resourceGroupName, accountName, timeToRestore, blobRanges) + .map(new Func1() { + @Override + public BlobRestoreStatus call(BlobRestoreStatusInner inner) { + return new BlobRestoreStatusImpl(inner, manager()); + } + }); + } + + @Override + public Completable revokeUserDelegationKeysAsync(String resourceGroupName, String accountName) { + StorageAccountsInner client = this.inner(); + return client.revokeUserDelegationKeysAsync(resourceGroupName, accountName).toCompletable(); + } + + @Override + public Observable checkNameAvailabilityAsync(String name) { + StorageAccountsInner client = this.inner(); + return client.checkNameAvailabilityAsync(name) + .map(new Func1() { + @Override + public CheckNameAvailabilityResult call(CheckNameAvailabilityResultInner inner) { + return new CheckNameAvailabilityResultImpl(inner, manager()); + } + }); + } + + @Override + protected StorageAccountImpl wrapModel(StorageAccountInner inner) { + return new StorageAccountImpl(inner.name(), inner, manager()); + } + + @Override + protected StorageAccountImpl wrapModel(String name) { + return new StorageAccountImpl(name, new StorageAccountInner(), this.manager()); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageAccountsInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageAccountsInner.java new file mode 100644 index 0000000000000..da8e1e14c6354 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageAccountsInner.java @@ -0,0 +1,1949 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.storage.v2019_08_01_preview.AccountSasParameters; +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobRestoreParameters; +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobRestoreRange; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ListKeyExpand; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ServiceSasParameters; +import com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccountCheckNameAvailabilityParameters; +import com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccountCreateParameters; +import com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccountExpand; +import com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccountRegenerateKeyParameters; +import com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccountUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import org.joda.time.DateTime; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in StorageAccounts. + */ +public class StorageAccountsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private StorageAccountsService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of StorageAccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StorageAccountsInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(StorageAccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for StorageAccounts to be + * used by Retrofit to perform actually REST calls. + */ + interface StorageAccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccounts checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StorageAccountCheckNameAvailabilityParameters accountName, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccounts create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body StorageAccountCreateParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccounts beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}") + Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body StorageAccountCreateParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccounts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccounts getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") StorageAccountExpand expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccounts update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body StorageAccountUpdateParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccounts list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccounts listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccounts listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys") + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") ListKeyExpand expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccounts regenerateKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey") + Observable> regenerateKey(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StorageAccountRegenerateKeyParameters regenerateKey, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccounts listAccountSAS" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas") + Observable> listAccountSAS(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body AccountSasParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccounts listServiceSAS" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas") + Observable> listServiceSAS(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body ServiceSasParameters parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccounts failover" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover") + Observable> failover(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccounts beginFailover" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover") + Observable> beginFailover(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccounts restoreBlobRanges" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges") + Observable> restoreBlobRanges(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BlobRestoreParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccounts beginRestoreBlobRanges" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges") + Observable> beginRestoreBlobRanges(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BlobRestoreParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccounts revokeUserDelegationKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys") + Observable> revokeUserDelegationKeys(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccounts listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param name The storage account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckNameAvailabilityResultInner object if successful. + */ + public CheckNameAvailabilityResultInner checkNameAvailability(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).toBlocking().single().body(); + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param name The storage account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback); + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param name The storage account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResultInner object + */ + public Observable checkNameAvailabilityAsync(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).map(new Func1, CheckNameAvailabilityResultInner>() { + @Override + public CheckNameAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param name The storage account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResultInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + StorageAccountCheckNameAvailabilityParameters accountName = new StorageAccountCheckNameAvailabilityParameters(); + accountName.withName(name); + return service.checkNameAvailability(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), accountName, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountInner object if successful. + */ + public StorageAccountInner create(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().last().body(); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, StorageAccountInner>() { + @Override + public StorageAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(resourceGroupName, accountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountInner object if successful. + */ + public StorageAccountInner beginCreate(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, StorageAccountInner>() { + @Override + public StorageAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(resourceGroupName, accountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountInner object if successful. + */ + public StorageAccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, StorageAccountInner>() { + @Override + public StorageAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final StorageAccountExpand expand = null; + return service.getByResourceGroup(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. Possible values include: 'geoReplicationStats', 'blobRestoreStatus' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountInner object if successful. + */ + public StorageAccountInner getByResourceGroup(String resourceGroupName, String accountName, StorageAccountExpand expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName, expand).toBlocking().single().body(); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. Possible values include: 'geoReplicationStats', 'blobRestoreStatus' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String accountName, StorageAccountExpand expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName, expand), serviceCallback); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. Possible values include: 'geoReplicationStats', 'blobRestoreStatus' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName, StorageAccountExpand expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName, expand).map(new Func1, StorageAccountInner>() { + @Override + public StorageAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. Possible values include: 'geoReplicationStats', 'blobRestoreStatus' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountExpand expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name of the storage account cannot be changed after creation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountInner object if successful. + */ + public StorageAccountInner update(String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name of the storage account cannot be changed after creation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name of the storage account cannot be changed after creation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, StorageAccountInner>() { + @Override + public StorageAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name of the storage account cannot be changed after creation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(resourceGroupName, accountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageAccountInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @return the observable to the List<StorageAccountInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @return the observable to the List<StorageAccountInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountListKeysResultInner object if successful. + */ + public StorageAccountListKeysResultInner listKeys(String resourceGroupName, String accountName) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountListKeysResultInner object + */ + public Observable listKeysAsync(String resourceGroupName, String accountName) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, StorageAccountListKeysResultInner>() { + @Override + public StorageAccountListKeysResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountListKeysResultInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final ListKeyExpand expand = null; + return service.listKeys(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand Specifies type of the key to be listed. Possible value is kerb. Possible values include: 'kerb' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountListKeysResultInner object if successful. + */ + public StorageAccountListKeysResultInner listKeys(String resourceGroupName, String accountName, ListKeyExpand expand) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName, expand).toBlocking().single().body(); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand Specifies type of the key to be listed. Possible value is kerb. Possible values include: 'kerb' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listKeysAsync(String resourceGroupName, String accountName, ListKeyExpand expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, accountName, expand), serviceCallback); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand Specifies type of the key to be listed. Possible value is kerb. Possible values include: 'kerb' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountListKeysResultInner object + */ + public Observable listKeysAsync(String resourceGroupName, String accountName, ListKeyExpand expand) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName, expand).map(new Func1, StorageAccountListKeysResultInner>() { + @Override + public StorageAccountListKeysResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand Specifies type of the key to be listed. Possible value is kerb. Possible values include: 'kerb' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountListKeysResultInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String accountName, ListKeyExpand expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listKeys(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountListKeysResultInner object if successful. + */ + public StorageAccountListKeysResultInner regenerateKey(String resourceGroupName, String accountName, String keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName).toBlocking().single().body(); + } + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateKeyAsync(String resourceGroupName, String accountName, String keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName), serviceCallback); + } + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountListKeysResultInner object + */ + public Observable regenerateKeyAsync(String resourceGroupName, String accountName, String keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName).map(new Func1, StorageAccountListKeysResultInner>() { + @Override + public StorageAccountListKeysResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountListKeysResultInner object + */ + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String accountName, String keyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + StorageAccountRegenerateKeyParameters regenerateKey = new StorageAccountRegenerateKeyParameters(); + regenerateKey.withKeyName(keyName); + return service.regenerateKey(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), regenerateKey, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ListAccountSasResponseInner object if successful. + */ + public ListAccountSasResponseInner listAccountSAS(String resourceGroupName, String accountName, AccountSasParameters parameters) { + return listAccountSASWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAccountSASAsync(String resourceGroupName, String accountName, AccountSasParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listAccountSASWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListAccountSasResponseInner object + */ + public Observable listAccountSASAsync(String resourceGroupName, String accountName, AccountSasParameters parameters) { + return listAccountSASWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, ListAccountSasResponseInner>() { + @Override + public ListAccountSasResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListAccountSasResponseInner object + */ + public Observable> listAccountSASWithServiceResponseAsync(String resourceGroupName, String accountName, AccountSasParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.listAccountSAS(resourceGroupName, accountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listAccountSASDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listAccountSASDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ListServiceSasResponseInner object if successful. + */ + public ListServiceSasResponseInner listServiceSAS(String resourceGroupName, String accountName, ServiceSasParameters parameters) { + return listServiceSASWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listServiceSASAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listServiceSASWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListServiceSasResponseInner object + */ + public Observable listServiceSASAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters) { + return listServiceSASWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, ListServiceSasResponseInner>() { + @Override + public ListServiceSasResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListServiceSasResponseInner object + */ + public Observable> listServiceSASWithServiceResponseAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.listServiceSAS(resourceGroupName, accountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listServiceSASDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listServiceSASDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void failover(String resourceGroupName, String accountName) { + failoverWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().last().body(); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture failoverAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(failoverWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable failoverAsync(String resourceGroupName, String accountName) { + return failoverWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> failoverWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.failover(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginFailover(String resourceGroupName, String accountName) { + beginFailoverWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginFailoverAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginFailoverWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginFailoverAsync(String resourceGroupName, String accountName) { + return beginFailoverWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginFailoverWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginFailover(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginFailoverDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginFailoverDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @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 BlobRestoreStatusInner object if successful. + */ + public BlobRestoreStatusInner restoreBlobRanges(String resourceGroupName, String accountName, DateTime timeToRestore, List blobRanges) { + return restoreBlobRangesWithServiceResponseAsync(resourceGroupName, accountName, timeToRestore, blobRanges).toBlocking().last().body(); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @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 restoreBlobRangesAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List blobRanges, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restoreBlobRangesWithServiceResponseAsync(resourceGroupName, accountName, timeToRestore, blobRanges), serviceCallback); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable restoreBlobRangesAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List blobRanges) { + return restoreBlobRangesWithServiceResponseAsync(resourceGroupName, accountName, timeToRestore, blobRanges).map(new Func1, BlobRestoreStatusInner>() { + @Override + public BlobRestoreStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> restoreBlobRangesWithServiceResponseAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List blobRanges) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (timeToRestore == null) { + throw new IllegalArgumentException("Parameter timeToRestore is required and cannot be null."); + } + if (blobRanges == null) { + throw new IllegalArgumentException("Parameter blobRanges is required and cannot be null."); + } + Validator.validate(blobRanges); + BlobRestoreParameters parameters = new BlobRestoreParameters(); + parameters.withTimeToRestore(timeToRestore); + parameters.withBlobRanges(blobRanges); + Observable> observable = service.restoreBlobRanges(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @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 BlobRestoreStatusInner object if successful. + */ + public BlobRestoreStatusInner beginRestoreBlobRanges(String resourceGroupName, String accountName, DateTime timeToRestore, List blobRanges) { + return beginRestoreBlobRangesWithServiceResponseAsync(resourceGroupName, accountName, timeToRestore, blobRanges).toBlocking().single().body(); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @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 beginRestoreBlobRangesAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List blobRanges, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRestoreBlobRangesWithServiceResponseAsync(resourceGroupName, accountName, timeToRestore, blobRanges), serviceCallback); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobRestoreStatusInner object + */ + public Observable beginRestoreBlobRangesAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List blobRanges) { + return beginRestoreBlobRangesWithServiceResponseAsync(resourceGroupName, accountName, timeToRestore, blobRanges).map(new Func1, BlobRestoreStatusInner>() { + @Override + public BlobRestoreStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobRestoreStatusInner object + */ + public Observable> beginRestoreBlobRangesWithServiceResponseAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List blobRanges) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (timeToRestore == null) { + throw new IllegalArgumentException("Parameter timeToRestore is required and cannot be null."); + } + if (blobRanges == null) { + throw new IllegalArgumentException("Parameter blobRanges is required and cannot be null."); + } + Validator.validate(blobRanges); + BlobRestoreParameters parameters = new BlobRestoreParameters(); + parameters.withTimeToRestore(timeToRestore); + parameters.withBlobRanges(blobRanges); + return service.beginRestoreBlobRanges(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRestoreBlobRangesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginRestoreBlobRangesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void revokeUserDelegationKeys(String resourceGroupName, String accountName) { + revokeUserDelegationKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture revokeUserDelegationKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(revokeUserDelegationKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable revokeUserDelegationKeysAsync(String resourceGroupName, String accountName) { + return revokeUserDelegationKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> revokeUserDelegationKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.revokeUserDelegationKeys(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = revokeUserDelegationKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse revokeUserDelegationKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageAccountInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageManagementClientImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageManagementClientImpl.java new file mode 100644 index 0000000000000..ccedceaeaa7dc --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageManagementClientImpl.java @@ -0,0 +1,436 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the StorageManagementClientImpl class. + */ +public class StorageManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The ID of the target subscription. */ + private String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public StorageManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The API version to use for this operation. */ + private String apiVersion; + + /** + * Gets The API version to use for this operation. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public StorageManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public StorageManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public StorageManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The SkusInner object to access its operations. + */ + private SkusInner skus; + + /** + * Gets the SkusInner object to access its operations. + * @return the SkusInner object. + */ + public SkusInner skus() { + return this.skus; + } + + /** + * The StorageAccountsInner object to access its operations. + */ + private StorageAccountsInner storageAccounts; + + /** + * Gets the StorageAccountsInner object to access its operations. + * @return the StorageAccountsInner object. + */ + public StorageAccountsInner storageAccounts() { + return this.storageAccounts; + } + + /** + * The DeletedAccountsInner object to access its operations. + */ + private DeletedAccountsInner deletedAccounts; + + /** + * Gets the DeletedAccountsInner object to access its operations. + * @return the DeletedAccountsInner object. + */ + public DeletedAccountsInner deletedAccounts() { + return this.deletedAccounts; + } + + /** + * The UsagesInner object to access its operations. + */ + private UsagesInner usages; + + /** + * Gets the UsagesInner object to access its operations. + * @return the UsagesInner object. + */ + public UsagesInner usages() { + return this.usages; + } + + /** + * The ManagementPoliciesInner object to access its operations. + */ + private ManagementPoliciesInner managementPolicies; + + /** + * Gets the ManagementPoliciesInner object to access its operations. + * @return the ManagementPoliciesInner object. + */ + public ManagementPoliciesInner managementPolicies() { + return this.managementPolicies; + } + + /** + * The PrivateEndpointConnectionsInner object to access its operations. + */ + private PrivateEndpointConnectionsInner privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsInner object to access its operations. + * @return the PrivateEndpointConnectionsInner object. + */ + public PrivateEndpointConnectionsInner privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * The PrivateLinkResourcesInner object to access its operations. + */ + private PrivateLinkResourcesInner privateLinkResources; + + /** + * Gets the PrivateLinkResourcesInner object to access its operations. + * @return the PrivateLinkResourcesInner object. + */ + public PrivateLinkResourcesInner privateLinkResources() { + return this.privateLinkResources; + } + + /** + * The ObjectReplicationPoliciesInner object to access its operations. + */ + private ObjectReplicationPoliciesInner objectReplicationPolicies; + + /** + * Gets the ObjectReplicationPoliciesInner object to access its operations. + * @return the ObjectReplicationPoliciesInner object. + */ + public ObjectReplicationPoliciesInner objectReplicationPolicies() { + return this.objectReplicationPolicies; + } + + /** + * The EncryptionScopesInner object to access its operations. + */ + private EncryptionScopesInner encryptionScopes; + + /** + * Gets the EncryptionScopesInner object to access its operations. + * @return the EncryptionScopesInner object. + */ + public EncryptionScopesInner encryptionScopes() { + return this.encryptionScopes; + } + + /** + * The BlobServicesInner object to access its operations. + */ + private BlobServicesInner blobServices; + + /** + * Gets the BlobServicesInner object to access its operations. + * @return the BlobServicesInner object. + */ + public BlobServicesInner blobServices() { + return this.blobServices; + } + + /** + * The BlobContainersInner object to access its operations. + */ + private BlobContainersInner blobContainers; + + /** + * Gets the BlobContainersInner object to access its operations. + * @return the BlobContainersInner object. + */ + public BlobContainersInner blobContainers() { + return this.blobContainers; + } + + /** + * The FileServicesInner object to access its operations. + */ + private FileServicesInner fileServices; + + /** + * Gets the FileServicesInner object to access its operations. + * @return the FileServicesInner object. + */ + public FileServicesInner fileServices() { + return this.fileServices; + } + + /** + * The FileSharesInner object to access its operations. + */ + private FileSharesInner fileShares; + + /** + * Gets the FileSharesInner object to access its operations. + * @return the FileSharesInner object. + */ + public FileSharesInner fileShares() { + return this.fileShares; + } + + /** + * The QueueServicesInner object to access its operations. + */ + private QueueServicesInner queueServices; + + /** + * Gets the QueueServicesInner object to access its operations. + * @return the QueueServicesInner object. + */ + public QueueServicesInner queueServices() { + return this.queueServices; + } + + /** + * The QueuesInner object to access its operations. + */ + private QueuesInner queues; + + /** + * Gets the QueuesInner object to access its operations. + * @return the QueuesInner object. + */ + public QueuesInner queues() { + return this.queues; + } + + /** + * The TableServicesInner object to access its operations. + */ + private TableServicesInner tableServices; + + /** + * Gets the TableServicesInner object to access its operations. + * @return the TableServicesInner object. + */ + public TableServicesInner tableServices() { + return this.tableServices; + } + + /** + * The TablesInner object to access its operations. + */ + private TablesInner tables; + + /** + * Gets the TablesInner object to access its operations. + * @return the TablesInner object. + */ + public TablesInner tables() { + return this.tables; + } + + /** + * Initializes an instance of StorageManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public StorageManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of StorageManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public StorageManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of StorageManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public StorageManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2020-08-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.skus = new SkusInner(restClient().retrofit(), this); + this.storageAccounts = new StorageAccountsInner(restClient().retrofit(), this); + this.deletedAccounts = new DeletedAccountsInner(restClient().retrofit(), this); + this.usages = new UsagesInner(restClient().retrofit(), this); + this.managementPolicies = new ManagementPoliciesInner(restClient().retrofit(), this); + this.privateEndpointConnections = new PrivateEndpointConnectionsInner(restClient().retrofit(), this); + this.privateLinkResources = new PrivateLinkResourcesInner(restClient().retrofit(), this); + this.objectReplicationPolicies = new ObjectReplicationPoliciesInner(restClient().retrofit(), this); + this.encryptionScopes = new EncryptionScopesInner(restClient().retrofit(), this); + this.blobServices = new BlobServicesInner(restClient().retrofit(), this); + this.blobContainers = new BlobContainersInner(restClient().retrofit(), this); + this.fileServices = new FileServicesInner(restClient().retrofit(), this); + this.fileShares = new FileSharesInner(restClient().retrofit(), this); + this.queueServices = new QueueServicesInner(restClient().retrofit(), this); + this.queues = new QueuesInner(restClient().retrofit(), this); + this.tableServices = new TableServicesInner(restClient().retrofit(), this); + this.tables = new TablesInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "StorageManagementClient", "2020-08-01-preview"); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageManager.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageManager.java new file mode 100644 index 0000000000000..f4901217248a6 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageManager.java @@ -0,0 +1,303 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Operations; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Skus; +import com.microsoft.azure.management.storage.v2019_08_01_preview.StorageAccounts; +import com.microsoft.azure.management.storage.v2019_08_01_preview.DeletedAccounts; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Usages; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ManagementPolicies; +import com.microsoft.azure.management.storage.v2019_08_01_preview.PrivateEndpointConnections; +import com.microsoft.azure.management.storage.v2019_08_01_preview.PrivateLinkResources; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ObjectReplicationPolicies; +import com.microsoft.azure.management.storage.v2019_08_01_preview.EncryptionScopes; +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobServices; +import com.microsoft.azure.management.storage.v2019_08_01_preview.BlobContainers; +import com.microsoft.azure.management.storage.v2019_08_01_preview.FileServices; +import com.microsoft.azure.management.storage.v2019_08_01_preview.FileShares; +import com.microsoft.azure.management.storage.v2019_08_01_preview.QueueServices; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Queues; +import com.microsoft.azure.management.storage.v2019_08_01_preview.TableServices; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Tables; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Storage resource management. + */ +public final class StorageManager extends ManagerCore { + private Operations operations; + private Skus skus; + private StorageAccounts storageAccounts; + private DeletedAccounts deletedAccounts; + private Usages usages; + private ManagementPolicies managementPolicies; + private PrivateEndpointConnections privateEndpointConnections; + private PrivateLinkResources privateLinkResources; + private ObjectReplicationPolicies objectReplicationPolicies; + private EncryptionScopes encryptionScopes; + private BlobServices blobServices; + private BlobContainers blobContainers; + private FileServices fileServices; + private FileShares fileShares; + private QueueServices queueServices; + private Queues queues; + private TableServices tableServices; + private Tables tables; + /** + * Get a Configurable instance that can be used to create StorageManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new StorageManager.ConfigurableImpl(); + } + /** + * Creates an instance of StorageManager that exposes Storage resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the StorageManager + */ + public static StorageManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new StorageManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of StorageManager that exposes Storage resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the StorageManager + */ + public static StorageManager authenticate(RestClient restClient, String subscriptionId) { + return new StorageManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of StorageManager that exposes Storage management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Storage management API entry points that work across subscriptions + */ + StorageManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Skus. + */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(this); + } + return this.skus; + } + + /** + * @return Entry point to manage StorageAccounts. + */ + public StorageAccounts storageAccounts() { + if (this.storageAccounts == null) { + this.storageAccounts = new StorageAccountsImpl(this); + } + return this.storageAccounts; + } + + /** + * @return Entry point to manage DeletedAccounts. + */ + public DeletedAccounts deletedAccounts() { + if (this.deletedAccounts == null) { + this.deletedAccounts = new DeletedAccountsImpl(this); + } + return this.deletedAccounts; + } + + /** + * @return Entry point to manage Usages. + */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(this); + } + return this.usages; + } + + /** + * @return Entry point to manage ManagementPolicies. + */ + public ManagementPolicies managementPolicies() { + if (this.managementPolicies == null) { + this.managementPolicies = new ManagementPoliciesImpl(this); + } + return this.managementPolicies; + } + + /** + * @return Entry point to manage PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + } + return this.privateEndpointConnections; + } + + /** + * @return Entry point to manage PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(this); + } + return this.privateLinkResources; + } + + /** + * @return Entry point to manage ObjectReplicationPolicies. + */ + public ObjectReplicationPolicies objectReplicationPolicies() { + if (this.objectReplicationPolicies == null) { + this.objectReplicationPolicies = new ObjectReplicationPoliciesImpl(this); + } + return this.objectReplicationPolicies; + } + + /** + * @return Entry point to manage EncryptionScopes. + */ + public EncryptionScopes encryptionScopes() { + if (this.encryptionScopes == null) { + this.encryptionScopes = new EncryptionScopesImpl(this); + } + return this.encryptionScopes; + } + + /** + * @return Entry point to manage BlobServices. + */ + public BlobServices blobServices() { + if (this.blobServices == null) { + this.blobServices = new BlobServicesImpl(this); + } + return this.blobServices; + } + + /** + * @return Entry point to manage BlobContainers. + */ + public BlobContainers blobContainers() { + if (this.blobContainers == null) { + this.blobContainers = new BlobContainersImpl(this); + } + return this.blobContainers; + } + + /** + * @return Entry point to manage FileServices. + */ + public FileServices fileServices() { + if (this.fileServices == null) { + this.fileServices = new FileServicesImpl(this); + } + return this.fileServices; + } + + /** + * @return Entry point to manage FileShares. + */ + public FileShares fileShares() { + if (this.fileShares == null) { + this.fileShares = new FileSharesImpl(this); + } + return this.fileShares; + } + + /** + * @return Entry point to manage QueueServices. + */ + public QueueServices queueServices() { + if (this.queueServices == null) { + this.queueServices = new QueueServicesImpl(this); + } + return this.queueServices; + } + + /** + * @return Entry point to manage Queues. + */ + public Queues queues() { + if (this.queues == null) { + this.queues = new QueuesImpl(this); + } + return this.queues; + } + + /** + * @return Entry point to manage TableServices. + */ + public TableServices tableServices() { + if (this.tableServices == null) { + this.tableServices = new TableServicesImpl(this); + } + return this.tableServices; + } + + /** + * @return Entry point to manage Tables. + */ + public Tables tables() { + if (this.tables == null) { + this.tables = new TablesImpl(this); + } + return this.tables; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public StorageManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return StorageManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private StorageManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new StorageManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageQueueImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageQueueImpl.java new file mode 100644 index 0000000000000..053294307936a --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageQueueImpl.java @@ -0,0 +1,117 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.StorageQueue; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; + +class StorageQueueImpl extends CreatableUpdatableImpl implements StorageQueue, StorageQueue.Definition, StorageQueue.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private String queueName; + private Map cmetadata; + private Map umetadata; + + StorageQueueImpl(String name, StorageManager manager) { + super(name, new StorageQueueInner()); + this.manager = manager; + // Set resource name + this.queueName = name; + // + } + + StorageQueueImpl(StorageQueueInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.queueName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + this.queueName = IdParsingUtils.getValueFromIdByName(inner.id(), "queues"); + // + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + QueuesInner client = this.manager().inner().queues(); + return client.createAsync(this.resourceGroupName, this.accountName, this.queueName, this.cmetadata) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + QueuesInner client = this.manager().inner().queues(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.queueName, this.umetadata) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + QueuesInner client = this.manager().inner().queues(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Integer approximateMessageCount() { + return this.inner().approximateMessageCount(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Map metadata() { + return this.inner().metadata(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public StorageQueueImpl withExistingQueueService(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public StorageQueueImpl withMetadata(Map metadata) { + if (isInCreateMode()) { + this.cmetadata = metadata; + } else { + this.umetadata = metadata; + } + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageQueueInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageQueueInner.java new file mode 100644 index 0000000000000..b7a87f0e64e21 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/StorageQueueInner.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The StorageQueueInner model. + */ +@JsonFlatten +public class StorageQueueInner extends ProxyResource { + /** + * A name-value pair that represents queue metadata. + */ + @JsonProperty(value = "properties.metadata") + private Map metadata; + + /** + * Integer indicating an approximate number of messages in the queue. This + * number is not lower than the actual number of messages in the queue, but + * could be higher. + */ + @JsonProperty(value = "properties.approximateMessageCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer approximateMessageCount; + + /** + * Get a name-value pair that represents queue metadata. + * + * @return the metadata value + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set a name-value pair that represents queue metadata. + * + * @param metadata the metadata value to set + * @return the StorageQueueInner object itself. + */ + public StorageQueueInner withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get integer indicating an approximate number of messages in the queue. This number is not lower than the actual number of messages in the queue, but could be higher. + * + * @return the approximateMessageCount value + */ + public Integer approximateMessageCount() { + return this.approximateMessageCount; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TableImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TableImpl.java new file mode 100644 index 0000000000000..cd762f15b6cd6 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TableImpl.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.Table; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class TableImpl extends CreatableUpdatableImpl implements Table, Table.Definition, Table.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private String tableName; + + TableImpl(String name, StorageManager manager) { + super(name, new TableInner()); + this.manager = manager; + // Set resource name + this.tableName = name; + // + } + + TableImpl(TableInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.tableName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + this.tableName = IdParsingUtils.getValueFromIdByName(inner.id(), "tables"); + // + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable
createResourceAsync() { + TablesInner client = this.manager().inner().tables(); + return client.createAsync(this.resourceGroupName, this.accountName, this.tableName) + .map(innerToFluentMap(this)); + } + + @Override + public Observable
updateResourceAsync() { + TablesInner client = this.manager().inner().tables(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.tableName) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TablesInner client = this.manager().inner().tables(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String tableName() { + return this.inner().tableName(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public TableImpl withExistingTableService(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TableInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TableInner.java new file mode 100644 index 0000000000000..ad8d2d095e2bc --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TableInner.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Properties of the table, including Id, resource name, resource type. + */ +@JsonFlatten +public class TableInner extends ProxyResource { + /** + * Table name under the specified account. + */ + @JsonProperty(value = "properties.tableName", access = JsonProperty.Access.WRITE_ONLY) + private String tableName; + + /** + * Get table name under the specified account. + * + * @return the tableName value + */ + public String tableName() { + return this.tableName; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TableServicePropertiesImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TableServicePropertiesImpl.java new file mode 100644 index 0000000000000..0a1de6ce9aa3e --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TableServicePropertiesImpl.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.TableServiceProperties; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.CorsRules; +import java.util.List; +import rx.functions.Func1; + +class TableServicePropertiesImpl extends CreatableUpdatableImpl implements TableServiceProperties, TableServiceProperties.Definition, TableServiceProperties.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private CorsRules ccors; + private CorsRules ucors; + + TableServicePropertiesImpl(String name, StorageManager manager) { + super(name, new TableServicePropertiesInner()); + this.manager = manager; + // Set resource name + this.accountName = name; + // + this.ccors = new CorsRules(); + this.ucors = new CorsRules(); + } + + TableServicePropertiesImpl(TableServicePropertiesInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.accountName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + // + this.ccors = new CorsRules(); + this.ucors = new CorsRules(); + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + TableServicesInner client = this.manager().inner().tableServices(); + return client.setServicePropertiesAsync(this.resourceGroupName, this.accountName, this.ccors) + .map(new Func1() { + @Override + public TableServicePropertiesInner call(TableServicePropertiesInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + TableServicesInner client = this.manager().inner().tableServices(); + return client.setServicePropertiesAsync(this.resourceGroupName, this.accountName, this.ucors) + .map(new Func1() { + @Override + public TableServicePropertiesInner call(TableServicePropertiesInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TableServicesInner client = this.manager().inner().tableServices(); + return client.getServicePropertiesAsync(this.resourceGroupName, this.accountName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.ccors = new CorsRules(); + this.ucors = new CorsRules(); + } + + @Override + public CorsRules cors() { + return this.inner().cors(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public TableServicePropertiesImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public TableServicePropertiesImpl withCors(CorsRules cors) { + if (isInCreateMode()) { + this.ccors = cors; + } else { + this.ucors = cors; + } + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TableServicePropertiesInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TableServicePropertiesInner.java new file mode 100644 index 0000000000000..db3d1ddee72e5 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TableServicePropertiesInner.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.CorsRules; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The properties of a storage account’s Table service. + */ +@JsonFlatten +public class TableServicePropertiesInner extends ProxyResource { + /** + * Specifies CORS rules for the Table service. You can include up to five + * CorsRule elements in the request. If no CorsRule elements are included + * in the request body, all CORS rules will be deleted, and CORS will be + * disabled for the Table service. + */ + @JsonProperty(value = "properties.cors") + private CorsRules cors; + + /** + * Get specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Table service. + * + * @return the cors value + */ + public CorsRules cors() { + return this.cors; + } + + /** + * Set specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Table service. + * + * @param cors the cors value to set + * @return the TableServicePropertiesInner object itself. + */ + public TableServicePropertiesInner withCors(CorsRules cors) { + this.cors = cors; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TableServicesImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TableServicesImpl.java new file mode 100644 index 0000000000000..1a6ef649b55e4 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TableServicesImpl.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.TableServices; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.storage.v2019_08_01_preview.ListTableServices; +import com.microsoft.azure.management.storage.v2019_08_01_preview.TableServiceProperties; + +class TableServicesImpl extends WrapperImpl implements TableServices { + private final StorageManager manager; + + TableServicesImpl(StorageManager manager) { + super(manager.inner().tableServices()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public TableServicePropertiesImpl define(String name) { + return wrapModel(name); + } + + private TableServicePropertiesImpl wrapModel(TableServicePropertiesInner inner) { + return new TableServicePropertiesImpl(inner, manager()); + } + + private TableServicePropertiesImpl wrapModel(String name) { + return new TableServicePropertiesImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName) { + TableServicesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public ListTableServices call(ListTableServicesInner inner) { + return new ListTableServicesImpl(inner, manager()); + } + }); + } + + @Override + public Observable getServicePropertiesAsync(String resourceGroupName, String accountName) { + TableServicesInner client = this.inner(); + return client.getServicePropertiesAsync(resourceGroupName, accountName) + .flatMap(new Func1>() { + @Override + public Observable call(TableServicePropertiesInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((TableServiceProperties)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TableServicesInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TableServicesInner.java new file mode 100644 index 0000000000000..cd7bb57965b19 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TableServicesInner.java @@ -0,0 +1,422 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.storage.v2019_08_01_preview.CorsRules; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in TableServices. + */ +public class TableServicesInner { + /** The Retrofit service to perform REST calls. */ + private TableServicesService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of TableServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TableServicesInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(TableServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for TableServices to be + * used by Retrofit to perform actually REST calls. + */ + interface TableServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.TableServices list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices") + 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.v2019_08_01_preview.TableServices setServiceProperties" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}") + Observable> setServiceProperties(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("tableServiceName") String tableServiceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TableServicePropertiesInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.TableServices getServiceProperties" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}") + Observable> getServiceProperties(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("tableServiceName") String tableServiceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all table services for the 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 ListTableServicesInner object if successful. + */ + public ListTableServicesInner list(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * List all table services for the 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 listAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * List all table services for the 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 ListTableServicesInner object + */ + public Observable listAsync(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, ListTableServicesInner>() { + @Override + public ListTableServicesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List all table services for the 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 ListTableServicesInner 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); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TableServicePropertiesInner object if successful. + */ + public TableServicePropertiesInner setServiceProperties(String resourceGroupName, String accountName) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setServicePropertiesAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableServicePropertiesInner object + */ + public Observable setServicePropertiesAsync(String resourceGroupName, String accountName) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, TableServicePropertiesInner>() { + @Override + public TableServicePropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableServicePropertiesInner object + */ + public Observable> setServicePropertiesWithServiceResponseAsync(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 tableServiceName = "default"; + final CorsRules cors = null; + TableServicePropertiesInner parameters = new TableServicePropertiesInner(); + parameters.withCors(null); + return service.setServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), tableServiceName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setServicePropertiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param cors Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Table service. + * @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 TableServicePropertiesInner object if successful. + */ + public TableServicePropertiesInner setServiceProperties(String resourceGroupName, String accountName, CorsRules cors) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, cors).toBlocking().single().body(); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param cors Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Table service. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture setServicePropertiesAsync(String resourceGroupName, String accountName, CorsRules cors, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, cors), serviceCallback); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param cors Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Table service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableServicePropertiesInner object + */ + public Observable setServicePropertiesAsync(String resourceGroupName, String accountName, CorsRules cors) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, cors).map(new Func1, TableServicePropertiesInner>() { + @Override + public TableServicePropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param cors Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Table service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableServicePropertiesInner object + */ + public Observable> setServicePropertiesWithServiceResponseAsync(String resourceGroupName, String accountName, CorsRules cors) { + 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."); + } + Validator.validate(cors); + final String tableServiceName = "default"; + TableServicePropertiesInner parameters = new TableServicePropertiesInner(); + parameters.withCors(cors); + return service.setServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), tableServiceName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setServicePropertiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse setServicePropertiesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TableServicePropertiesInner object if successful. + */ + public TableServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) { + return getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getServicePropertiesAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableServicePropertiesInner object + */ + public Observable getServicePropertiesAsync(String resourceGroupName, String accountName) { + return getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, TableServicePropertiesInner>() { + @Override + public TableServicePropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableServicePropertiesInner object + */ + public Observable> getServicePropertiesWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String tableServiceName = "default"; + return service.getServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), tableServiceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServicePropertiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getServicePropertiesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TablesImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TablesImpl.java new file mode 100644 index 0000000000000..e767b1693a1c6 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TablesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Tables; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Table; + +class TablesImpl extends WrapperImpl implements Tables { + private final StorageManager manager; + + TablesImpl(StorageManager manager) { + super(manager.inner().tables()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public TableImpl define(String name) { + return wrapModel(name); + } + + private TableImpl wrapModel(TableInner inner) { + return new TableImpl(inner, manager()); + } + + private TableImpl wrapModel(String name) { + return new TableImpl(name, this.manager()); + } + + @Override + public Observable
getAsync(String resourceGroupName, String accountName, String tableName) { + TablesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, tableName) + .map(new Func1() { + @Override + public Table call(TableInner inner) { + return new TableImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String tableName) { + TablesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, tableName).toCompletable(); + } + + @Override + public Observable
listAsync(final String resourceGroupName, final String accountName) { + TablesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Table call(TableInner inner) { + return new TableImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TablesInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TablesInner.java new file mode 100644 index 0000000000000..9b7d1ced737c6 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/TablesInner.java @@ -0,0 +1,694 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Tables. + */ +public class TablesInner { + /** The Retrofit service to perform REST calls. */ + private TablesService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of TablesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TablesInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(TablesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Tables to be + * used by Retrofit to perform actually REST calls. + */ + interface TablesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.Tables create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("tableName") String tableName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.Tables update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("tableName") String tableName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.Tables get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("tableName") String tableName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.Tables delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("tableName") String tableName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.Tables list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables") + 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.v2019_08_01_preview.Tables listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates a new table with the specified table name, under the specified 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 tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @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 TableInner object if successful. + */ + public TableInner create(String resourceGroupName, String accountName, String tableName) { + return createWithServiceResponseAsync(resourceGroupName, accountName, tableName).toBlocking().single().body(); + } + + /** + * Creates a new table with the specified table name, under the specified 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 tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @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 tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, tableName), serviceCallback); + } + + /** + * Creates a new table with the specified table name, under the specified 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 tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String tableName) { + return createWithServiceResponseAsync(resourceGroupName, accountName, tableName).map(new Func1, TableInner>() { + @Override + public TableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new table with the specified table name, under the specified 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 tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName) { + 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 (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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.create(resourceGroupName, accountName, this.client.subscriptionId(), tableName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a new table with the specified table name, under the specified 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 tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @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 TableInner object if successful. + */ + public TableInner update(String resourceGroupName, String accountName, String tableName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, tableName).toBlocking().single().body(); + } + + /** + * Creates a new table with the specified table name, under the specified 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 tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @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 tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, tableName), serviceCallback); + } + + /** + * Creates a new table with the specified table name, under the specified 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 tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String tableName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, tableName).map(new Func1, TableInner>() { + @Override + public TableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new table with the specified table name, under the specified 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 tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName) { + 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 (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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.update(resourceGroupName, accountName, this.client.subscriptionId(), tableName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @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 TableInner object if successful. + */ + public TableInner get(String resourceGroupName, String accountName, String tableName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, tableName).toBlocking().single().body(); + } + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @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 tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, tableName), serviceCallback); + } + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String tableName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, tableName).map(new Func1, TableInner>() { + @Override + public TableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName) { + 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 (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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, this.client.subscriptionId(), tableName, 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 the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @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 tableName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, tableName).toBlocking().single().body(); + } + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @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 tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, tableName), serviceCallback); + } + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String tableName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, tableName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName) { + 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 (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(resourceGroupName, accountName, this.client.subscriptionId(), tableName, 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(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of all the tables under 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 PagedList<TableInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all the tables under 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> listAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of all the tables under 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 PagedList<TableInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all the tables under 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 PagedList<TableInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + ServiceResponse> * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TableInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + 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> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TableInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TableInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TableInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TableInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/UsageImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/UsageImpl.java new file mode 100644 index 0000000000000..edab0fd03ab39 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/UsageImpl.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.Usage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_08_01_preview.UsageName; +import com.microsoft.azure.management.storage.v2019_08_01_preview.UsageUnit; + +class UsageImpl extends WrapperImpl implements Usage { + private final StorageManager manager; + + UsageImpl(UsageInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + + + @Override + public Integer currentValue() { + return this.inner().currentValue(); + } + + @Override + public Integer limit() { + return this.inner().limit(); + } + + @Override + public UsageName name() { + return this.inner().name(); + } + + @Override + public UsageUnit unit() { + return this.inner().unit(); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/UsageInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/UsageInner.java new file mode 100644 index 0000000000000..6fc11d0c0c855 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/UsageInner.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.storage.v2019_08_01_preview.UsageUnit; +import com.microsoft.azure.management.storage.v2019_08_01_preview.UsageName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes Storage Resource Usage. + */ +public class UsageInner { + /** + * Gets the unit of measurement. Possible values include: 'Count', 'Bytes', + * 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private UsageUnit unit; + + /** + * Gets the current count of the allocated resources in the subscription. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Integer currentValue; + + /** + * Gets the maximum count of the resources that can be allocated in the + * subscription. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Integer limit; + + /** + * Gets the name of the type of usage. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private UsageName name; + + /** + * Get gets the unit of measurement. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'. + * + * @return the unit value + */ + public UsageUnit unit() { + return this.unit; + } + + /** + * Get gets the current count of the allocated resources in the subscription. + * + * @return the currentValue value + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Get gets the maximum count of the resources that can be allocated in the subscription. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Get gets the name of the type of usage. + * + * @return the name value + */ + public UsageName name() { + return this.name; + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/UsagesImpl.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/UsagesImpl.java new file mode 100644 index 0000000000000..cd24ea1e09ace --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/UsagesImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Usages; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_08_01_preview.Usage; + +class UsagesImpl extends WrapperImpl implements Usages { + private final StorageManager manager; + + UsagesImpl(StorageManager manager) { + super(manager.inner().usages()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + private UsageImpl wrapModel(UsageInner inner) { + return new UsageImpl(inner, manager()); + } + + @Override + public Observable listByLocationAsync(String location) { + UsagesInner client = this.inner(); + return client.listByLocationAsync(location) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Usage call(UsageInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/UsagesInner.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/UsagesInner.java new file mode 100644 index 0000000000000..5407afa261f7b --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/UsagesInner.java @@ -0,0 +1,145 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Usages. + */ +public class UsagesInner { + /** The Retrofit service to perform REST calls. */ + private UsagesService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of UsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public UsagesInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(UsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Usages to be + * used by Retrofit to perform actually REST calls. + */ + interface UsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_08_01_preview.Usages listByLocation" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages") + Observable> listByLocation(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<UsageInner> object if successful. + */ + public List listByLocation(String location) { + return listByLocationWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByLocationAsync(String location, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByLocationWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable> listByLocationAsync(String location) { + return listByLocationWithServiceResponseAsync(location).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable>> listByLocationWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByLocation(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByLocationDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByLocationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/package-info.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..27e8c9b7dd9d2 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for StorageManagementClient. + * The Azure Storage Management API. + */ +package com.microsoft.azure.management.storage.v2019_08_01_preview.implementation; diff --git a/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/package-info.java b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/package-info.java new file mode 100644 index 0000000000000..11d76117ccb28 --- /dev/null +++ b/sdk/storage/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/storage/v2019_08_01_preview/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for StorageManagementClient. + * The Azure Storage Management API. + */ +package com.microsoft.azure.management.storage.v2019_08_01_preview;