From 066ada8c6be4d1d6960a026e9f39db0395fc1a73 Mon Sep 17 00:00:00 2001 From: SDK Automation <sdkautomation@microsoft.com> Date: Fri, 7 Feb 2020 06:48:02 +0000 Subject: [PATCH] Generated from c95b01e9e6a7b64cc5e7cc070166d6d626c2a7d4 Merge branch 'master' of https://github.com/zfchen95/azure-rest-api-specs into nfsshare --- sdk/storage/mgmt-v2019_06_01/pom.xml | 4 +- .../v2019_06_01/BlobRestoreParameters.java | 71 +++++ .../BlobRestoreProgressStatus.java | 44 +++ .../storage/v2019_06_01/BlobRestoreRange.java | 69 +++++ .../v2019_06_01/BlobRestoreStatus.java | 40 +++ .../v2019_06_01/BlobServiceProperties.java | 34 ++- .../storage/v2019_06_01/EnabledProtocols.java | 41 +++ .../v2019_06_01/FileServiceProperties.java | 1 - .../storage/v2019_06_01/FileShare.java | 90 +++++-- .../storage/v2019_06_01/FileShareItem.java | 10 + .../v2019_06_01/RestorePolicyProperties.java | 70 +++++ .../storage/v2019_06_01/RootSquashType.java | 44 +++ .../storage/v2019_06_01/StorageAccount.java | 5 + .../v2019_06_01/StorageAccountExpand.java | 5 +- .../storage/v2019_06_01/StorageAccounts.java | 14 + .../implementation/BlobRestoreStatusImpl.java | 48 ++++ .../BlobRestoreStatusInner.java | 83 ++++++ .../BlobServicePropertiesImpl.java | 12 + .../BlobServicePropertiesInner.java | 27 ++ .../implementation/FileShareImpl.java | 46 ++-- .../implementation/FileShareInner.java | 56 ++++ .../implementation/FileShareItemImpl.java | 12 + .../implementation/FileShareItemInner.java | 56 ++++ .../implementation/FileSharesInner.java | 255 +++--------------- .../implementation/StorageAccountImpl.java | 11 + .../implementation/StorageAccountInner.java | 15 ++ .../implementation/StorageAccountsImpl.java | 16 ++ .../implementation/StorageAccountsInner.java | 211 ++++++++++++++- 28 files changed, 1123 insertions(+), 267 deletions(-) create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreParameters.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreProgressStatus.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreRange.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreStatus.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/EnabledProtocols.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/RestorePolicyProperties.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/RootSquashType.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobRestoreStatusImpl.java create mode 100644 sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobRestoreStatusInner.java diff --git a/sdk/storage/mgmt-v2019_06_01/pom.xml b/sdk/storage/mgmt-v2019_06_01/pom.xml index 3f831c08f482..1ce26f37d839 100644 --- a/sdk/storage/mgmt-v2019_06_01/pom.xml +++ b/sdk/storage/mgmt-v2019_06_01/pom.xml @@ -11,11 +11,11 @@ <parent> <groupId>com.microsoft.azure</groupId> <artifactId>azure-arm-parent</artifactId> - <version>1.2.0</version> + <version>1.1.0</version> <relativePath>../../../pom.management.xml</relativePath> </parent> <artifactId>azure-mgmt-storage</artifactId> - <version>1.0.0-beta-2</version> + <version>1.0.0-beta</version> <packaging>jar</packaging> <name>Microsoft Azure SDK for Storage Management</name> <description>This package contains Microsoft Storage Management SDK.</description> diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreParameters.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreParameters.java new file mode 100644 index 000000000000..9908a3552e18 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreParameters.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_06_01; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Blob restore parameters. + */ +public class BlobRestoreParameters { + /** + * Restore blob to the specified time. + */ + @JsonProperty(value = "timeToRestore", required = true) + private DateTime timeToRestore; + + /** + * Blob ranges to restore. + */ + @JsonProperty(value = "blobRanges", required = true) + private List<BlobRestoreRange> blobRanges; + + /** + * Get restore blob to the specified time. + * + * @return the timeToRestore value + */ + public DateTime timeToRestore() { + return this.timeToRestore; + } + + /** + * Set restore blob to the specified time. + * + * @param timeToRestore the timeToRestore value to set + * @return the BlobRestoreParameters object itself. + */ + public BlobRestoreParameters withTimeToRestore(DateTime timeToRestore) { + this.timeToRestore = timeToRestore; + return this; + } + + /** + * Get blob ranges to restore. + * + * @return the blobRanges value + */ + public List<BlobRestoreRange> blobRanges() { + return this.blobRanges; + } + + /** + * Set blob ranges to restore. + * + * @param blobRanges the blobRanges value to set + * @return the BlobRestoreParameters object itself. + */ + public BlobRestoreParameters withBlobRanges(List<BlobRestoreRange> blobRanges) { + this.blobRanges = blobRanges; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreProgressStatus.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreProgressStatus.java new file mode 100644 index 000000000000..20dd148cca51 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreProgressStatus.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BlobRestoreProgressStatus. + */ +public final class BlobRestoreProgressStatus extends ExpandableStringEnum<BlobRestoreProgressStatus> { + /** Static value InProgress for BlobRestoreProgressStatus. */ + public static final BlobRestoreProgressStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Complete for BlobRestoreProgressStatus. */ + public static final BlobRestoreProgressStatus COMPLETE = fromString("Complete"); + + /** Static value Failed for BlobRestoreProgressStatus. */ + public static final BlobRestoreProgressStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a BlobRestoreProgressStatus from its string representation. + * @param name a name to look for + * @return the corresponding BlobRestoreProgressStatus + */ + @JsonCreator + public static BlobRestoreProgressStatus fromString(String name) { + return fromString(name, BlobRestoreProgressStatus.class); + } + + /** + * @return known BlobRestoreProgressStatus values + */ + public static Collection<BlobRestoreProgressStatus> values() { + return values(BlobRestoreProgressStatus.class); + } +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreRange.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreRange.java new file mode 100644 index 000000000000..1569b651a761 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreRange.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Blob range. + */ +public class BlobRestoreRange { + /** + * Blob start range. Empty means account start. + */ + @JsonProperty(value = "startRange", required = true) + private String startRange; + + /** + * Blob end range. Empty means account end. + */ + @JsonProperty(value = "endRange", required = true) + private String endRange; + + /** + * Get blob start range. Empty means account start. + * + * @return the startRange value + */ + public String startRange() { + return this.startRange; + } + + /** + * Set blob start range. Empty means account start. + * + * @param startRange the startRange value to set + * @return the BlobRestoreRange object itself. + */ + public BlobRestoreRange withStartRange(String startRange) { + this.startRange = startRange; + return this; + } + + /** + * Get blob end range. Empty means account end. + * + * @return the endRange value + */ + public String endRange() { + return this.endRange; + } + + /** + * Set blob end range. Empty means account end. + * + * @param endRange the endRange value to set + * @return the BlobRestoreRange object itself. + */ + public BlobRestoreRange withEndRange(String endRange) { + this.endRange = endRange; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreStatus.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreStatus.java new file mode 100644 index 000000000000..6f0d56f2b46e --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobRestoreStatus.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_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.BlobRestoreStatusInner; + +/** + * Type representing BlobRestoreStatus. + */ +public interface BlobRestoreStatus extends HasInner<BlobRestoreStatusInner>, HasManager<StorageManager> { + /** + * @return the failureReason value. + */ + String failureReason(); + + /** + * @return the parameters value. + */ + BlobRestoreParameters parameters(); + + /** + * @return the restoreId value. + */ + String restoreId(); + + /** + * @return the status value. + */ + BlobRestoreProgressStatus status(); + +} diff --git a/sdk/storage/mgmt-v2019_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 a17747a01972..70ca25de06b3 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 @@ -17,7 +17,6 @@ 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 com.microsoft.azure.management.storage.v2019_06_01.implementation.SkuInner; /** * Type representing BlobServiceProperties. @@ -58,6 +57,11 @@ public interface BlobServiceProperties extends HasInner<BlobServicePropertiesInn */ String name(); + /** + * @return the restorePolicy value. + */ + RestorePolicyProperties restorePolicy(); + /** * @return the sku value. */ @@ -157,18 +161,30 @@ interface WithDeleteRetentionPolicy { WithCreate withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy); } + /** + * The stage of the blobserviceproperties definition allowing to specify RestorePolicy. + */ + interface WithRestorePolicy { + /** + * Specifies restorePolicy. + * @param restorePolicy The blob service properties for blob restore policy + * @return the next definition stage + */ + WithCreate withRestorePolicy(RestorePolicyProperties restorePolicy); + } + /** * The stage of the definition which contains all the minimum required inputs for * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable<BlobServiceProperties>, DefinitionStages.WithAutomaticSnapshotPolicyEnabled, DefinitionStages.WithChangeFeed, DefinitionStages.WithCors, DefinitionStages.WithDefaultServiceVersion, DefinitionStages.WithDeleteRetentionPolicy { + interface WithCreate extends Creatable<BlobServiceProperties>, DefinitionStages.WithAutomaticSnapshotPolicyEnabled, DefinitionStages.WithChangeFeed, DefinitionStages.WithCors, DefinitionStages.WithDefaultServiceVersion, DefinitionStages.WithDeleteRetentionPolicy, DefinitionStages.WithRestorePolicy { } } /** * The template for a BlobServiceProperties update operation, containing all the settings that can be modified. */ - interface Update extends Appliable<BlobServiceProperties>, UpdateStages.WithAutomaticSnapshotPolicyEnabled, UpdateStages.WithChangeFeed, UpdateStages.WithCors, UpdateStages.WithDefaultServiceVersion, UpdateStages.WithDeleteRetentionPolicy { + interface Update extends Appliable<BlobServiceProperties>, UpdateStages.WithAutomaticSnapshotPolicyEnabled, UpdateStages.WithChangeFeed, UpdateStages.WithCors, UpdateStages.WithDefaultServiceVersion, UpdateStages.WithDeleteRetentionPolicy, UpdateStages.WithRestorePolicy { } /** @@ -235,5 +251,17 @@ interface WithDeleteRetentionPolicy { Update withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy); } + /** + * The stage of the blobserviceproperties update allowing to specify RestorePolicy. + */ + interface WithRestorePolicy { + /** + * Specifies restorePolicy. + * @param restorePolicy The blob service properties for blob restore policy + * @return the next update stage + */ + Update withRestorePolicy(RestorePolicyProperties restorePolicy); + } + } } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/EnabledProtocols.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/EnabledProtocols.java new file mode 100644 index 000000000000..3502d5c9712e --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/EnabledProtocols.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EnabledProtocols. + */ +public final class EnabledProtocols extends ExpandableStringEnum<EnabledProtocols> { + /** Static value SMB for EnabledProtocols. */ + public static final EnabledProtocols SMB = fromString("SMB"); + + /** Static value NFS for EnabledProtocols. */ + public static final EnabledProtocols NFS = fromString("NFS"); + + /** + * Creates or finds a EnabledProtocols from its string representation. + * @param name a name to look for + * @return the corresponding EnabledProtocols + */ + @JsonCreator + public static EnabledProtocols fromString(String name) { + return fromString(name, EnabledProtocols.class); + } + + /** + * @return known EnabledProtocols values + */ + public static Collection<EnabledProtocols> values() { + return values(EnabledProtocols.class); + } +} 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 468c2d586e70..8bd2a2d90470 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 @@ -17,7 +17,6 @@ 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 com.microsoft.azure.management.storage.v2019_06_01.implementation.SkuInner; 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 c36a39ec536f..61f06dfb3ccd 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 @@ -16,13 +16,18 @@ 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; import org.joda.time.DateTime; +import java.util.Map; /** * Type representing FileShare. */ public interface FileShare extends HasInner<FileShareInner>, Indexable, Updatable<FileShare.Update>, HasManager<StorageManager> { + /** + * @return the enabledProtocols value. + */ + EnabledProtocols enabledProtocols(); + /** * @return the etag value. */ @@ -48,6 +53,11 @@ public interface FileShare extends HasInner<FileShareInner>, Indexable, Updatabl */ String name(); + /** + * @return the rootSquash value. + */ + RootSquashType rootSquash(); + /** * @return the shareQuota value. */ @@ -61,7 +71,7 @@ public interface FileShare extends HasInner<FileShareInner>, Indexable, Updatabl /** * The entirety of the FileShare definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithFileService, DefinitionStages.WithMetadata, DefinitionStages.WithShareQuota, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithFileService, DefinitionStages.WithCreate { } /** @@ -84,30 +94,54 @@ interface WithFileService { * @param accountName The name of the storage account within 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 withExistingFileService(String resourceGroupName, String accountName); + WithCreate withExistingFileService(String resourceGroupName, String accountName); + } + + /** + * The stage of the fileshare definition allowing to specify EnabledProtocols. + */ + interface WithEnabledProtocols { + /** + * Specifies enabledProtocols. + * @param enabledProtocols Immutable property for file shares protocol. Possible values include: 'SMB', 'NFS' + * @return the next definition stage + */ + WithCreate withEnabledProtocols(EnabledProtocols enabledProtocols); } /** * The stage of the fileshare definition allowing to specify Metadata. */ interface WithMetadata { - /** - * Specifies metadata. - * @param metadata A name-value pair to associate with the share as metadata - * @return the next definition stage - */ - WithShareQuota withMetadata(Map<String, String> metadata); + /** + * Specifies metadata. + * @param metadata A name-value pair to associate with the share as metadata + * @return the next definition stage + */ + WithCreate withMetadata(Map<String, String> metadata); + } + + /** + * The stage of the fileshare definition allowing to specify RootSquash. + */ + interface WithRootSquash { + /** + * Specifies rootSquash. + * @param rootSquash Reduction of the access rights for the remote superuser. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash' + * @return the next definition stage + */ + WithCreate withRootSquash(RootSquashType rootSquash); } /** * The stage of the fileshare definition allowing to specify ShareQuota. */ interface WithShareQuota { - /** - * Specifies shareQuota. - * @param shareQuota The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400 - * @return the next definition stage - */ + /** + * Specifies shareQuota. + * @param shareQuota The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400 + * @return the next definition stage + */ WithCreate withShareQuota(Integer shareQuota); } @@ -116,19 +150,31 @@ interface WithShareQuota { * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable<FileShare> { + interface WithCreate extends Creatable<FileShare>, DefinitionStages.WithEnabledProtocols, DefinitionStages.WithMetadata, DefinitionStages.WithRootSquash, DefinitionStages.WithShareQuota { } } /** * The template for a FileShare update operation, containing all the settings that can be modified. */ - interface Update extends Appliable<FileShare>, UpdateStages.WithMetadata, UpdateStages.WithShareQuota { + interface Update extends Appliable<FileShare>, UpdateStages.WithEnabledProtocols, UpdateStages.WithMetadata, UpdateStages.WithRootSquash, UpdateStages.WithShareQuota { } /** * Grouping of FileShare update stages. */ interface UpdateStages { + /** + * The stage of the fileshare update allowing to specify EnabledProtocols. + */ + interface WithEnabledProtocols { + /** + * Specifies enabledProtocols. + * @param enabledProtocols Immutable property for file shares protocol. Possible values include: 'SMB', 'NFS' + * @return the next update stage + */ + Update withEnabledProtocols(EnabledProtocols enabledProtocols); + } + /** * The stage of the fileshare update allowing to specify Metadata. */ @@ -141,6 +187,18 @@ interface WithMetadata { Update withMetadata(Map<String, String> metadata); } + /** + * The stage of the fileshare update allowing to specify RootSquash. + */ + interface WithRootSquash { + /** + * Specifies rootSquash. + * @param rootSquash Reduction of the access rights for the remote superuser. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash' + * @return the next update stage + */ + Update withRootSquash(RootSquashType rootSquash); + } + /** * The stage of the fileshare update allowing to specify ShareQuota. */ 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 d0e56e51ef15..fbe144ef87bb 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 @@ -19,6 +19,11 @@ * Type representing FileShareItem. */ public interface FileShareItem extends HasInner<FileShareItemInner>, HasManager<StorageManager> { + /** + * @return the enabledProtocols value. + */ + EnabledProtocols enabledProtocols(); + /** * @return the etag value. */ @@ -44,6 +49,11 @@ public interface FileShareItem extends HasInner<FileShareItemInner>, HasManager< */ String name(); + /** + * @return the rootSquash value. + */ + RootSquashType rootSquash(); + /** * @return the shareQuota value. */ diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/RestorePolicyProperties.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/RestorePolicyProperties.java new file mode 100644 index 000000000000..4c8f0cb6e149 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/RestorePolicyProperties.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The blob service properties for blob restore policy. + */ +public class RestorePolicyProperties { + /** + * Blob restore is enabled if set to true. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /** + * how long this blob can be restored. It should be great than zero and + * less than DeleteRetentionPolicy.days. + */ + @JsonProperty(value = "days") + private Integer days; + + /** + * Get blob restore is enabled if set to true. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set blob restore is enabled if set to true. + * + * @param enabled the enabled value to set + * @return the RestorePolicyProperties object itself. + */ + public RestorePolicyProperties withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days. + * + * @return the days value + */ + public Integer days() { + return this.days; + } + + /** + * Set how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days. + * + * @param days the days value to set + * @return the RestorePolicyProperties object itself. + */ + public RestorePolicyProperties withDays(Integer days) { + this.days = days; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/RootSquashType.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/RootSquashType.java new file mode 100644 index 000000000000..33bb276a170d --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/RootSquashType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RootSquashType. + */ +public final class RootSquashType extends ExpandableStringEnum<RootSquashType> { + /** Static value NoRootSquash for RootSquashType. */ + public static final RootSquashType NO_ROOT_SQUASH = fromString("NoRootSquash"); + + /** Static value RootSquash for RootSquashType. */ + public static final RootSquashType ROOT_SQUASH = fromString("RootSquash"); + + /** Static value AllSquash for RootSquashType. */ + public static final RootSquashType ALL_SQUASH = fromString("AllSquash"); + + /** + * Creates or finds a RootSquashType from its string representation. + * @param name a name to look for + * @return the corresponding RootSquashType + */ + @JsonCreator + public static RootSquashType fromString(String name) { + return fromString(name, RootSquashType.class); + } + + /** + * @return known RootSquashType values + */ + public static Collection<RootSquashType> values() { + return values(RootSquashType.class); + } +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccount.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccount.java index f267ead85fef..51c2cbdb5b3b 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccount.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccount.java @@ -37,6 +37,11 @@ public interface StorageAccount extends HasInner<StorageAccountInner>, Resource, */ AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication(); + /** + * @return the blobRestoreStatus value. + */ + BlobRestoreStatus blobRestoreStatus(); + /** * @return the creationTime value. */ diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountExpand.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountExpand.java index 67e8dfb26e37..e658122256a8 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountExpand.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountExpand.java @@ -16,7 +16,10 @@ */ public enum StorageAccountExpand { /** Enum value geoReplicationStats. */ - GEO_REPLICATION_STATS("geoReplicationStats"); + GEO_REPLICATION_STATS("geoReplicationStats"), + + /** Enum value blobRestoreStatus. */ + BLOB_RESTORE_STATUS("blobRestoreStatus"); /** The actual serialized value for a StorageAccountExpand instance. */ private String value; diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccounts.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccounts.java index c60ca1c8a4ee..886bf0fc5166 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccounts.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccounts.java @@ -16,6 +16,8 @@ import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; import com.microsoft.azure.arm.collection.SupportsListing; import rx.Completable; +import org.joda.time.DateTime; +import java.util.List; import com.microsoft.azure.management.storage.v2019_06_01.implementation.StorageAccountsInner; import com.microsoft.azure.arm.model.HasInner; @@ -76,6 +78,18 @@ public interface StorageAccounts extends SupportsCreating<StorageAccount.Definit */ Completable failoverAsync(String resourceGroupName, String accountName); + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable<BlobRestoreStatus> restoreBlobRangesAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List<BlobRestoreRange> blobRanges); + /** * Revoke user delegation keys. * diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobRestoreStatusImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobRestoreStatusImpl.java new file mode 100644 index 000000000000..b2c69ef4b581 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobRestoreStatusImpl.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_06_01.implementation; + +import com.microsoft.azure.management.storage.v2019_06_01.BlobRestoreStatus; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_06_01.BlobRestoreParameters; +import com.microsoft.azure.management.storage.v2019_06_01.BlobRestoreProgressStatus; + +class BlobRestoreStatusImpl extends WrapperImpl<BlobRestoreStatusInner> implements BlobRestoreStatus { + private final StorageManager manager; + BlobRestoreStatusImpl(BlobRestoreStatusInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String failureReason() { + return this.inner().failureReason(); + } + + @Override + public BlobRestoreParameters parameters() { + return this.inner().parameters(); + } + + @Override + public String restoreId() { + return this.inner().restoreId(); + } + + @Override + public BlobRestoreProgressStatus status() { + return this.inner().status(); + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobRestoreStatusInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobRestoreStatusInner.java new file mode 100644 index 000000000000..9a6fb7113920 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobRestoreStatusInner.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_06_01.implementation; + +import com.microsoft.azure.management.storage.v2019_06_01.BlobRestoreProgressStatus; +import com.microsoft.azure.management.storage.v2019_06_01.BlobRestoreParameters; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Blob restore status. + */ +public class BlobRestoreStatusInner { + /** + * The status of blob restore progress. Possible values are: - InProgress: + * Indicates that blob restore is ongoing. - Complete: Indicates that blob + * restore has been completed successfully. - Failed: Indicates that blob + * restore is failed. Possible values include: 'InProgress', 'Complete', + * 'Failed'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private BlobRestoreProgressStatus status; + + /** + * Failure reason when blob restore is failed. + */ + @JsonProperty(value = "failureReason", access = JsonProperty.Access.WRITE_ONLY) + private String failureReason; + + /** + * Id for tracking blob restore request. + */ + @JsonProperty(value = "restoreId", access = JsonProperty.Access.WRITE_ONLY) + private String restoreId; + + /** + * Blob restore request parameters. + */ + @JsonProperty(value = "parameters", access = JsonProperty.Access.WRITE_ONLY) + private BlobRestoreParameters parameters; + + /** + * Get the status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - Complete: Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is failed. Possible values include: 'InProgress', 'Complete', 'Failed'. + * + * @return the status value + */ + public BlobRestoreProgressStatus status() { + return this.status; + } + + /** + * Get failure reason when blob restore is failed. + * + * @return the failureReason value + */ + public String failureReason() { + return this.failureReason; + } + + /** + * Get id for tracking blob restore request. + * + * @return the restoreId value + */ + public String restoreId() { + return this.restoreId; + } + + /** + * Get blob restore request parameters. + * + * @return the parameters value + */ + public BlobRestoreParameters parameters() { + return this.parameters; + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobServicePropertiesImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobServicePropertiesImpl.java index 0526306ae443..57884a6967a0 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobServicePropertiesImpl.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobServicePropertiesImpl.java @@ -14,6 +14,7 @@ import com.microsoft.azure.management.storage.v2019_06_01.CorsRules; import com.microsoft.azure.management.storage.v2019_06_01.DeleteRetentionPolicy; import com.microsoft.azure.management.storage.v2019_06_01.ChangeFeed; +import com.microsoft.azure.management.storage.v2019_06_01.RestorePolicyProperties; class BlobServicePropertiesImpl extends CreatableUpdatableImpl<BlobServiceProperties, BlobServicePropertiesInner, BlobServicePropertiesImpl> implements BlobServiceProperties, BlobServiceProperties.Definition, BlobServiceProperties.Update { private final StorageManager manager; @@ -105,6 +106,11 @@ public String name() { return this.inner().name(); } + @Override + public RestorePolicyProperties restorePolicy() { + return this.inner().restorePolicy(); + } + @Override public SkuInner sku() { return this.inner().sku(); @@ -152,4 +158,10 @@ public BlobServicePropertiesImpl withDeleteRetentionPolicy(DeleteRetentionPolicy return this; } + @Override + public BlobServicePropertiesImpl withRestorePolicy(RestorePolicyProperties restorePolicy) { + this.inner().withRestorePolicy(restorePolicy); + return this; + } + } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobServicePropertiesInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobServicePropertiesInner.java index 44d7a9080569..4a55fb90ecc8 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobServicePropertiesInner.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobServicePropertiesInner.java @@ -11,6 +11,7 @@ import com.microsoft.azure.management.storage.v2019_06_01.CorsRules; import com.microsoft.azure.management.storage.v2019_06_01.DeleteRetentionPolicy; import com.microsoft.azure.management.storage.v2019_06_01.ChangeFeed; +import com.microsoft.azure.management.storage.v2019_06_01.RestorePolicyProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.ProxyResource; @@ -55,6 +56,12 @@ public class BlobServicePropertiesInner extends ProxyResource { @JsonProperty(value = "properties.changeFeed") private ChangeFeed changeFeed; + /** + * The blob service properties for blob restore policy. + */ + @JsonProperty(value = "properties.restorePolicy") + private RestorePolicyProperties restorePolicy; + /** * Sku name and tier. */ @@ -161,6 +168,26 @@ public BlobServicePropertiesInner withChangeFeed(ChangeFeed changeFeed) { return this; } + /** + * Get the blob service properties for blob restore policy. + * + * @return the restorePolicy value + */ + public RestorePolicyProperties restorePolicy() { + return this.restorePolicy; + } + + /** + * Set the blob service properties for blob restore policy. + * + * @param restorePolicy the restorePolicy value to set + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withRestorePolicy(RestorePolicyProperties restorePolicy) { + this.restorePolicy = restorePolicy; + return this; + } + /** * Get sku name and tier. * 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 ac9641dc378f..f1d62291b8fa 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 @@ -11,18 +11,16 @@ import com.microsoft.azure.management.storage.v2019_06_01.FileShare; import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; import rx.Observable; -import java.util.Map; import org.joda.time.DateTime; +import java.util.Map; +import com.microsoft.azure.management.storage.v2019_06_01.EnabledProtocols; +import com.microsoft.azure.management.storage.v2019_06_01.RootSquashType; class FileShareImpl extends CreatableUpdatableImpl<FileShare, FileShareInner, FileShareImpl> implements FileShare, FileShare.Definition, FileShare.Update { private final StorageManager manager; private String resourceGroupName; private String accountName; private String shareName; - private Map<String, String> cmetadata; - private Integer cshareQuota; - private Map<String, String> umetadata; - private Integer ushareQuota; FileShareImpl(String name, StorageManager manager) { super(name, new FileShareInner()); @@ -52,14 +50,14 @@ public StorageManager manager() { @Override public Observable<FileShare> createResourceAsync() { FileSharesInner client = this.manager().inner().fileShares(); - return client.createAsync(this.resourceGroupName, this.accountName, this.shareName, this.cmetadata, this.cshareQuota) + return client.createAsync(this.resourceGroupName, this.accountName, this.shareName, this.inner()) .map(innerToFluentMap(this)); } @Override public Observable<FileShare> updateResourceAsync() { FileSharesInner client = this.manager().inner().fileShares(); - return client.updateAsync(this.resourceGroupName, this.accountName, this.shareName, this.umetadata, this.ushareQuota) + return client.updateAsync(this.resourceGroupName, this.accountName, this.shareName, this.inner()) .map(innerToFluentMap(this)); } @@ -75,6 +73,11 @@ public boolean isInCreateMode() { } + @Override + public EnabledProtocols enabledProtocols() { + return this.inner().enabledProtocols(); + } + @Override public String etag() { return this.inner().etag(); @@ -100,6 +103,11 @@ public String name() { return this.inner().name(); } + @Override + public RootSquashType rootSquash() { + return this.inner().rootSquash(); + } + @Override public Integer shareQuota() { return this.inner().shareQuota(); @@ -117,23 +125,27 @@ public FileShareImpl withExistingFileService(String resourceGroupName, String ac return this; } + @Override + public FileShareImpl withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.inner().withEnabledProtocols(enabledProtocols); + return this; + } + @Override public FileShareImpl withMetadata(Map<String, String> metadata) { - if (isInCreateMode()) { - this.cmetadata = metadata; - } else { - this.umetadata = metadata; - } + this.inner().withMetadata(metadata); + return this; + } + + @Override + public FileShareImpl withRootSquash(RootSquashType rootSquash) { + this.inner().withRootSquash(rootSquash); return this; } @Override public FileShareImpl withShareQuota(Integer shareQuota) { - if (isInCreateMode()) { - this.cshareQuota = shareQuota; - } else { - this.ushareQuota = shareQuota; - } + this.inner().withShareQuota(shareQuota); return this; } 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 731eaabe366e..8a068976a5f8 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 @@ -10,6 +10,8 @@ import org.joda.time.DateTime; import java.util.Map; +import com.microsoft.azure.management.storage.v2019_06_01.EnabledProtocols; +import com.microsoft.azure.management.storage.v2019_06_01.RootSquashType; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.management.storage.v2019_06_01.AzureEntityResource; @@ -40,6 +42,20 @@ public class FileShareInner extends AzureEntityResource { @JsonProperty(value = "properties.shareQuota") private Integer shareQuota; + /** + * Immutable property for file shares protocol. Possible values include: + * 'SMB', 'NFS'. + */ + @JsonProperty(value = "properties.enabledProtocols") + private EnabledProtocols enabledProtocols; + + /** + * Reduction of the access rights for the remote superuser. Possible values + * include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + */ + @JsonProperty(value = "properties.rootSquash") + private RootSquashType rootSquash; + /** * Get returns the date and time the share was last modified. * @@ -89,4 +105,44 @@ public FileShareInner withShareQuota(Integer shareQuota) { return this; } + /** + * Get immutable property for file shares protocol. Possible values include: 'SMB', 'NFS'. + * + * @return the enabledProtocols value + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set immutable property for file shares protocol. Possible values include: 'SMB', 'NFS'. + * + * @param enabledProtocols the enabledProtocols value to set + * @return the FileShareInner object itself. + */ + public FileShareInner withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.enabledProtocols = enabledProtocols; + return this; + } + + /** + * Get reduction of the access rights for the remote superuser. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + * + * @return the rootSquash value + */ + public RootSquashType rootSquash() { + return this.rootSquash; + } + + /** + * Set reduction of the access rights for the remote superuser. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + * + * @param rootSquash the rootSquash value to set + * @return the FileShareInner object itself. + */ + public FileShareInner withRootSquash(RootSquashType rootSquash) { + this.rootSquash = rootSquash; + return this; + } + } 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 9f66a7a0b941..cc956f2978f7 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 @@ -10,8 +10,10 @@ import com.microsoft.azure.management.storage.v2019_06_01.FileShareItem; import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_06_01.EnabledProtocols; import org.joda.time.DateTime; import java.util.Map; +import com.microsoft.azure.management.storage.v2019_06_01.RootSquashType; class FileShareItemImpl extends WrapperImpl<FileShareItemInner> implements FileShareItem { private final StorageManager manager; @@ -25,6 +27,11 @@ public StorageManager manager() { return this.manager; } + @Override + public EnabledProtocols enabledProtocols() { + return this.inner().enabledProtocols(); + } + @Override public String etag() { return this.inner().etag(); @@ -50,6 +57,11 @@ public String name() { return this.inner().name(); } + @Override + public RootSquashType rootSquash() { + return this.inner().rootSquash(); + } + @Override public Integer shareQuota() { return this.inner().shareQuota(); 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 dad24dbe729b..08a6ff3b4ec6 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 @@ -10,6 +10,8 @@ import org.joda.time.DateTime; import java.util.Map; +import com.microsoft.azure.management.storage.v2019_06_01.EnabledProtocols; +import com.microsoft.azure.management.storage.v2019_06_01.RootSquashType; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.management.storage.v2019_06_01.AzureEntityResource; @@ -39,6 +41,20 @@ public class FileShareItemInner extends AzureEntityResource { @JsonProperty(value = "properties.shareQuota") private Integer shareQuota; + /** + * Immutable property for file shares protocol. Possible values include: + * 'SMB', 'NFS'. + */ + @JsonProperty(value = "properties.enabledProtocols") + private EnabledProtocols enabledProtocols; + + /** + * Reduction of the access rights for the remote superuser. Possible values + * include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + */ + @JsonProperty(value = "properties.rootSquash") + private RootSquashType rootSquash; + /** * Get returns the date and time the share was last modified. * @@ -88,4 +104,44 @@ public FileShareItemInner withShareQuota(Integer shareQuota) { return this; } + /** + * Get immutable property for file shares protocol. Possible values include: 'SMB', 'NFS'. + * + * @return the enabledProtocols value + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set immutable property for file shares protocol. Possible values include: 'SMB', 'NFS'. + * + * @param enabledProtocols the enabledProtocols value to set + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.enabledProtocols = enabledProtocols; + return this; + } + + /** + * Get reduction of the access rights for the remote superuser. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + * + * @return the rootSquash value + */ + public RootSquashType rootSquash() { + return this.rootSquash; + } + + /** + * Set reduction of the access rights for the remote superuser. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + * + * @param rootSquash the rootSquash value to set + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withRootSquash(RootSquashType rootSquash) { + this.rootSquash = rootSquash; + return this; + } + } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileSharesInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileSharesInner.java index a81cb4858fc0..a5e691e89f16 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileSharesInner.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileSharesInner.java @@ -21,7 +21,6 @@ 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; @@ -69,11 +68,11 @@ interface FileSharesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.FileShares create" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") - Observable<Response<ResponseBody>> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("shareName") String shareName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body FileShareInner fileShare, @Header("User-Agent") String userAgent); + Observable<Response<ResponseBody>> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("shareName") String shareName, @Path("subscriptionId") String subscriptionId, @Body FileShareInner fileShare, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.FileShares update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") - Observable<Response<ResponseBody>> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("shareName") String shareName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body FileShareInner fileShare, @Header("User-Agent") String userAgent); + Observable<Response<ResponseBody>> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("shareName") String shareName, @Path("subscriptionId") String subscriptionId, @Body FileShareInner fileShare, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.FileShares get" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") @@ -346,13 +345,14 @@ private ServiceResponse<PageImpl1<FileShareItemInner>> listDelegate(Response<Res * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties of the file share to create. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the FileShareInner object if successful. */ - public FileShareInner create(String resourceGroupName, String accountName, String shareName) { - return createWithServiceResponseAsync(resourceGroupName, accountName, shareName).toBlocking().single().body(); + public FileShareInner create(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { + return createWithServiceResponseAsync(resourceGroupName, accountName, shareName, fileShare).toBlocking().single().body(); } /** @@ -361,12 +361,13 @@ public FileShareInner create(String resourceGroupName, String accountName, Strin * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties of the file share to create. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture<FileShareInner> createAsync(String resourceGroupName, String accountName, String shareName, final ServiceCallback<FileShareInner> serviceCallback) { - return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, shareName), serviceCallback); + public ServiceFuture<FileShareInner> createAsync(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare, final ServiceCallback<FileShareInner> serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, shareName, fileShare), serviceCallback); } /** @@ -375,11 +376,12 @@ public ServiceFuture<FileShareInner> createAsync(String resourceGroupName, Strin * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties of the file share to create. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the FileShareInner object */ - public Observable<FileShareInner> createAsync(String resourceGroupName, String accountName, String shareName) { - return createWithServiceResponseAsync(resourceGroupName, accountName, shareName).map(new Func1<ServiceResponse<FileShareInner>, FileShareInner>() { + public Observable<FileShareInner> createAsync(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { + return createWithServiceResponseAsync(resourceGroupName, accountName, shareName, fileShare).map(new Func1<ServiceResponse<FileShareInner>, FileShareInner>() { @Override public FileShareInner call(ServiceResponse<FileShareInner> response) { return response.body(); @@ -393,10 +395,11 @@ public FileShareInner call(ServiceResponse<FileShareInner> 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 shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties of the file share to create. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the FileShareInner object */ - public Observable<ServiceResponse<FileShareInner>> createWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName) { + public Observable<ServiceResponse<FileShareInner>> createWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -409,113 +412,14 @@ public Observable<ServiceResponse<FileShareInner>> createWithServiceResponseAsyn 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 Map<String, String> metadata = null; - final Integer shareQuota = null; - FileShareInner fileShare = new FileShareInner(); - fileShare.withMetadata(null); - fileShare.withShareQuota(null); - return service.create(resourceGroupName, accountName, shareName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), fileShare, this.client.userAgent()) - .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<FileShareInner>>>() { - @Override - public Observable<ServiceResponse<FileShareInner>> call(Response<ResponseBody> response) { - try { - ServiceResponse<FileShareInner> clientResponse = createDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the files contained by the share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param metadata A name-value pair to associate with the share as metadata. - * @param shareQuota The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the FileShareInner object if successful. - */ - public FileShareInner create(String resourceGroupName, String accountName, String shareName, Map<String, String> metadata, Integer shareQuota) { - return createWithServiceResponseAsync(resourceGroupName, accountName, shareName, metadata, shareQuota).toBlocking().single().body(); - } - - /** - * Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the files contained by the share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param metadata A name-value pair to associate with the share as metadata. - * @param shareQuota The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. - * @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<FileShareInner> createAsync(String resourceGroupName, String accountName, String shareName, Map<String, String> metadata, Integer shareQuota, final ServiceCallback<FileShareInner> serviceCallback) { - return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, shareName, metadata, shareQuota), serviceCallback); - } - - /** - * Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the files contained by the share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param metadata A name-value pair to associate with the share as metadata. - * @param shareQuota The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the FileShareInner object - */ - public Observable<FileShareInner> createAsync(String resourceGroupName, String accountName, String shareName, Map<String, String> metadata, Integer shareQuota) { - return createWithServiceResponseAsync(resourceGroupName, accountName, shareName, metadata, shareQuota).map(new Func1<ServiceResponse<FileShareInner>, FileShareInner>() { - @Override - public FileShareInner call(ServiceResponse<FileShareInner> response) { - return response.body(); - } - }); - } - - /** - * Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the files contained by the share. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param metadata A name-value pair to associate with the share as metadata. - * @param shareQuota The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the FileShareInner object - */ - public Observable<ServiceResponse<FileShareInner>> createWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName, Map<String, String> metadata, Integer shareQuota) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (shareName == null) { - throw new IllegalArgumentException("Parameter shareName is required and cannot be null."); - } - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + if (fileShare == null) { + throw new IllegalArgumentException("Parameter fileShare is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - Validator.validate(metadata); - FileShareInner fileShare = new FileShareInner(); - fileShare.withMetadata(metadata); - fileShare.withShareQuota(shareQuota); - return service.create(resourceGroupName, accountName, shareName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), fileShare, this.client.userAgent()) + Validator.validate(fileShare); + return service.create(resourceGroupName, accountName, shareName, this.client.subscriptionId(), fileShare, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<FileShareInner>>>() { @Override public Observable<ServiceResponse<FileShareInner>> call(Response<ResponseBody> response) { @@ -543,13 +447,14 @@ private ServiceResponse<FileShareInner> createDelegate(Response<ResponseBody> re * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties to update for the file share. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the FileShareInner object if successful. */ - public FileShareInner update(String resourceGroupName, String accountName, String shareName) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, shareName).toBlocking().single().body(); + public FileShareInner update(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, shareName, fileShare).toBlocking().single().body(); } /** @@ -558,12 +463,13 @@ public FileShareInner update(String resourceGroupName, String accountName, Strin * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties to update for the file share. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture<FileShareInner> updateAsync(String resourceGroupName, String accountName, String shareName, final ServiceCallback<FileShareInner> serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, shareName), serviceCallback); + public ServiceFuture<FileShareInner> updateAsync(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare, final ServiceCallback<FileShareInner> serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, shareName, fileShare), serviceCallback); } /** @@ -572,11 +478,12 @@ public ServiceFuture<FileShareInner> updateAsync(String resourceGroupName, Strin * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties to update for the file share. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the FileShareInner object */ - public Observable<FileShareInner> updateAsync(String resourceGroupName, String accountName, String shareName) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, shareName).map(new Func1<ServiceResponse<FileShareInner>, FileShareInner>() { + public Observable<FileShareInner> updateAsync(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, shareName, fileShare).map(new Func1<ServiceResponse<FileShareInner>, FileShareInner>() { @Override public FileShareInner call(ServiceResponse<FileShareInner> response) { return response.body(); @@ -590,10 +497,11 @@ public FileShareInner call(ServiceResponse<FileShareInner> 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 shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties to update for the file share. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the FileShareInner object */ - public Observable<ServiceResponse<FileShareInner>> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName) { + public Observable<ServiceResponse<FileShareInner>> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -606,113 +514,14 @@ public Observable<ServiceResponse<FileShareInner>> updateWithServiceResponseAsyn 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 Map<String, String> metadata = null; - final Integer shareQuota = null; - FileShareInner fileShare = new FileShareInner(); - fileShare.withMetadata(null); - fileShare.withShareQuota(null); - return service.update(resourceGroupName, accountName, shareName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), fileShare, this.client.userAgent()) - .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<FileShareInner>>>() { - @Override - public Observable<ServiceResponse<FileShareInner>> call(Response<ResponseBody> response) { - try { - ServiceResponse<FileShareInner> clientResponse = updateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param metadata A name-value pair to associate with the share as metadata. - * @param shareQuota The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the FileShareInner object if successful. - */ - public FileShareInner update(String resourceGroupName, String accountName, String shareName, Map<String, String> metadata, Integer shareQuota) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, shareName, metadata, shareQuota).toBlocking().single().body(); - } - - /** - * Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param metadata A name-value pair to associate with the share as metadata. - * @param shareQuota The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. - * @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<FileShareInner> updateAsync(String resourceGroupName, String accountName, String shareName, Map<String, String> metadata, Integer shareQuota, final ServiceCallback<FileShareInner> serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, shareName, metadata, shareQuota), serviceCallback); - } - - /** - * Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param metadata A name-value pair to associate with the share as metadata. - * @param shareQuota The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the FileShareInner object - */ - public Observable<FileShareInner> updateAsync(String resourceGroupName, String accountName, String shareName, Map<String, String> metadata, Integer shareQuota) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, shareName, metadata, shareQuota).map(new Func1<ServiceResponse<FileShareInner>, FileShareInner>() { - @Override - public FileShareInner call(ServiceResponse<FileShareInner> response) { - return response.body(); - } - }); - } - - /** - * Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. - * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param metadata A name-value pair to associate with the share as metadata. - * @param shareQuota The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the FileShareInner object - */ - public Observable<ServiceResponse<FileShareInner>> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName, Map<String, String> metadata, Integer shareQuota) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (accountName == null) { - throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); - } - if (shareName == null) { - throw new IllegalArgumentException("Parameter shareName is required and cannot be null."); - } - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + if (fileShare == null) { + throw new IllegalArgumentException("Parameter fileShare is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - Validator.validate(metadata); - FileShareInner fileShare = new FileShareInner(); - fileShare.withMetadata(metadata); - fileShare.withShareQuota(shareQuota); - return service.update(resourceGroupName, accountName, shareName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), fileShare, this.client.userAgent()) + Validator.validate(fileShare); + return service.update(resourceGroupName, accountName, shareName, this.client.subscriptionId(), fileShare, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<FileShareInner>>>() { @Override public Observable<ServiceResponse<FileShareInner>> call(Response<ResponseBody> response) { diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountImpl.java index 00dd985713b2..985236d8be2c 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountImpl.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountImpl.java @@ -15,6 +15,7 @@ import com.microsoft.azure.management.storage.v2019_06_01.StorageAccountCreateParameters; import com.microsoft.azure.management.storage.v2019_06_01.AccessTier; import com.microsoft.azure.management.storage.v2019_06_01.AzureFilesIdentityBasedAuthentication; +import com.microsoft.azure.management.storage.v2019_06_01.BlobRestoreStatus; import org.joda.time.DateTime; import com.microsoft.azure.management.storage.v2019_06_01.CustomDomain; import com.microsoft.azure.management.storage.v2019_06_01.Encryption; @@ -97,6 +98,16 @@ public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthenticati return this.inner().azureFilesIdentityBasedAuthentication(); } + @Override + public BlobRestoreStatus blobRestoreStatus() { + BlobRestoreStatusInner inner = this.inner().blobRestoreStatus(); + if (inner != null) { + return new BlobRestoreStatusImpl(inner, manager()); + } else { + return null; + } + } + @Override public DateTime creationTime() { return this.inner().creationTime(); diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountInner.java index d043744a2032..b56f7d38739b 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountInner.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountInner.java @@ -199,6 +199,12 @@ public class StorageAccountInner extends Resource { @JsonProperty(value = "properties.routingPreference") private RoutingPreference routingPreference; + /** + * Blob restore status. + */ + @JsonProperty(value = "properties.blobRestoreStatus", access = JsonProperty.Access.WRITE_ONLY) + private BlobRestoreStatusInner blobRestoreStatus; + /** * Get gets the SKU. * @@ -481,4 +487,13 @@ public StorageAccountInner withRoutingPreference(RoutingPreference routingPrefer return this; } + /** + * Get blob restore status. + * + * @return the blobRestoreStatus value + */ + public BlobRestoreStatusInner blobRestoreStatus() { + return this.blobRestoreStatus; + } + } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountsImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountsImpl.java index 4a1bc5209367..f4f9ae8130df 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountsImpl.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountsImpl.java @@ -25,9 +25,13 @@ import com.microsoft.azure.management.storage.v2019_06_01.StorageAccountListKeysResult; import com.microsoft.azure.management.storage.v2019_06_01.ListAccountSasResponse; import com.microsoft.azure.management.storage.v2019_06_01.ListServiceSasResponse; +import com.microsoft.azure.management.storage.v2019_06_01.BlobRestoreStatus; import com.microsoft.azure.management.storage.v2019_06_01.CheckNameAvailabilityResult; import com.microsoft.azure.management.storage.v2019_06_01.AccountSasParameters; import com.microsoft.azure.management.storage.v2019_06_01.ServiceSasParameters; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.storage.v2019_06_01.BlobRestoreRange; class StorageAccountsImpl extends GroupableResourcesCoreImpl<StorageAccount, StorageAccountImpl, StorageAccountInner, StorageAccountsInner, StorageManager> implements StorageAccounts { protected StorageAccountsImpl(StorageManager manager) { @@ -185,6 +189,18 @@ public Completable failoverAsync(String resourceGroupName, String accountName) { return client.failoverAsync(resourceGroupName, accountName).toCompletable(); } + @Override + public Observable<BlobRestoreStatus> restoreBlobRangesAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List<BlobRestoreRange> blobRanges) { + StorageAccountsInner client = this.inner(); + return client.restoreBlobRangesAsync(resourceGroupName, accountName, timeToRestore, blobRanges) + .map(new Func1<BlobRestoreStatusInner, BlobRestoreStatus>() { + @Override + public BlobRestoreStatus call(BlobRestoreStatusInner inner) { + return new BlobRestoreStatusImpl(inner, manager()); + } + }); + } + @Override public Completable revokeUserDelegationKeysAsync(String resourceGroupName, String accountName) { StorageAccountsInner client = this.inner(); diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountsInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountsInner.java index 0d7fc6552572..a375750d66cb 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountsInner.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountsInner.java @@ -17,6 +17,8 @@ import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; import com.microsoft.azure.management.storage.v2019_06_01.AccountSasParameters; +import com.microsoft.azure.management.storage.v2019_06_01.BlobRestoreParameters; +import com.microsoft.azure.management.storage.v2019_06_01.BlobRestoreRange; import com.microsoft.azure.management.storage.v2019_06_01.ListKeyExpand; import com.microsoft.azure.management.storage.v2019_06_01.ServiceSasParameters; import com.microsoft.azure.management.storage.v2019_06_01.StorageAccountCheckNameAvailabilityParameters; @@ -33,6 +35,7 @@ import java.io.IOException; import java.util.List; import okhttp3.ResponseBody; +import org.joda.time.DateTime; import retrofit2.http.Body; import retrofit2.http.GET; import retrofit2.http.Header; @@ -132,6 +135,14 @@ interface StorageAccountsService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover") Observable<Response<ResponseBody>> beginFailover(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.StorageAccounts restoreBlobRanges" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges") + Observable<Response<ResponseBody>> restoreBlobRanges(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BlobRestoreParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.StorageAccounts beginRestoreBlobRanges" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges") + Observable<Response<ResponseBody>> beginRestoreBlobRanges(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BlobRestoreParameters parameters, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.StorageAccounts revokeUserDelegationKeys" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys") Observable<Response<ResponseBody>> revokeUserDelegationKeys(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -566,7 +577,7 @@ public Observable<ServiceResponse<StorageAccountInner>> call(Response<ResponseBo * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats. Possible values include: 'geoReplicationStats' + * @param expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. Possible values include: 'geoReplicationStats', 'blobRestoreStatus' * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @@ -581,7 +592,7 @@ public StorageAccountInner getByResourceGroup(String resourceGroupName, String a * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats. Possible values include: 'geoReplicationStats' + * @param expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. Possible values include: 'geoReplicationStats', 'blobRestoreStatus' * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -595,7 +606,7 @@ public ServiceFuture<StorageAccountInner> getByResourceGroupAsync(String resourc * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats. Possible values include: 'geoReplicationStats' + * @param expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. Possible values include: 'geoReplicationStats', 'blobRestoreStatus' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the StorageAccountInner object */ @@ -613,7 +624,7 @@ public StorageAccountInner call(ServiceResponse<StorageAccountInner> 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 expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats. Possible values include: 'geoReplicationStats' + * @param expand May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. Possible values include: 'geoReplicationStats', 'blobRestoreStatus' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the StorageAccountInner object */ @@ -1547,6 +1558,198 @@ private ServiceResponse<Void> beginFailoverDelegate(Response<ResponseBody> respo .build(response); } + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BlobRestoreStatusInner object if successful. + */ + public BlobRestoreStatusInner restoreBlobRanges(String resourceGroupName, String accountName, DateTime timeToRestore, List<BlobRestoreRange> blobRanges) { + return restoreBlobRangesWithServiceResponseAsync(resourceGroupName, accountName, timeToRestore, blobRanges).toBlocking().last().body(); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture<BlobRestoreStatusInner> restoreBlobRangesAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List<BlobRestoreRange> blobRanges, final ServiceCallback<BlobRestoreStatusInner> serviceCallback) { + return ServiceFuture.fromResponse(restoreBlobRangesWithServiceResponseAsync(resourceGroupName, accountName, timeToRestore, blobRanges), serviceCallback); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable<BlobRestoreStatusInner> restoreBlobRangesAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List<BlobRestoreRange> blobRanges) { + return restoreBlobRangesWithServiceResponseAsync(resourceGroupName, accountName, timeToRestore, blobRanges).map(new Func1<ServiceResponse<BlobRestoreStatusInner>, BlobRestoreStatusInner>() { + @Override + public BlobRestoreStatusInner call(ServiceResponse<BlobRestoreStatusInner> response) { + return response.body(); + } + }); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable<ServiceResponse<BlobRestoreStatusInner>> restoreBlobRangesWithServiceResponseAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List<BlobRestoreRange> blobRanges) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (timeToRestore == null) { + throw new IllegalArgumentException("Parameter timeToRestore is required and cannot be null."); + } + if (blobRanges == null) { + throw new IllegalArgumentException("Parameter blobRanges is required and cannot be null."); + } + Validator.validate(blobRanges); + BlobRestoreParameters parameters = new BlobRestoreParameters(); + parameters.withTimeToRestore(timeToRestore); + parameters.withBlobRanges(blobRanges); + Observable<Response<ResponseBody>> observable = service.restoreBlobRanges(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken<BlobRestoreStatusInner>() { }.getType()); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BlobRestoreStatusInner object if successful. + */ + public BlobRestoreStatusInner beginRestoreBlobRanges(String resourceGroupName, String accountName, DateTime timeToRestore, List<BlobRestoreRange> blobRanges) { + return beginRestoreBlobRangesWithServiceResponseAsync(resourceGroupName, accountName, timeToRestore, blobRanges).toBlocking().single().body(); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture<BlobRestoreStatusInner> beginRestoreBlobRangesAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List<BlobRestoreRange> blobRanges, final ServiceCallback<BlobRestoreStatusInner> serviceCallback) { + return ServiceFuture.fromResponse(beginRestoreBlobRangesWithServiceResponseAsync(resourceGroupName, accountName, timeToRestore, blobRanges), serviceCallback); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobRestoreStatusInner object + */ + public Observable<BlobRestoreStatusInner> beginRestoreBlobRangesAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List<BlobRestoreRange> blobRanges) { + return beginRestoreBlobRangesWithServiceResponseAsync(resourceGroupName, accountName, timeToRestore, blobRanges).map(new Func1<ServiceResponse<BlobRestoreStatusInner>, BlobRestoreStatusInner>() { + @Override + public BlobRestoreStatusInner call(ServiceResponse<BlobRestoreStatusInner> response) { + return response.body(); + } + }); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param timeToRestore Restore blob to the specified time. + * @param blobRanges Blob ranges to restore. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BlobRestoreStatusInner object + */ + public Observable<ServiceResponse<BlobRestoreStatusInner>> beginRestoreBlobRangesWithServiceResponseAsync(String resourceGroupName, String accountName, DateTime timeToRestore, List<BlobRestoreRange> blobRanges) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (timeToRestore == null) { + throw new IllegalArgumentException("Parameter timeToRestore is required and cannot be null."); + } + if (blobRanges == null) { + throw new IllegalArgumentException("Parameter blobRanges is required and cannot be null."); + } + Validator.validate(blobRanges); + BlobRestoreParameters parameters = new BlobRestoreParameters(); + parameters.withTimeToRestore(timeToRestore); + parameters.withBlobRanges(blobRanges); + return service.beginRestoreBlobRanges(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<BlobRestoreStatusInner>>>() { + @Override + public Observable<ServiceResponse<BlobRestoreStatusInner>> call(Response<ResponseBody> response) { + try { + ServiceResponse<BlobRestoreStatusInner> clientResponse = beginRestoreBlobRangesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse<BlobRestoreStatusInner> beginRestoreBlobRangesDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().<BlobRestoreStatusInner, CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken<BlobRestoreStatusInner>() { }.getType()) + .register(202, new TypeToken<BlobRestoreStatusInner>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * Revoke user delegation keys. *