diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/DeletedShare.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/DeletedShare.java new file mode 100644 index 000000000000..3624931b8281 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/DeletedShare.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The deleted share to be restored. + */ +public class DeletedShare { + /** + * Required. Identify the name of the deleted share that will be restored. + */ + @JsonProperty(value = "deletedShareName", required = true) + private String deletedShareName; + + /** + * Required. Identify the version of the deleted share that will be + * restored. + */ + @JsonProperty(value = "deletedShareVersion", required = true) + private String deletedShareVersion; + + /** + * Get required. Identify the name of the deleted share that will be restored. + * + * @return the deletedShareName value + */ + public String deletedShareName() { + return this.deletedShareName; + } + + /** + * Set required. Identify the name of the deleted share that will be restored. + * + * @param deletedShareName the deletedShareName value to set + * @return the DeletedShare object itself. + */ + public DeletedShare withDeletedShareName(String deletedShareName) { + this.deletedShareName = deletedShareName; + return this; + } + + /** + * Get required. Identify the version of the deleted share that will be restored. + * + * @return the deletedShareVersion value + */ + public String deletedShareVersion() { + return this.deletedShareVersion; + } + + /** + * Set required. Identify the version of the deleted share that will be restored. + * + * @param deletedShareVersion the deletedShareVersion value to set + * @return the DeletedShare object itself. + */ + public DeletedShare withDeletedShareVersion(String deletedShareVersion) { + this.deletedShareVersion = deletedShareVersion; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_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 { + /** Static value SMB for EnabledProtocols. */ + public static final EnabledProtocols SMB = fromString("SMB"); + + /** Static value NFS for EnabledProtocols. */ + public static final EnabledProtocols NFS = fromString("NFS"); + + /** + * Creates or finds a EnabledProtocols from its string representation. + * @param name a name to look for + * @return the corresponding EnabledProtocols + */ + @JsonCreator + public static EnabledProtocols fromString(String name) { + return fromString(name, EnabledProtocols.class); + } + + /** + * @return known EnabledProtocols values + */ + public static Collection values() { + return values(EnabledProtocols.class); + } +} diff --git a/sdk/storage/mgmt-v2019_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..28009ece01d0 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,43 @@ 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, Indexable, Updatable, HasManager { + /** + * @return the accessTier value. + */ + ShareAccessTier accessTier(); + + /** + * @return the accessTierChangeTime value. + */ + DateTime accessTierChangeTime(); + + /** + * @return the accessTierStatus value. + */ + String accessTierStatus(); + + /** + * @return the deleted value. + */ + Boolean deleted(); + + /** + * @return the deletedTime value. + */ + DateTime deletedTime(); + + /** + * @return the enabledProtocols value. + */ + EnabledProtocols enabledProtocols(); + /** * @return the etag value. */ @@ -48,20 +78,40 @@ public interface FileShare extends HasInner, Indexable, Updatabl */ String name(); + /** + * @return the remainingRetentionDays value. + */ + Integer remainingRetentionDays(); + + /** + * @return the rootSquash value. + */ + RootSquashType rootSquash(); + /** * @return the shareQuota value. */ Integer shareQuota(); + /** + * @return the shareUsageBytes value. + */ + Integer shareUsageBytes(); + /** * @return the type value. */ String type(); + /** + * @return the version value. + */ + String version(); + /** * The entirety of the FileShare definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithFileService, DefinitionStages.WithMetadata, DefinitionStages.WithShareQuota, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithFileService, DefinitionStages.WithCreate { } /** @@ -84,30 +134,66 @@ 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 AccessTier. + */ + interface WithAccessTier { + /** + * Specifies accessTier. + * @param accessTier Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Possible values include: 'TransactionOptimized', 'Hot', 'Cool', 'Premium' + * @return the next definition stage + */ + WithCreate withAccessTier(ShareAccessTier accessTier); + } + + /** + * The stage of the fileshare definition allowing to specify EnabledProtocols. + */ + interface WithEnabledProtocols { + /** + * Specifies enabledProtocols. + * @param enabledProtocols The authentication protocol that is used for the file share. Can only be specified when creating a share. Possible values include: 'SMB', 'NFS' + * @return the next definition stage + */ + WithCreate withEnabledProtocols(EnabledProtocols enabledProtocols); } /** * The stage of the fileshare definition allowing to specify Metadata. */ interface WithMetadata { - /** - * Specifies metadata. - * @param metadata A name-value pair to associate with the share as metadata - * @return the next definition stage - */ - WithShareQuota withMetadata(Map metadata); + /** + * Specifies metadata. + * @param metadata A name-value pair to associate with the share as metadata + * @return the next definition stage + */ + WithCreate withMetadata(Map metadata); + } + + /** + * The stage of the fileshare definition allowing to specify RootSquash. + */ + interface WithRootSquash { + /** + * Specifies rootSquash. + * @param rootSquash The property is for NFS share only. The default is NoRootSquash. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash' + * @return the next definition stage + */ + WithCreate withRootSquash(RootSquashType rootSquash); } /** * The stage of the fileshare definition allowing to specify ShareQuota. */ interface WithShareQuota { - /** - * Specifies shareQuota. - * @param shareQuota The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400 - * @return the next definition stage - */ + /** + * 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 +202,43 @@ 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 { + interface WithCreate extends Creatable, DefinitionStages.WithAccessTier, DefinitionStages.WithEnabledProtocols, DefinitionStages.WithMetadata, DefinitionStages.WithRootSquash, DefinitionStages.WithShareQuota { } } /** * The template for a FileShare update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, UpdateStages.WithMetadata, UpdateStages.WithShareQuota { + interface Update extends Appliable, UpdateStages.WithAccessTier, UpdateStages.WithEnabledProtocols, UpdateStages.WithMetadata, UpdateStages.WithRootSquash, UpdateStages.WithShareQuota { } /** * Grouping of FileShare update stages. */ interface UpdateStages { + /** + * The stage of the fileshare update allowing to specify AccessTier. + */ + interface WithAccessTier { + /** + * Specifies accessTier. + * @param accessTier Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Possible values include: 'TransactionOptimized', 'Hot', 'Cool', 'Premium' + * @return the next update stage + */ + Update withAccessTier(ShareAccessTier accessTier); + } + + /** + * The stage of the fileshare update allowing to specify EnabledProtocols. + */ + interface WithEnabledProtocols { + /** + * Specifies enabledProtocols. + * @param enabledProtocols The authentication protocol that is used for the file share. Can only be specified when creating a share. Possible values include: 'SMB', 'NFS' + * @return the next update stage + */ + Update withEnabledProtocols(EnabledProtocols enabledProtocols); + } + /** * The stage of the fileshare update allowing to specify Metadata. */ @@ -141,6 +251,18 @@ interface WithMetadata { Update withMetadata(Map metadata); } + /** + * The stage of the fileshare update allowing to specify RootSquash. + */ + interface WithRootSquash { + /** + * Specifies rootSquash. + * @param rootSquash The property is for NFS share only. The default is NoRootSquash. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash' + * @return the next update stage + */ + Update withRootSquash(RootSquashType rootSquash); + } + /** * The stage of the fileshare update allowing to specify ShareQuota. */ 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..06ae922b8147 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,36 @@ * Type representing FileShareItem. */ public interface FileShareItem extends HasInner, HasManager { + /** + * @return the accessTier value. + */ + ShareAccessTier accessTier(); + + /** + * @return the accessTierChangeTime value. + */ + DateTime accessTierChangeTime(); + + /** + * @return the accessTierStatus value. + */ + String accessTierStatus(); + + /** + * @return the deleted value. + */ + Boolean deleted(); + + /** + * @return the deletedTime value. + */ + DateTime deletedTime(); + + /** + * @return the enabledProtocols value. + */ + EnabledProtocols enabledProtocols(); + /** * @return the etag value. */ @@ -44,14 +74,34 @@ public interface FileShareItem extends HasInner, HasManager< */ String name(); + /** + * @return the remainingRetentionDays value. + */ + Integer remainingRetentionDays(); + + /** + * @return the rootSquash value. + */ + RootSquashType rootSquash(); + /** * @return the shareQuota value. */ Integer shareQuota(); + /** + * @return the shareUsageBytes value. + */ + Integer shareUsageBytes(); + /** * @return the type value. */ String type(); + /** + * @return the version value. + */ + String version(); + } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileShares.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileShares.java index d81fe9cd759f..4a61bbe99744 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileShares.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileShares.java @@ -50,4 +50,17 @@ public interface FileShares extends SupportsCreating { + /** Static value NoRootSquash for RootSquashType. */ + public static final RootSquashType NO_ROOT_SQUASH = fromString("NoRootSquash"); + + /** Static value RootSquash for RootSquashType. */ + public static final RootSquashType ROOT_SQUASH = fromString("RootSquash"); + + /** Static value AllSquash for RootSquashType. */ + public static final RootSquashType ALL_SQUASH = fromString("AllSquash"); + + /** + * Creates or finds a RootSquashType from its string representation. + * @param name a name to look for + * @return the corresponding RootSquashType + */ + @JsonCreator + public static RootSquashType fromString(String name) { + return fromString(name, RootSquashType.class); + } + + /** + * @return known RootSquashType values + */ + public static Collection values() { + return values(RootSquashType.class); + } +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ShareAccessTier.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ShareAccessTier.java new file mode 100644 index 000000000000..1a04f30994e2 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ShareAccessTier.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.storage.v2019_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ShareAccessTier. + */ +public final class ShareAccessTier extends ExpandableStringEnum { + /** Static value TransactionOptimized for ShareAccessTier. */ + public static final ShareAccessTier TRANSACTION_OPTIMIZED = fromString("TransactionOptimized"); + + /** Static value Hot for ShareAccessTier. */ + public static final ShareAccessTier HOT = fromString("Hot"); + + /** Static value Cool for ShareAccessTier. */ + public static final ShareAccessTier COOL = fromString("Cool"); + + /** Static value Premium for ShareAccessTier. */ + public static final ShareAccessTier PREMIUM = fromString("Premium"); + + /** + * Creates or finds a ShareAccessTier from its string representation. + * @param name a name to look for + * @return the corresponding ShareAccessTier + */ + @JsonCreator + public static ShareAccessTier fromString(String name) { + return fromString(name, ShareAccessTier.class); + } + + /** + * @return known ShareAccessTier values + */ + public static Collection values() { + return values(ShareAccessTier.class); + } +} diff --git a/sdk/storage/mgmt-v2019_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..f76e6bfe6915 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,17 @@ 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; +import com.microsoft.azure.management.storage.v2019_06_01.ShareAccessTier; class FileShareImpl extends CreatableUpdatableImpl implements FileShare, FileShare.Definition, FileShare.Update { private final StorageManager manager; private String resourceGroupName; private String accountName; private String shareName; - private Map cmetadata; - private Integer cshareQuota; - private Map umetadata; - private Integer ushareQuota; FileShareImpl(String name, StorageManager manager) { super(name, new FileShareInner()); @@ -52,14 +51,14 @@ public StorageManager manager() { @Override public Observable 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 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 +74,36 @@ public boolean isInCreateMode() { } + @Override + public ShareAccessTier accessTier() { + return this.inner().accessTier(); + } + + @Override + public DateTime accessTierChangeTime() { + return this.inner().accessTierChangeTime(); + } + + @Override + public String accessTierStatus() { + return this.inner().accessTierStatus(); + } + + @Override + public Boolean deleted() { + return this.inner().deleted(); + } + + @Override + public DateTime deletedTime() { + return this.inner().deletedTime(); + } + + @Override + public EnabledProtocols enabledProtocols() { + return this.inner().enabledProtocols(); + } + @Override public String etag() { return this.inner().etag(); @@ -100,16 +129,36 @@ public String name() { return this.inner().name(); } + @Override + public Integer remainingRetentionDays() { + return this.inner().remainingRetentionDays(); + } + + @Override + public RootSquashType rootSquash() { + return this.inner().rootSquash(); + } + @Override public Integer shareQuota() { return this.inner().shareQuota(); } + @Override + public Integer shareUsageBytes() { + return this.inner().shareUsageBytes(); + } + @Override public String type() { return this.inner().type(); } + @Override + public String version() { + return this.inner().version(); + } + @Override public FileShareImpl withExistingFileService(String resourceGroupName, String accountName) { this.resourceGroupName = resourceGroupName; @@ -117,23 +166,33 @@ public FileShareImpl withExistingFileService(String resourceGroupName, String ac return this; } + @Override + public FileShareImpl withAccessTier(ShareAccessTier accessTier) { + this.inner().withAccessTier(accessTier); + return this; + } + + @Override + public FileShareImpl withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.inner().withEnabledProtocols(enabledProtocols); + return this; + } + @Override public FileShareImpl withMetadata(Map metadata) { - 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..b969495f3f54 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,9 @@ 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.microsoft.azure.management.storage.v2019_06_01.ShareAccessTier; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.management.storage.v2019_06_01.AzureEntityResource; @@ -40,6 +43,72 @@ public class FileShareInner extends AzureEntityResource { @JsonProperty(value = "properties.shareQuota") private Integer shareQuota; + /** + * The authentication protocol that is used for the file share. Can only be + * specified when creating a share. Possible values include: 'SMB', 'NFS'. + */ + @JsonProperty(value = "properties.enabledProtocols") + private EnabledProtocols enabledProtocols; + + /** + * The property is for NFS share only. The default is NoRootSquash. + * Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + */ + @JsonProperty(value = "properties.rootSquash") + private RootSquashType rootSquash; + + /** + * The version of the share. + */ + @JsonProperty(value = "properties.version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /** + * Indicates whether the share was deleted. + */ + @JsonProperty(value = "properties.deleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean deleted; + + /** + * The deleted time if the share was deleted. + */ + @JsonProperty(value = "properties.deletedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime deletedTime; + + /** + * Remaining retention days for share that was soft deleted. + */ + @JsonProperty(value = "properties.remainingRetentionDays", access = JsonProperty.Access.WRITE_ONLY) + private Integer remainingRetentionDays; + + /** + * Access tier for specific share. GpV2 account can choose between + * TransactionOptimized (default), Hot, and Cool. FileStorage account can + * choose Premium. Possible values include: 'TransactionOptimized', 'Hot', + * 'Cool', 'Premium'. + */ + @JsonProperty(value = "properties.accessTier") + private ShareAccessTier accessTier; + + /** + * Indicates the last modification time for share access tier. + */ + @JsonProperty(value = "properties.accessTierChangeTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime accessTierChangeTime; + + /** + * Indicates if there is a pending transition for access tier. + */ + @JsonProperty(value = "properties.accessTierStatus", access = JsonProperty.Access.WRITE_ONLY) + private String accessTierStatus; + + /** + * The approximate size of the data stored on the share. Note that this + * value may not include all recently created or recently resized files. + */ + @JsonProperty(value = "properties.shareUsageBytes", access = JsonProperty.Access.WRITE_ONLY) + private Integer shareUsageBytes; + /** * Get returns the date and time the share was last modified. * @@ -89,4 +158,127 @@ public FileShareInner withShareQuota(Integer shareQuota) { return this; } + /** + * Get the authentication protocol that is used for the file share. Can only be specified when creating a share. Possible values include: 'SMB', 'NFS'. + * + * @return the enabledProtocols value + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set the authentication protocol that is used for the file share. Can only be specified when creating a share. Possible values include: 'SMB', 'NFS'. + * + * @param enabledProtocols the enabledProtocols value to set + * @return the FileShareInner object itself. + */ + public FileShareInner withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.enabledProtocols = enabledProtocols; + return this; + } + + /** + * Get the property is for NFS share only. The default is NoRootSquash. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + * + * @return the rootSquash value + */ + public RootSquashType rootSquash() { + return this.rootSquash; + } + + /** + * Set the property is for NFS share only. The default is NoRootSquash. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + * + * @param rootSquash the rootSquash value to set + * @return the FileShareInner object itself. + */ + public FileShareInner withRootSquash(RootSquashType rootSquash) { + this.rootSquash = rootSquash; + return this; + } + + /** + * Get the version of the share. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Get indicates whether the share was deleted. + * + * @return the deleted value + */ + public Boolean deleted() { + return this.deleted; + } + + /** + * Get the deleted time if the share was deleted. + * + * @return the deletedTime value + */ + public DateTime deletedTime() { + return this.deletedTime; + } + + /** + * Get remaining retention days for share that was soft deleted. + * + * @return the remainingRetentionDays value + */ + public Integer remainingRetentionDays() { + return this.remainingRetentionDays; + } + + /** + * Get access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Possible values include: 'TransactionOptimized', 'Hot', 'Cool', 'Premium'. + * + * @return the accessTier value + */ + public ShareAccessTier accessTier() { + return this.accessTier; + } + + /** + * Set access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Possible values include: 'TransactionOptimized', 'Hot', 'Cool', 'Premium'. + * + * @param accessTier the accessTier value to set + * @return the FileShareInner object itself. + */ + public FileShareInner withAccessTier(ShareAccessTier accessTier) { + this.accessTier = accessTier; + return this; + } + + /** + * Get indicates the last modification time for share access tier. + * + * @return the accessTierChangeTime value + */ + public DateTime accessTierChangeTime() { + return this.accessTierChangeTime; + } + + /** + * Get indicates if there is a pending transition for access tier. + * + * @return the accessTierStatus value + */ + public String accessTierStatus() { + return this.accessTierStatus; + } + + /** + * Get the approximate size of the data stored on the share. Note that this value may not include all recently created or recently resized files. + * + * @return the shareUsageBytes value + */ + public Integer shareUsageBytes() { + return this.shareUsageBytes; + } + } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareItemImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareItemImpl.java index 9f66a7a0b941..db81fb7c9d9a 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,11 @@ 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.ShareAccessTier; import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_06_01.EnabledProtocols; import java.util.Map; +import com.microsoft.azure.management.storage.v2019_06_01.RootSquashType; class FileShareItemImpl extends WrapperImpl implements FileShareItem { private final StorageManager manager; @@ -25,6 +28,36 @@ public StorageManager manager() { return this.manager; } + @Override + public ShareAccessTier accessTier() { + return this.inner().accessTier(); + } + + @Override + public DateTime accessTierChangeTime() { + return this.inner().accessTierChangeTime(); + } + + @Override + public String accessTierStatus() { + return this.inner().accessTierStatus(); + } + + @Override + public Boolean deleted() { + return this.inner().deleted(); + } + + @Override + public DateTime deletedTime() { + return this.inner().deletedTime(); + } + + @Override + public EnabledProtocols enabledProtocols() { + return this.inner().enabledProtocols(); + } + @Override public String etag() { return this.inner().etag(); @@ -50,14 +83,34 @@ public String name() { return this.inner().name(); } + @Override + public Integer remainingRetentionDays() { + return this.inner().remainingRetentionDays(); + } + + @Override + public RootSquashType rootSquash() { + return this.inner().rootSquash(); + } + @Override public Integer shareQuota() { return this.inner().shareQuota(); } + @Override + public Integer shareUsageBytes() { + return this.inner().shareUsageBytes(); + } + @Override public String type() { return this.inner().type(); } + @Override + public String version() { + return this.inner().version(); + } + } diff --git a/sdk/storage/mgmt-v2019_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..22ba754c4932 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,9 @@ 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.microsoft.azure.management.storage.v2019_06_01.ShareAccessTier; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.management.storage.v2019_06_01.AzureEntityResource; @@ -39,6 +42,72 @@ public class FileShareItemInner extends AzureEntityResource { @JsonProperty(value = "properties.shareQuota") private Integer shareQuota; + /** + * The authentication protocol that is used for the file share. Can only be + * specified when creating a share. Possible values include: 'SMB', 'NFS'. + */ + @JsonProperty(value = "properties.enabledProtocols") + private EnabledProtocols enabledProtocols; + + /** + * The property is for NFS share only. The default is NoRootSquash. + * Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + */ + @JsonProperty(value = "properties.rootSquash") + private RootSquashType rootSquash; + + /** + * The version of the share. + */ + @JsonProperty(value = "properties.version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /** + * Indicates whether the share was deleted. + */ + @JsonProperty(value = "properties.deleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean deleted; + + /** + * The deleted time if the share was deleted. + */ + @JsonProperty(value = "properties.deletedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime deletedTime; + + /** + * Remaining retention days for share that was soft deleted. + */ + @JsonProperty(value = "properties.remainingRetentionDays", access = JsonProperty.Access.WRITE_ONLY) + private Integer remainingRetentionDays; + + /** + * Access tier for specific share. GpV2 account can choose between + * TransactionOptimized (default), Hot, and Cool. FileStorage account can + * choose Premium. Possible values include: 'TransactionOptimized', 'Hot', + * 'Cool', 'Premium'. + */ + @JsonProperty(value = "properties.accessTier") + private ShareAccessTier accessTier; + + /** + * Indicates the last modification time for share access tier. + */ + @JsonProperty(value = "properties.accessTierChangeTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime accessTierChangeTime; + + /** + * Indicates if there is a pending transition for access tier. + */ + @JsonProperty(value = "properties.accessTierStatus", access = JsonProperty.Access.WRITE_ONLY) + private String accessTierStatus; + + /** + * The approximate size of the data stored on the share. Note that this + * value may not include all recently created or recently resized files. + */ + @JsonProperty(value = "properties.shareUsageBytes", access = JsonProperty.Access.WRITE_ONLY) + private Integer shareUsageBytes; + /** * Get returns the date and time the share was last modified. * @@ -88,4 +157,127 @@ public FileShareItemInner withShareQuota(Integer shareQuota) { return this; } + /** + * Get the authentication protocol that is used for the file share. Can only be specified when creating a share. Possible values include: 'SMB', 'NFS'. + * + * @return the enabledProtocols value + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set the authentication protocol that is used for the file share. Can only be specified when creating a share. Possible values include: 'SMB', 'NFS'. + * + * @param enabledProtocols the enabledProtocols value to set + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.enabledProtocols = enabledProtocols; + return this; + } + + /** + * Get the property is for NFS share only. The default is NoRootSquash. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + * + * @return the rootSquash value + */ + public RootSquashType rootSquash() { + return this.rootSquash; + } + + /** + * Set the property is for NFS share only. The default is NoRootSquash. Possible values include: 'NoRootSquash', 'RootSquash', 'AllSquash'. + * + * @param rootSquash the rootSquash value to set + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withRootSquash(RootSquashType rootSquash) { + this.rootSquash = rootSquash; + return this; + } + + /** + * Get the version of the share. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Get indicates whether the share was deleted. + * + * @return the deleted value + */ + public Boolean deleted() { + return this.deleted; + } + + /** + * Get the deleted time if the share was deleted. + * + * @return the deletedTime value + */ + public DateTime deletedTime() { + return this.deletedTime; + } + + /** + * Get remaining retention days for share that was soft deleted. + * + * @return the remainingRetentionDays value + */ + public Integer remainingRetentionDays() { + return this.remainingRetentionDays; + } + + /** + * Get access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Possible values include: 'TransactionOptimized', 'Hot', 'Cool', 'Premium'. + * + * @return the accessTier value + */ + public ShareAccessTier accessTier() { + return this.accessTier; + } + + /** + * Set access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Possible values include: 'TransactionOptimized', 'Hot', 'Cool', 'Premium'. + * + * @param accessTier the accessTier value to set + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withAccessTier(ShareAccessTier accessTier) { + this.accessTier = accessTier; + return this; + } + + /** + * Get indicates the last modification time for share access tier. + * + * @return the accessTierChangeTime value + */ + public DateTime accessTierChangeTime() { + return this.accessTierChangeTime; + } + + /** + * Get indicates if there is a pending transition for access tier. + * + * @return the accessTierStatus value + */ + public String accessTierStatus() { + return this.accessTierStatus; + } + + /** + * Get the approximate size of the data stored on the share. Note that this value may not include all recently created or recently resized files. + * + * @return the shareUsageBytes value + */ + public Integer shareUsageBytes() { + return this.shareUsageBytes; + } + } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileSharesImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileSharesImpl.java index 8c80b4e9bd74..83ff4afb3d62 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileSharesImpl.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileSharesImpl.java @@ -79,4 +79,10 @@ public Completable deleteAsync(String resourceGroupName, String accountName, Str return client.deleteAsync(resourceGroupName, accountName, shareName).toCompletable(); } + @Override + public Completable restoreAsync(String resourceGroupName, String accountName, String shareName, String deletedShareName, String deletedShareVersion) { + FileSharesInner client = this.inner(); + return client.restoreAsync(resourceGroupName, accountName, shareName, deletedShareName, deletedShareVersion).toCompletable(); + } + } diff --git a/sdk/storage/mgmt-v2019_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..6254d8f7ae3b 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 @@ -13,6 +13,9 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.storage.v2019_06_01.DeletedShare; +import com.microsoft.azure.management.storage.v2019_06_01.GetShareExpand; +import com.microsoft.azure.management.storage.v2019_06_01.ListSharesExpand; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -21,7 +24,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; @@ -30,6 +32,7 @@ import retrofit2.http.HTTP; import retrofit2.http.PATCH; import retrofit2.http.Path; +import retrofit2.http.POST; import retrofit2.http.PUT; import retrofit2.http.Query; import retrofit2.http.Url; @@ -65,24 +68,28 @@ public FileSharesInner(Retrofit retrofit, StorageManagementClientImpl client) { interface FileSharesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.FileShares list" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares") - Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$maxpagesize") String maxpagesize, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$maxpagesize") String maxpagesize, @Query("$filter") String filter, @Query("$expand") ListSharesExpand expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.FileShares create" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") - Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("shareName") String shareName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body FileShareInner fileShare, @Header("User-Agent") String userAgent); + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("shareName") String shareName, @Path("subscriptionId") String subscriptionId, @Body FileShareInner fileShare, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.FileShares update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") - Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("shareName") String shareName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body FileShareInner fileShare, @Header("User-Agent") String userAgent); + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("shareName") String shareName, @Path("subscriptionId") String subscriptionId, @Body FileShareInner fileShare, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.FileShares get" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") - Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("shareName") String shareName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("shareName") String shareName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") GetShareExpand expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.FileShares delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}", method = "DELETE", hasBody = true) Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("shareName") String shareName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.FileShares restore" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore") + Observable> restore(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("shareName") String shareName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DeletedShare deletedShare, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.FileShares listNext" }) @GET Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -193,7 +200,8 @@ public Observable>> listSinglePageAsync } final String maxpagesize = null; final String filter = null; - return service.list(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), maxpagesize, filter, this.client.acceptLanguage(), this.client.userAgent()) + final ListSharesExpand expand = null; + return service.list(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), maxpagesize, filter, expand, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -214,13 +222,14 @@ public Observable>> call(Response list(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter) { - ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter).toBlocking().single(); + public PagedList list(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListSharesExpand expand) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, expand).toBlocking().single(); return new PagedList(response.body()) { @Override public Page nextPage(String nextPageLink) { @@ -236,13 +245,14 @@ public Page nextPage(String nextPageLink) { * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Possible values include: 'deleted' * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListOperationCallback serviceCallback) { + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListSharesExpand expand, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter), + listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, expand), new Func1>>>() { @Override public Observable>> call(String nextPageLink) { @@ -259,11 +269,12 @@ public Observable>> call(String nextPag * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Possible values include: 'deleted' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<FileShareItemInner> object */ - public Observable> listAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter) { - return listWithServiceResponseAsync(resourceGroupName, accountName, maxpagesize, filter) + public Observable> listAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListSharesExpand expand) { + return listWithServiceResponseAsync(resourceGroupName, accountName, maxpagesize, filter, expand) .map(new Func1>, Page>() { @Override public Page call(ServiceResponse> response) { @@ -279,11 +290,12 @@ public Page call(ServiceResponse> r * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Possible values include: 'deleted' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<FileShareItemInner> object */ - public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter) { - return listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter) + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListSharesExpand expand) { + return listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, expand) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { @@ -303,10 +315,11 @@ public Observable>> call(ServiceRespons ServiceResponse> * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. ServiceResponse> * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. ServiceResponse> * @param filter Optional. When specified, only share names starting with the filter will be listed. + ServiceResponse> * @param expand Optional, used to expand the properties within share's properties. Possible values include: 'deleted' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<FileShareItemInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter) { + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListSharesExpand expand) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -319,7 +332,7 @@ public Observable>> listSinglePageAsync if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.list(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), maxpagesize, filter, this.client.acceptLanguage(), this.client.userAgent()) + return service.list(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), maxpagesize, filter, expand, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -346,13 +359,14 @@ private ServiceResponse> listDelegate(Response createAsync(String resourceGroupName, String accountName, String shareName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, shareName), serviceCallback); + public ServiceFuture createAsync(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, shareName, fileShare), serviceCallback); } /** @@ -375,11 +390,12 @@ public ServiceFuture 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 createAsync(String resourceGroupName, String accountName, String shareName) { - return createWithServiceResponseAsync(resourceGroupName, accountName, shareName).map(new Func1, FileShareInner>() { + public Observable createAsync(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { + return createWithServiceResponseAsync(resourceGroupName, accountName, shareName, fileShare).map(new Func1, FileShareInner>() { @Override public FileShareInner call(ServiceResponse response) { return response.body(); @@ -393,10 +409,11 @@ public FileShareInner call(ServiceResponse response) { * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties of the file share to create. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the FileShareInner object */ - public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName) { + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -409,15 +426,14 @@ public Observable> createWithServiceResponseAsyn 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."); } - final Map 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()) + Validator.validate(fileShare); + return service.create(resourceGroupName, accountName, shareName, this.client.subscriptionId(), fileShare, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -431,52 +447,57 @@ public Observable> call(Response r }); } + private ServiceResponse createDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** - * 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. + * 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 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 create(String resourceGroupName, String accountName, String shareName, Map metadata, Integer shareQuota) { - return createWithServiceResponseAsync(resourceGroupName, accountName, shareName, metadata, shareQuota).toBlocking().single().body(); + public FileShareInner update(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, shareName, fileShare).toBlocking().single().body(); } /** - * Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the files contained by the share. + * 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 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 createAsync(String resourceGroupName, String accountName, String shareName, Map metadata, Integer shareQuota, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, shareName, metadata, shareQuota), serviceCallback); + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, shareName, fileShare), serviceCallback); } /** - * Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the files contained by the share. + * 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 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 createAsync(String resourceGroupName, String accountName, String shareName, Map metadata, Integer shareQuota) { - return createWithServiceResponseAsync(resourceGroupName, accountName, shareName, metadata, shareQuota).map(new Func1, FileShareInner>() { + public Observable updateAsync(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, shareName, fileShare).map(new Func1, FileShareInner>() { @Override public FileShareInner call(ServiceResponse response) { return response.body(); @@ -485,17 +506,16 @@ public FileShareInner call(ServiceResponse response) { } /** - * Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the files contained by the share. + * 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 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> createWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName, Map metadata, Integer shareQuota) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -508,19 +528,19 @@ public Observable> createWithServiceResponseAsyn 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.update(resourceGroupName, accountName, shareName, this.client.subscriptionId(), fileShare, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = createDelegate(response); + ServiceResponse clientResponse = updateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -529,16 +549,15 @@ public Observable> call(Response r }); } - private ServiceResponse createDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .register(201, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. + * Gets properties of a specified share. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. @@ -548,12 +567,12 @@ private ServiceResponse createDelegate(Response re * @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 get(String resourceGroupName, String accountName, String shareName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, shareName).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. + * Gets properties of a specified share. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. @@ -562,12 +581,12 @@ public FileShareInner update(String resourceGroupName, String accountName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture updateAsync(String resourceGroupName, String accountName, String shareName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, shareName), serviceCallback); + public ServiceFuture getAsync(String resourceGroupName, String accountName, String shareName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, shareName), 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. + * Gets properties of a specified share. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. @@ -575,8 +594,8 @@ public ServiceFuture updateAsync(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the FileShareInner object */ - public Observable updateAsync(String resourceGroupName, String accountName, String shareName) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, shareName).map(new Func1, FileShareInner>() { + public Observable getAsync(String resourceGroupName, String accountName, String shareName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, shareName).map(new Func1, FileShareInner>() { @Override public FileShareInner call(ServiceResponse response) { return response.body(); @@ -585,7 +604,7 @@ public FileShareInner call(ServiceResponse response) { } /** - * Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. + * Gets properties of a specified share. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. @@ -593,7 +612,7 @@ public FileShareInner call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the FileShareInner object */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -609,17 +628,13 @@ public Observable> updateWithServiceResponseAsyn if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - final Map 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()) + final GetShareExpand expand = null; + return service.get(resourceGroupName, accountName, shareName, this.client.subscriptionId(), this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = updateDelegate(response); + ServiceResponse clientResponse = getDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -629,51 +644,48 @@ public Observable> call(Response r } /** - * 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. + * Gets properties of a specified share. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param 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 expand Optional, used to expand the properties within share's properties. Possible values include: 'stats' * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the FileShareInner object if successful. */ - public FileShareInner update(String resourceGroupName, String accountName, String shareName, Map metadata, Integer shareQuota) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, shareName, metadata, shareQuota).toBlocking().single().body(); + public FileShareInner get(String resourceGroupName, String accountName, String shareName, GetShareExpand expand) { + return getWithServiceResponseAsync(resourceGroupName, accountName, shareName, expand).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. + * Gets properties of a specified share. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param 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 expand Optional, used to expand the properties within share's properties. Possible values include: 'stats' * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture updateAsync(String resourceGroupName, String accountName, String shareName, Map metadata, Integer shareQuota, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, shareName, metadata, shareQuota), serviceCallback); + public ServiceFuture getAsync(String resourceGroupName, String accountName, String shareName, GetShareExpand expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, shareName, expand), 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. + * Gets properties of a specified share. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param 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 expand Optional, used to expand the properties within share's properties. Possible values include: 'stats' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the FileShareInner object */ - public Observable updateAsync(String resourceGroupName, String accountName, String shareName, Map metadata, Integer shareQuota) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, shareName, metadata, shareQuota).map(new Func1, FileShareInner>() { + public Observable getAsync(String resourceGroupName, String accountName, String shareName, GetShareExpand expand) { + return getWithServiceResponseAsync(resourceGroupName, accountName, shareName, expand).map(new Func1, FileShareInner>() { @Override public FileShareInner call(ServiceResponse response) { return response.body(); @@ -682,17 +694,16 @@ public FileShareInner call(ServiceResponse response) { } /** - * Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. + * Gets properties of a specified share. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. - * @param 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 expand Optional, used to expand the properties within share's properties. Possible values include: 'stats' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the FileShareInner object */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName, Map metadata, Integer shareQuota) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName, GetShareExpand expand) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -708,16 +719,12 @@ public Observable> updateWithServiceResponseAsyn 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()) + return service.get(resourceGroupName, accountName, shareName, this.client.subscriptionId(), this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = updateDelegate(response); + ServiceResponse clientResponse = getDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -726,7 +733,7 @@ public Observable> call(Response r }); } - private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) @@ -734,7 +741,7 @@ private ServiceResponse updateDelegate(Response re } /** - * Gets properties of a specified share. + * Deletes specified share under its account. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. @@ -742,14 +749,13 @@ private ServiceResponse updateDelegate(Response re * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the FileShareInner object if successful. */ - public FileShareInner get(String resourceGroupName, String accountName, String shareName) { - return getWithServiceResponseAsync(resourceGroupName, accountName, shareName).toBlocking().single().body(); + public void delete(String resourceGroupName, String accountName, String shareName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, shareName).toBlocking().single().body(); } /** - * Gets properties of a specified share. + * Deletes specified share under its account. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. @@ -758,38 +764,38 @@ public FileShareInner get(String resourceGroupName, String accountName, String s * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture getAsync(String resourceGroupName, String accountName, String shareName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, shareName), serviceCallback); + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String shareName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, shareName), serviceCallback); } /** - * Gets properties of a specified share. + * Deletes specified share under its account. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the FileShareInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable getAsync(String resourceGroupName, String accountName, String shareName) { - return getWithServiceResponseAsync(resourceGroupName, accountName, shareName).map(new Func1, FileShareInner>() { + public Observable deleteAsync(String resourceGroupName, String accountName, String shareName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, shareName).map(new Func1, Void>() { @Override - public FileShareInner call(ServiceResponse response) { + public Void call(ServiceResponse response) { return response.body(); } }); } /** - * Gets properties of a specified share. + * Deletes specified share under its account. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the FileShareInner object + * @return the {@link ServiceResponse} object if successful. */ - public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -805,12 +811,12 @@ public Observable> getWithServiceResponseAsync(S if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.get(resourceGroupName, accountName, shareName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.delete(resourceGroupName, accountName, shareName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getDelegate(response); + ServiceResponse clientResponse = deleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -819,52 +825,59 @@ public Observable> call(Response r }); } - private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Deletes specified share under its account. + * Restore a file share within a valid retention days if share soft delete is enabled. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param deletedShareName Required. Identify the name of the deleted share that will be restored. + * @param deletedShareVersion Required. Identify the version of the deleted share that will be restored. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ - public void delete(String resourceGroupName, String accountName, String shareName) { - deleteWithServiceResponseAsync(resourceGroupName, accountName, shareName).toBlocking().single().body(); + public void restore(String resourceGroupName, String accountName, String shareName, String deletedShareName, String deletedShareVersion) { + restoreWithServiceResponseAsync(resourceGroupName, accountName, shareName, deletedShareName, deletedShareVersion).toBlocking().single().body(); } /** - * Deletes specified share under its account. + * Restore a file share within a valid retention days if share soft delete is enabled. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param deletedShareName Required. Identify the name of the deleted share that will be restored. + * @param deletedShareVersion Required. Identify the version of the deleted share that will be restored. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String shareName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, shareName), serviceCallback); + public ServiceFuture restoreAsync(String resourceGroupName, String accountName, String shareName, String deletedShareName, String deletedShareVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restoreWithServiceResponseAsync(resourceGroupName, accountName, shareName, deletedShareName, deletedShareVersion), serviceCallback); } /** - * Deletes specified share under its account. + * Restore a file share within a valid retention days if share soft delete is enabled. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param deletedShareName Required. Identify the name of the deleted share that will be restored. + * @param deletedShareVersion Required. Identify the version of the deleted share that will be restored. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable deleteAsync(String resourceGroupName, String accountName, String shareName) { - return deleteWithServiceResponseAsync(resourceGroupName, accountName, shareName).map(new Func1, Void>() { + public Observable restoreAsync(String resourceGroupName, String accountName, String shareName, String deletedShareName, String deletedShareVersion) { + return restoreWithServiceResponseAsync(resourceGroupName, accountName, shareName, deletedShareName, deletedShareVersion).map(new Func1, Void>() { @Override public Void call(ServiceResponse response) { return response.body(); @@ -873,15 +886,17 @@ public Void call(ServiceResponse response) { } /** - * Deletes specified share under its account. + * Restore a file share within a valid retention days if share soft delete is enabled. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param deletedShareName Required. Identify the name of the deleted share that will be restored. + * @param deletedShareVersion Required. Identify the version of the deleted share that will be restored. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName) { + public Observable> restoreWithServiceResponseAsync(String resourceGroupName, String accountName, String shareName, String deletedShareName, String deletedShareVersion) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -897,12 +912,21 @@ public Observable> deleteWithServiceResponseAsync(String r if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.delete(resourceGroupName, accountName, shareName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + if (deletedShareName == null) { + throw new IllegalArgumentException("Parameter deletedShareName is required and cannot be null."); + } + if (deletedShareVersion == null) { + throw new IllegalArgumentException("Parameter deletedShareVersion is required and cannot be null."); + } + DeletedShare deletedShare = new DeletedShare(); + deletedShare.withDeletedShareName(deletedShareName); + deletedShare.withDeletedShareVersion(deletedShareVersion); + return service.restore(resourceGroupName, accountName, shareName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), deletedShare, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = deleteDelegate(response); + ServiceResponse clientResponse = restoreDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -911,10 +935,9 @@ public Observable> call(Response response) { }); } - private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse restoreDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .register(204, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); }