From f7c343db0cf2128e82c3bee395655f39cdd690bd Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Mon, 15 Jun 2020 18:22:47 +0000 Subject: [PATCH] Update from master --- sdk/storage/mgmt-v2019_06_01/pom.xml | 6 +- .../storage/v2019_06_01/BlobContainer.java | 20 + .../v2019_06_01/BlobServiceProperties.java | 1 - .../storage/v2019_06_01/Encryption.java | 27 + .../v2019_06_01/FileServiceProperties.java | 1 - .../storage/v2019_06_01/FileShare.java | 2 +- .../storage/v2019_06_01/FileShareItem.java | 2 +- .../v2019_06_01/ListContainerItem.java | 20 + .../v2019_06_01/ListContainersInclude.java | 38 + .../storage/v2019_06_01/ListQueue.java | 41 + .../v2019_06_01/ListQueueServices.java | 27 + .../v2019_06_01/ListTableServices.java | 27 + .../v2019_06_01/ManagementPolicyRule.java | 2 + .../PrivateEndpointConnections.java | 14 +- .../v2019_06_01/QueueServiceProperties.java | 118 ++ .../storage/v2019_06_01/QueueServices.java | 40 + .../storage/v2019_06_01/Queues.java | 53 + ...ccountCheckNameAvailabilityParameters.java | 1 + .../storage/v2019_06_01/StorageQueue.java | 122 ++ .../management/storage/v2019_06_01/Table.java | 92 ++ .../v2019_06_01/TableServiceProperties.java | 118 ++ .../storage/v2019_06_01/TableServices.java | 40 + .../storage/v2019_06_01/Tables.java | 53 + .../implementation/BlobContainerImpl.java | 22 +- .../implementation/BlobContainerInner.java | 62 +- .../implementation/BlobContainersInner.java | 31 +- .../implementation/FileShareImpl.java | 2 +- .../implementation/FileShareInner.java | 4 +- .../implementation/FileShareItemImpl.java | 2 +- .../implementation/FileShareItemInner.java | 4 +- .../implementation/ListContainerItemImpl.java | 22 +- .../ListContainerItemInner.java | 62 +- .../implementation/ListQueueImpl.java | 47 + .../implementation/ListQueueInner.java | 47 + .../implementation/ListQueueServicesImpl.java | 32 + .../ListQueueServicesInner.java | 33 + .../implementation/ListTableServicesImpl.java | 32 + .../ListTableServicesInner.java | 33 + .../PrivateEndpointConnectionsImpl.java | 19 + .../PrivateEndpointConnectionsInner.java | 121 +- .../QueueServicePropertiesImpl.java | 134 +++ .../QueueServicePropertiesInner.java | 50 + .../implementation/QueueServicesImpl.java | 72 ++ .../implementation/QueueServicesInner.java | 422 +++++++ .../implementation/QueuesImpl.java | 82 ++ .../implementation/QueuesInner.java | 1017 +++++++++++++++++ .../StorageManagementClientImpl.java | 56 + .../implementation/StorageManager.java | 48 + .../implementation/StorageQueueImpl.java | 117 ++ .../implementation/StorageQueueInner.java | 64 ++ .../v2019_06_01/implementation/TableImpl.java | 99 ++ .../implementation/TableInner.java | 35 + .../TableServicePropertiesImpl.java | 134 +++ .../TableServicePropertiesInner.java | 50 + .../implementation/TableServicesImpl.java | 72 ++ .../implementation/TableServicesInner.java | 422 +++++++ .../implementation/TablesImpl.java | 81 ++ .../implementation/TablesInner.java | 694 +++++++++++ 58 files changed, 5046 insertions(+), 43 deletions(-) create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListContainersInclude.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListQueue.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListQueueServices.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListTableServices.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/QueueServiceProperties.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/QueueServices.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Queues.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageQueue.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Table.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/TableServiceProperties.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/TableServices.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Tables.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueImpl.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueInner.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueServicesImpl.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueServicesInner.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListTableServicesImpl.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListTableServicesInner.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicePropertiesImpl.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicePropertiesInner.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicesImpl.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicesInner.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueuesImpl.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueuesInner.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageQueueImpl.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageQueueInner.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableImpl.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableInner.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicePropertiesImpl.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicePropertiesInner.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicesImpl.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicesInner.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TablesImpl.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TablesInner.java diff --git a/sdk/storage/mgmt-v2019_06_01/pom.xml b/sdk/storage/mgmt-v2019_06_01/pom.xml index 25a9908aa7687..1ce26f37d8391 100644 --- a/sdk/storage/mgmt-v2019_06_01/pom.xml +++ b/sdk/storage/mgmt-v2019_06_01/pom.xml @@ -11,11 +11,11 @@ com.microsoft.azure azure-arm-parent - 1.3.0 - ../../parents/azure-arm-parent + 1.1.0 + ../../../pom.management.xml azure-mgmt-storage - 1.0.0-beta-7 + 1.0.0-beta jar Microsoft Azure SDK for Storage Management This package contains Microsoft Storage Management SDK. diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobContainer.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobContainer.java index 10aa2eb9602d2..a8b2eccbbdeb5 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobContainer.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobContainer.java @@ -28,6 +28,16 @@ public interface BlobContainer extends HasInner, Indexable, */ String defaultEncryptionScope(); + /** + * @return the deleted value. + */ + Boolean deleted(); + + /** + * @return the deletedTime value. + */ + DateTime deletedTime(); + /** * @return the denyEncryptionScopeOverride value. */ @@ -98,11 +108,21 @@ public interface BlobContainer extends HasInner, Indexable, */ 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. */ diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobServiceProperties.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobServiceProperties.java index ee76aa4206be5..0d77af847f630 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobServiceProperties.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobServiceProperties.java @@ -16,7 +16,6 @@ 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_06_01.implementation.SkuInner; import com.microsoft.azure.management.storage.v2019_06_01.implementation.StorageManager; /** diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Encryption.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Encryption.java index 37251e878db83..64f09ad063256 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Encryption.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Encryption.java @@ -28,6 +28,13 @@ public class Encryption { @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. */ @@ -74,6 +81,26 @@ public Encryption withKeySource(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. * diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileServiceProperties.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileServiceProperties.java index c0dedd1ea00b7..8bd2a2d904708 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileServiceProperties.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileServiceProperties.java @@ -16,7 +16,6 @@ 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_06_01.implementation.SkuInner; import com.microsoft.azure.management.storage.v2019_06_01.implementation.StorageManager; import java.util.List; diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileShare.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileShare.java index 28009ece01d0e..ed4ca4f0c51d3 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileShare.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileShare.java @@ -96,7 +96,7 @@ public interface FileShare extends HasInner, Indexable, Updatabl /** * @return the shareUsageBytes value. */ - Integer shareUsageBytes(); + Long shareUsageBytes(); /** * @return the type value. diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileShareItem.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileShareItem.java index 06ae922b8147f..bd0f591023783 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileShareItem.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileShareItem.java @@ -92,7 +92,7 @@ public interface FileShareItem extends HasInner, HasManager< /** * @return the shareUsageBytes value. */ - Integer shareUsageBytes(); + Long shareUsageBytes(); /** * @return the type value. diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListContainerItem.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListContainerItem.java index a1af2200a98cb..58bd1dab9798a 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListContainerItem.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListContainerItem.java @@ -24,6 +24,16 @@ public interface ListContainerItem extends HasInner, Has */ String defaultEncryptionScope(); + /** + * @return the deleted value. + */ + Boolean deleted(); + + /** + * @return the deletedTime value. + */ + DateTime deletedTime(); + /** * @return the denyEncryptionScopeOverride value. */ @@ -94,9 +104,19 @@ public interface ListContainerItem extends HasInner, Has */ 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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListContainersInclude.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListContainersInclude.java new file mode 100644 index 0000000000000..df77251abc80d --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01; + +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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListQueue.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListQueue.java new file mode 100644 index 0000000000000..74924e6c34b1e --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListQueueServices.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListQueueServices.java new file mode 100644 index 0000000000000..66268e7cb332a --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.ListQueueServicesInner; +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListTableServices.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListTableServices.java new file mode 100644 index 0000000000000..6e01a5bc4163d --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.ListTableServicesInner; +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ManagementPolicyRule.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ManagementPolicyRule.java index a9fd9a117a19b..e6acc3bff8e31 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ManagementPolicyRule.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ManagementPolicyRule.java @@ -42,6 +42,8 @@ public class ManagementPolicyRule { /** * 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"; diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/PrivateEndpointConnections.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/PrivateEndpointConnections.java index 6e2dbbbf55bb9..c97a7db538ee1 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/PrivateEndpointConnections.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/PrivateEndpointConnections.java @@ -23,18 +23,28 @@ public interface PrivateEndpointConnections extends SupportsCreating 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 Storage Account + * @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 */ diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/QueueServiceProperties.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/QueueServiceProperties.java new file mode 100644 index 0000000000000..62376e516fd2a --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/QueueServices.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/QueueServices.java new file mode 100644 index 0000000000000..e4823ffd08905 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Queues.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Queues.java new file mode 100644 index 0000000000000..3ab56be30d5f9 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountCheckNameAvailabilityParameters.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountCheckNameAvailabilityParameters.java index d9a0558516bf8..1e4a2a57218c9 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountCheckNameAvailabilityParameters.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountCheckNameAvailabilityParameters.java @@ -28,6 +28,7 @@ public class StorageAccountCheckNameAvailabilityParameters { /** * Creates an instance of StorageAccountCheckNameAvailabilityParameters class. + * @param name the storage account name. */ public StorageAccountCheckNameAvailabilityParameters() { type = "Microsoft.Storage/storageAccounts"; diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageQueue.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageQueue.java new file mode 100644 index 0000000000000..79e93f7e19df3 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Table.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Table.java new file mode 100644 index 0000000000000..db39ef8b176c7 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/TableServiceProperties.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/TableServiceProperties.java new file mode 100644 index 0000000000000..f99dd7a7d56f8 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/TableServices.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/TableServices.java new file mode 100644 index 0000000000000..d0d9000969893 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Tables.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Tables.java new file mode 100644 index 0000000000000..cbbd2b98cbc7e --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainerImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainerImpl.java index 9d17991161c9e..849f6a8a74d1d 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainerImpl.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainerImpl.java @@ -11,8 +11,8 @@ import com.microsoft.azure.management.storage.v2019_06_01.BlobContainer; import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; import rx.Observable; -import com.microsoft.azure.management.storage.v2019_06_01.PublicAccess; import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_06_01.PublicAccess; import com.microsoft.azure.management.storage.v2019_06_01.LeaseStatus; import com.microsoft.azure.management.storage.v2019_06_01.LeaseState; import com.microsoft.azure.management.storage.v2019_06_01.LeaseDuration; @@ -82,6 +82,16 @@ 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(); @@ -152,11 +162,21 @@ 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; diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainerInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainerInner.java index 9272d7f5975d4..8c4744c35e9a5 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainerInner.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainerInner.java @@ -8,8 +8,8 @@ package com.microsoft.azure.management.storage.v2019_06_01.implementation; -import com.microsoft.azure.management.storage.v2019_06_01.PublicAccess; import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_06_01.PublicAccess; import com.microsoft.azure.management.storage.v2019_06_01.LeaseStatus; import com.microsoft.azure.management.storage.v2019_06_01.LeaseState; import com.microsoft.azure.management.storage.v2019_06_01.LeaseDuration; @@ -26,6 +26,30 @@ */ @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. */ @@ -110,6 +134,42 @@ public class BlobContainerInner extends AzureEntityResource { @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. * diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainersInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainersInner.java index 1359df72b1e17..48e880fdf9e16 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainersInner.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainersInner.java @@ -19,6 +19,7 @@ import com.microsoft.azure.management.storage.v2019_06_01.BlobContainersGetImmutabilityPolicyHeaders; import com.microsoft.azure.management.storage.v2019_06_01.BlobContainersLockImmutabilityPolicyHeaders; import com.microsoft.azure.management.storage.v2019_06_01.LeaseContainerRequest; +import com.microsoft.azure.management.storage.v2019_06_01.ListContainersInclude; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -72,7 +73,7 @@ public BlobContainersInner(Retrofit retrofit, StorageManagementClientImpl client interface BlobContainersService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.BlobContainers list" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers") - Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$maxpagesize") String maxpagesize, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + 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_06_01.BlobContainers create" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") @@ -232,7 +233,8 @@ public Observable>> listSinglePageA } 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()) + 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) { @@ -253,13 +255,14 @@ public Observable>> call(Response list(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter) { - ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter).toBlocking().single(); + 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) { @@ -275,13 +278,14 @@ public Page nextPage(String nextPageLink) { * @param accountName The name of the storage account within the 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 ListOperationCallback serviceCallback) { + 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), + listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include), new Func1>>>() { @Override public Observable>> call(String nextPageLink) { @@ -298,11 +302,12 @@ public Observable>> call(String nex * @param accountName The name of the storage account within the 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) { - return listWithServiceResponseAsync(resourceGroupName, accountName, maxpagesize, filter) + 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) { @@ -318,11 +323,12 @@ public Page call(ServiceResponse>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter) { - return listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter) + 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) { @@ -342,10 +348,11 @@ public Observable>> call(ServiceRes 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) { + 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."); } @@ -358,7 +365,7 @@ public Observable>> listSinglePageA 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()) + 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) { diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareImpl.java index f76e6bfe69153..51ed93ec1c896 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareImpl.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareImpl.java @@ -145,7 +145,7 @@ public Integer shareQuota() { } @Override - public Integer shareUsageBytes() { + public Long shareUsageBytes() { return this.inner().shareUsageBytes(); } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareInner.java index b969495f3f540..4b8e06b288cf2 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareInner.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareInner.java @@ -107,7 +107,7 @@ public class FileShareInner extends AzureEntityResource { * value may not include all recently created or recently resized files. */ @JsonProperty(value = "properties.shareUsageBytes", access = JsonProperty.Access.WRITE_ONLY) - private Integer shareUsageBytes; + private Long shareUsageBytes; /** * Get returns the date and time the share was last modified. @@ -277,7 +277,7 @@ public String accessTierStatus() { * * @return the shareUsageBytes value */ - public Integer shareUsageBytes() { + public Long shareUsageBytes() { return this.shareUsageBytes; } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareItemImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareItemImpl.java index db81fb7c9d9a6..018c7a644589d 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareItemImpl.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareItemImpl.java @@ -99,7 +99,7 @@ public Integer shareQuota() { } @Override - public Integer shareUsageBytes() { + public Long shareUsageBytes() { return this.inner().shareUsageBytes(); } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareItemInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareItemInner.java index 22ba754c49321..5a7043a5d7107 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareItemInner.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareItemInner.java @@ -106,7 +106,7 @@ public class FileShareItemInner extends AzureEntityResource { * value may not include all recently created or recently resized files. */ @JsonProperty(value = "properties.shareUsageBytes", access = JsonProperty.Access.WRITE_ONLY) - private Integer shareUsageBytes; + private Long shareUsageBytes; /** * Get returns the date and time the share was last modified. @@ -276,7 +276,7 @@ public String accessTierStatus() { * * @return the shareUsageBytes value */ - public Integer shareUsageBytes() { + public Long shareUsageBytes() { return this.shareUsageBytes; } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListContainerItemImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListContainerItemImpl.java index ed7920196679f..ca87cfc42da2a 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListContainerItemImpl.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListContainerItemImpl.java @@ -10,8 +10,8 @@ import com.microsoft.azure.management.storage.v2019_06_01.ListContainerItem; import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import com.microsoft.azure.management.storage.v2019_06_01.ImmutabilityPolicyProperties; import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_06_01.ImmutabilityPolicyProperties; import com.microsoft.azure.management.storage.v2019_06_01.LeaseDuration; import com.microsoft.azure.management.storage.v2019_06_01.LeaseState; import com.microsoft.azure.management.storage.v2019_06_01.LeaseStatus; @@ -36,6 +36,16 @@ 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(); @@ -106,9 +116,19 @@ 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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListContainerItemInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListContainerItemInner.java index da02788d5c0fe..62e39e241d98e 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListContainerItemInner.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListContainerItemInner.java @@ -8,8 +8,8 @@ package com.microsoft.azure.management.storage.v2019_06_01.implementation; -import com.microsoft.azure.management.storage.v2019_06_01.PublicAccess; import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_06_01.PublicAccess; import com.microsoft.azure.management.storage.v2019_06_01.LeaseStatus; import com.microsoft.azure.management.storage.v2019_06_01.LeaseState; import com.microsoft.azure.management.storage.v2019_06_01.LeaseDuration; @@ -25,6 +25,30 @@ */ @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. */ @@ -109,6 +133,42 @@ public class ListContainerItemInner extends AzureEntityResource { @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. * diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueImpl.java new file mode 100644 index 0000000000000..95ee5715fb4ff --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.implementation; + +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueInner.java new file mode 100644 index 0000000000000..a411d56a9917e --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueServicesImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueServicesImpl.java new file mode 100644 index 0000000000000..1cebea1634470 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.implementation; + +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueServicesInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueServicesInner.java new file mode 100644 index 0000000000000..57968f0626af9 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListTableServicesImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListTableServicesImpl.java new file mode 100644 index 0000000000000..7dbbf3c0412e2 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.implementation; + +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListTableServicesInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListTableServicesInner.java new file mode 100644 index 0000000000000..8cb686b05d8ba --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/PrivateEndpointConnectionsImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/PrivateEndpointConnectionsImpl.java index 4820ca83aad27..0b85d517bf0da 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/PrivateEndpointConnectionsImpl.java @@ -14,6 +14,7 @@ import rx.Completable; import rx.Observable; import rx.functions.Func1; +import java.util.List; import com.microsoft.azure.management.storage.v2019_06_01.PrivateEndpointConnection; class PrivateEndpointConnectionsImpl extends WrapperImpl implements PrivateEndpointConnections { @@ -41,6 +42,24 @@ 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(); diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/PrivateEndpointConnectionsInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/PrivateEndpointConnectionsInner.java index 2807334b1d1a9..d9759268d8029 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/PrivateEndpointConnectionsInner.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/PrivateEndpointConnectionsInner.java @@ -10,12 +10,14 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; import com.microsoft.azure.management.storage.v2019_06_01.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; @@ -55,6 +57,10 @@ public PrivateEndpointConnectionsInner(Retrofit retrofit, StorageManagementClien * 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_06_01.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_06_01.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); @@ -69,12 +75,103 @@ interface PrivateEndpointConnectionsService { } + /** + * 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 Storage Account + * @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 @@ -89,7 +186,7 @@ public PrivateEndpointConnectionInner get(String resourceGroupName, String accou * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the 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 Storage Account + * @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 @@ -103,7 +200,7 @@ public ServiceFuture getAsync(String resourceGro * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the 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 Storage Account + * @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 */ @@ -121,7 +218,7 @@ public PrivateEndpointConnectionInner call(ServiceResponse getDelegate(Response putAsync(String resourceGro * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the 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 Storage Account + * @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 @@ -217,7 +314,7 @@ public PrivateEndpointConnectionInner call(ServiceResponse putDelegate(Response deleteAsync(String resourceGroupName, String accountN * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the 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 Storage Account + * @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. */ @@ -314,7 +411,7 @@ public Void call(ServiceResponse response) { * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the 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 Storage Account + * @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. */ diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicePropertiesImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicePropertiesImpl.java new file mode 100644 index 0000000000000..659869d3f5350 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.implementation; + +import com.microsoft.azure.management.storage.v2019_06_01.QueueServiceProperties; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicePropertiesInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicePropertiesInner.java new file mode 100644 index 0000000000000..bcccc6b10ceb6 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.implementation; + +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicesImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicesImpl.java new file mode 100644 index 0000000000000..1e3e6bef4239b --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_06_01.QueueServices; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.storage.v2019_06_01.ListQueueServices; +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicesInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicesInner.java new file mode 100644 index 0000000000000..9c5cc6a9a5438 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01.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_06_01.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_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueuesImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueuesImpl.java new file mode 100644 index 0000000000000..09e623f81edf1 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_06_01.Queues; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.storage.v2019_06_01.StorageQueue; +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueuesInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueuesInner.java new file mode 100644 index 0000000000000..1eea50046fd60 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.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_06_01.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_06_01.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_06_01.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_06_01.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_06_01.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_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageManagementClientImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageManagementClientImpl.java index 518cd6f65496e..70c6c8a1e111d 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageManagementClientImpl.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageManagementClientImpl.java @@ -303,6 +303,58 @@ 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. * @@ -351,6 +403,10 @@ protected void initialize() { 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); } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageManager.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageManager.java index 0b8c11bad860b..34506014b3fdb 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageManager.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageManager.java @@ -29,6 +29,10 @@ import com.microsoft.azure.management.storage.v2019_06_01.BlobContainers; import com.microsoft.azure.management.storage.v2019_06_01.FileServices; import com.microsoft.azure.management.storage.v2019_06_01.FileShares; +import com.microsoft.azure.management.storage.v2019_06_01.QueueServices; +import com.microsoft.azure.management.storage.v2019_06_01.Queues; +import com.microsoft.azure.management.storage.v2019_06_01.TableServices; +import com.microsoft.azure.management.storage.v2019_06_01.Tables; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -49,6 +53,10 @@ public final class StorageManager extends ManagerCore 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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageQueueInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageQueueInner.java new file mode 100644 index 0000000000000..5b30364890509 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableImpl.java new file mode 100644 index 0000000000000..174b1a15de256 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.implementation; + +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableInner.java new file mode 100644 index 0000000000000..01cffb1f89220 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicePropertiesImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicePropertiesImpl.java new file mode 100644 index 0000000000000..0c882ac539a26 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.implementation; + +import com.microsoft.azure.management.storage.v2019_06_01.TableServiceProperties; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicePropertiesInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicePropertiesInner.java new file mode 100644 index 0000000000000..2fa362eaf2111 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.implementation; + +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicesImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicesImpl.java new file mode 100644 index 0000000000000..967b37394bfd3 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_06_01.TableServices; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.storage.v2019_06_01.ListTableServices; +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicesInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicesInner.java new file mode 100644 index 0000000000000..9611c3bab832f --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01.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_06_01.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_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TablesImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TablesImpl.java new file mode 100644 index 0000000000000..befb6d68c6b08 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_06_01.Tables; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.storage.v2019_06_01.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_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TablesInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TablesInner.java new file mode 100644 index 0000000000000..02f10a72f05f9 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/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_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.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_06_01.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_06_01.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_06_01.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_06_01.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_06_01.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_06_01.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); + } + +}