From 3bbc58bca4ab96a74b2c1f48867853a06185ade0 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Sun, 23 Feb 2020 21:08:23 +0000 Subject: [PATCH] Generated from e787f151f12b98865ac5a57cf7c4146693577bf3 Updating description --- .../src/models/blobContainersMappers.ts | 2 + .../src/models/blobServicesMappers.ts | 2 + .../src/models/encryptionScopesMappers.ts | 71 +++ .../src/models/fileServicesMappers.ts | 2 + .../src/models/fileSharesMappers.ts | 2 + sdk/storage/arm-storage/src/models/index.ts | 227 +++++++++- .../src/models/managementPoliciesMappers.ts | 2 + sdk/storage/arm-storage/src/models/mappers.ts | 110 ++++- .../arm-storage/src/models/parameters.ts | 14 + .../privateEndpointConnectionsMappers.ts | 2 + .../src/models/privateLinkResourcesMappers.ts | 2 + .../src/models/storageAccountsMappers.ts | 2 + .../src/operations/blobContainers.ts | 48 +- .../src/operations/encryptionScopes.ts | 413 ++++++++++++++++++ .../arm-storage/src/operations/index.ts | 1 + .../src/storageManagementClient.ts | 2 + 16 files changed, 873 insertions(+), 29 deletions(-) create mode 100644 sdk/storage/arm-storage/src/models/encryptionScopesMappers.ts create mode 100644 sdk/storage/arm-storage/src/operations/encryptionScopes.ts diff --git a/sdk/storage/arm-storage/src/models/blobContainersMappers.ts b/sdk/storage/arm-storage/src/models/blobContainersMappers.ts index af27e1f36103..841f6031756a 100644 --- a/sdk/storage/arm-storage/src/models/blobContainersMappers.ts +++ b/sdk/storage/arm-storage/src/models/blobContainersMappers.ts @@ -30,6 +30,8 @@ export { DateAfterModification, DeleteRetentionPolicy, Encryption, + EncryptionScope, + EncryptionScopeKeyVaultProperties, EncryptionService, EncryptionServices, Endpoints, diff --git a/sdk/storage/arm-storage/src/models/blobServicesMappers.ts b/sdk/storage/arm-storage/src/models/blobServicesMappers.ts index 0e76fcb14e87..04b152790ea6 100644 --- a/sdk/storage/arm-storage/src/models/blobServicesMappers.ts +++ b/sdk/storage/arm-storage/src/models/blobServicesMappers.ts @@ -26,6 +26,8 @@ export { DateAfterModification, DeleteRetentionPolicy, Encryption, + EncryptionScope, + EncryptionScopeKeyVaultProperties, EncryptionService, EncryptionServices, Endpoints, diff --git a/sdk/storage/arm-storage/src/models/encryptionScopesMappers.ts b/sdk/storage/arm-storage/src/models/encryptionScopesMappers.ts new file mode 100644 index 000000000000..6654e1b23bf5 --- /dev/null +++ b/sdk/storage/arm-storage/src/models/encryptionScopesMappers.ts @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + ActiveDirectoryProperties, + AzureEntityResource, + AzureFilesIdentityBasedAuthentication, + BaseResource, + BlobContainer, + BlobRestoreParameters, + BlobRestoreRange, + BlobRestoreStatus, + BlobServiceProperties, + ChangeFeed, + CloudError, + CorsRule, + CorsRules, + CustomDomain, + DateAfterCreation, + DateAfterModification, + DeleteRetentionPolicy, + Encryption, + EncryptionScope, + EncryptionScopeKeyVaultProperties, + EncryptionScopeListResult, + EncryptionService, + EncryptionServices, + Endpoints, + ErrorResponse, + FileServiceProperties, + FileShare, + FileShareItem, + GeoReplicationStats, + Identity, + ImmutabilityPolicy, + ImmutabilityPolicyProperties, + IPRule, + KeyVaultProperties, + LegalHoldProperties, + ListContainerItem, + ManagementPolicy, + ManagementPolicyAction, + ManagementPolicyBaseBlob, + ManagementPolicyDefinition, + ManagementPolicyFilter, + ManagementPolicyRule, + ManagementPolicySchema, + ManagementPolicySnapShot, + NetworkRuleSet, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateLinkResource, + PrivateLinkServiceConnectionState, + ProxyResource, + Resource, + RestorePolicyProperties, + RoutingPreference, + Sku, + StorageAccount, + StorageAccountInternetEndpoints, + StorageAccountMicrosoftEndpoints, + TagProperty, + TrackedResource, + UpdateHistoryProperty, + VirtualNetworkRule +} from "../models/mappers"; diff --git a/sdk/storage/arm-storage/src/models/fileServicesMappers.ts b/sdk/storage/arm-storage/src/models/fileServicesMappers.ts index cae6862a0f6f..9f9c175bfaf8 100644 --- a/sdk/storage/arm-storage/src/models/fileServicesMappers.ts +++ b/sdk/storage/arm-storage/src/models/fileServicesMappers.ts @@ -25,6 +25,8 @@ export { DateAfterModification, DeleteRetentionPolicy, Encryption, + EncryptionScope, + EncryptionScopeKeyVaultProperties, EncryptionService, EncryptionServices, Endpoints, diff --git a/sdk/storage/arm-storage/src/models/fileSharesMappers.ts b/sdk/storage/arm-storage/src/models/fileSharesMappers.ts index 55e072ceb4fd..73469ee7a351 100644 --- a/sdk/storage/arm-storage/src/models/fileSharesMappers.ts +++ b/sdk/storage/arm-storage/src/models/fileSharesMappers.ts @@ -25,6 +25,8 @@ export { DateAfterModification, DeleteRetentionPolicy, Encryption, + EncryptionScope, + EncryptionScopeKeyVaultProperties, EncryptionService, EncryptionServices, Endpoints, diff --git a/sdk/storage/arm-storage/src/models/index.ts b/sdk/storage/arm-storage/src/models/index.ts index a0849f3a2e69..a6cd7003ef2e 100644 --- a/sdk/storage/arm-storage/src/models/index.ts +++ b/sdk/storage/arm-storage/src/models/index.ts @@ -1458,6 +1458,50 @@ export interface PrivateLinkResourceListResult { value?: PrivateLinkResource[]; } +/** + * The key vault properties for the encryption scope. This is a required field if encryption scope + * 'source' attribute is set to 'Microsoft.KeyVault'. + */ +export interface EncryptionScopeKeyVaultProperties { + /** + * The object identifier for a key vault key object. When applied, the encryption scope will use + * the key referenced by the identifier to enable customer-managed key support on this encryption + * scope. + */ + keyUri?: string; +} + +/** + * The Encryption Scope resource. + */ +export interface EncryptionScope extends Resource { + /** + * The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, + * Microsoft.KeyVault. Possible values include: 'Microsoft.Storage', 'Microsoft.KeyVault' + */ + source?: EncryptionScopeSource; + /** + * The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + * Possible values include: 'Enabled', 'Disabled' + */ + state?: EncryptionScopeState; + /** + * Gets the creation date and time of the encryption scope in UTC. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly creationTime?: Date; + /** + * Gets the last modification date and time of the encryption scope in UTC. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly lastModifiedTime?: Date; + /** + * The key vault properties for the encryption scope. This is a required field if encryption + * scope 'source' attribute is set to 'Microsoft.KeyVault'. + */ + keyVaultProperties?: EncryptionScopeKeyVaultProperties; +} + /** * An error response from the storage resource provider. */ @@ -1535,13 +1579,20 @@ export interface ImmutabilityPolicyProperties { /** * The immutability period for the blobs in the container since the policy creation, in days. */ - immutabilityPeriodSinceCreationInDays: number; + immutabilityPeriodSinceCreationInDays?: number; /** * The ImmutabilityPolicy state of a blob container, possible values include: Locked and * Unlocked. Possible values include: 'Locked', 'Unlocked' * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly state?: ImmutabilityPolicyState; + /** + * This property can only be changed for unlocked time-based retention policies. When enabled, + * new blocks can be written to an append blob while maintaining immutability protection and + * compliance. Only new blocks can be added and any existing blocks cannot be modified or + * deleted. This property cannot be changed with ExtendImmutabilityPolicy API + */ + allowProtectedAppendWrites?: boolean; /** * ImmutabilityPolicy Etag. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -1673,13 +1724,20 @@ export interface ImmutabilityPolicy extends AzureEntityResource { /** * The immutability period for the blobs in the container since the policy creation, in days. */ - immutabilityPeriodSinceCreationInDays: number; + immutabilityPeriodSinceCreationInDays?: number; /** * The ImmutabilityPolicy state of a blob container, possible values include: Locked and * Unlocked. Possible values include: 'Locked', 'Unlocked' * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly state?: ImmutabilityPolicyState; + /** + * This property can only be changed for unlocked time-based retention policies. When enabled, + * new blocks can be written to an append blob while maintaining immutability protection and + * compliance. Only new blocks can be added and any existing blocks cannot be modified or + * deleted. This property cannot be changed with ExtendImmutabilityPolicy API + */ + allowProtectedAppendWrites?: boolean; } /** @@ -1863,7 +1921,11 @@ export interface BlobServiceProperties extends Resource { */ deleteRetentionPolicy?: DeleteRetentionPolicy; /** - * Automatic Snapshot is enabled if set to true. + * Versioning is enabled if set to true. + */ + isVersioningEnabled?: boolean; + /** + * Deprecated in favor of isVersioningEnabled property. */ automaticSnapshotPolicyEnabled?: boolean; /** @@ -2074,6 +2136,17 @@ export interface BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams ex * operation will always be applied. */ ifMatch?: string; + /** + * The immutability period for the blobs in the container since the policy creation, in days. + */ + immutabilityPeriodSinceCreationInDays?: number; + /** + * This property can only be changed for unlocked time-based retention policies. When enabled, + * new blocks can be written to an append blob while maintaining immutability protection and + * compliance. Only new blocks can be added and any existing blocks cannot be modified or + * deleted. This property cannot be changed with ExtendImmutabilityPolicy API + */ + allowProtectedAppendWrites?: boolean; } /** @@ -2088,6 +2161,23 @@ export interface BlobContainersGetImmutabilityPolicyOptionalParams extends msRes ifMatch?: string; } +/** + * Optional Parameters. + */ +export interface BlobContainersExtendImmutabilityPolicyOptionalParams extends msRest.RequestOptionsBase { + /** + * The immutability period for the blobs in the container since the policy creation, in days. + */ + immutabilityPeriodSinceCreationInDays?: number; + /** + * This property can only be changed for unlocked time-based retention policies. When enabled, + * new blocks can be written to an append blob while maintaining immutability protection and + * compliance. Only new blocks can be added and any existing blocks cannot be modified or + * deleted. This property cannot be changed with ExtendImmutabilityPolicy API + */ + allowProtectedAppendWrites?: boolean; +} + /** * Optional Parameters. */ @@ -2264,6 +2354,21 @@ export interface StorageAccountListResult extends Array { export interface UsageListResult extends Array { } +/** + * @interface + * List of encryption scopes requested, and if paging is required, a URL to the next page of + * encryption scopes. + * @extends Array + */ +export interface EncryptionScopeListResult extends Array { + /** + * Request URL that can be used to query next page of encryption scopes. Returned when total + * number of requested encryption scopes exceeds the maximum page size. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + /** * @interface * An interface representing the BlobServiceItems. @@ -2530,6 +2635,22 @@ export type HttpProtocol = 'https,http' | 'https'; */ export type SignedResource = 'b' | 'c' | 'f' | 's'; +/** + * Defines values for EncryptionScopeSource. + * Possible values include: 'Microsoft.Storage', 'Microsoft.KeyVault' + * @readonly + * @enum {string} + */ +export type EncryptionScopeSource = 'Microsoft.Storage' | 'Microsoft.KeyVault'; + +/** + * Defines values for EncryptionScopeState. + * Possible values include: 'Enabled', 'Disabled' + * @readonly + * @enum {string} + */ +export type EncryptionScopeState = 'Enabled' | 'Disabled'; + /** * Defines values for PublicAccess. * Possible values include: 'Container', 'Blob', 'None' @@ -3042,6 +3163,106 @@ export type PrivateLinkResourcesListByStorageAccountResponse = PrivateLinkResour }; }; +/** + * Contains response data for the put operation. + */ +export type EncryptionScopesPutResponse = EncryptionScope & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: EncryptionScope; + }; +}; + +/** + * Contains response data for the patch operation. + */ +export type EncryptionScopesPatchResponse = EncryptionScope & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: EncryptionScope; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type EncryptionScopesGetResponse = EncryptionScope & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: EncryptionScope; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type EncryptionScopesListResponse = EncryptionScopeListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: EncryptionScopeListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type EncryptionScopesListNextResponse = EncryptionScopeListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: EncryptionScopeListResult; + }; +}; + /** * Contains response data for the list operation. */ diff --git a/sdk/storage/arm-storage/src/models/managementPoliciesMappers.ts b/sdk/storage/arm-storage/src/models/managementPoliciesMappers.ts index feeef14a9f3f..1f0770fd0551 100644 --- a/sdk/storage/arm-storage/src/models/managementPoliciesMappers.ts +++ b/sdk/storage/arm-storage/src/models/managementPoliciesMappers.ts @@ -25,6 +25,8 @@ export { DateAfterModification, DeleteRetentionPolicy, Encryption, + EncryptionScope, + EncryptionScopeKeyVaultProperties, EncryptionService, EncryptionServices, Endpoints, diff --git a/sdk/storage/arm-storage/src/models/mappers.ts b/sdk/storage/arm-storage/src/models/mappers.ts index c3278603633f..a764e1a46d56 100644 --- a/sdk/storage/arm-storage/src/models/mappers.ts +++ b/sdk/storage/arm-storage/src/models/mappers.ts @@ -2366,6 +2366,66 @@ export const PrivateLinkResourceListResult: msRest.CompositeMapper = { } }; +export const EncryptionScopeKeyVaultProperties: msRest.CompositeMapper = { + serializedName: "EncryptionScopeKeyVaultProperties", + type: { + name: "Composite", + className: "EncryptionScopeKeyVaultProperties", + modelProperties: { + keyUri: { + serializedName: "keyUri", + type: { + name: "String" + } + } + } + } +}; + +export const EncryptionScope: msRest.CompositeMapper = { + serializedName: "EncryptionScope", + type: { + name: "Composite", + className: "EncryptionScope", + modelProperties: { + ...Resource.type.modelProperties, + source: { + serializedName: "properties.source", + type: { + name: "String" + } + }, + state: { + serializedName: "properties.state", + type: { + name: "String" + } + }, + creationTime: { + readOnly: true, + serializedName: "properties.creationTime", + type: { + name: "DateTime" + } + }, + lastModifiedTime: { + readOnly: true, + serializedName: "properties.lastModifiedTime", + type: { + name: "DateTime" + } + }, + keyVaultProperties: { + serializedName: "properties.keyVaultProperties", + type: { + name: "Composite", + className: "EncryptionScopeKeyVaultProperties" + } + } + } + } +}; + export const ErrorResponse: msRest.CompositeMapper = { serializedName: "ErrorResponse", type: { @@ -2476,7 +2536,6 @@ export const ImmutabilityPolicyProperties: msRest.CompositeMapper = { className: "ImmutabilityPolicyProperties", modelProperties: { immutabilityPeriodSinceCreationInDays: { - required: true, serializedName: "properties.immutabilityPeriodSinceCreationInDays", type: { name: "Number" @@ -2489,6 +2548,12 @@ export const ImmutabilityPolicyProperties: msRest.CompositeMapper = { name: "String" } }, + allowProtectedAppendWrites: { + serializedName: "properties.allowProtectedAppendWrites", + type: { + name: "Boolean" + } + }, etag: { readOnly: true, serializedName: "etag", @@ -2686,7 +2751,6 @@ export const ImmutabilityPolicy: msRest.CompositeMapper = { modelProperties: { ...AzureEntityResource.type.modelProperties, immutabilityPeriodSinceCreationInDays: { - required: true, serializedName: "properties.immutabilityPeriodSinceCreationInDays", type: { name: "Number" @@ -2698,6 +2762,12 @@ export const ImmutabilityPolicy: msRest.CompositeMapper = { type: { name: "String" } + }, + allowProtectedAppendWrites: { + serializedName: "properties.allowProtectedAppendWrites", + type: { + name: "Boolean" + } } } } @@ -3006,6 +3076,12 @@ export const BlobServiceProperties: msRest.CompositeMapper = { className: "DeleteRetentionPolicy" } }, + isVersioningEnabled: { + serializedName: "properties.isVersioningEnabled", + type: { + name: "Boolean" + } + }, automaticSnapshotPolicyEnabled: { serializedName: "properties.automaticSnapshotPolicyEnabled", type: { @@ -3412,6 +3488,36 @@ export const UsageListResult: msRest.CompositeMapper = { } }; +export const EncryptionScopeListResult: msRest.CompositeMapper = { + serializedName: "EncryptionScopeListResult", + type: { + name: "Composite", + className: "EncryptionScopeListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EncryptionScope" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const BlobServiceItems: msRest.CompositeMapper = { serializedName: "BlobServiceItems", type: { diff --git a/sdk/storage/arm-storage/src/models/parameters.ts b/sdk/storage/arm-storage/src/models/parameters.ts index 9c3be020aa02..f5c7e2fa39b6 100644 --- a/sdk/storage/arm-storage/src/models/parameters.ts +++ b/sdk/storage/arm-storage/src/models/parameters.ts @@ -73,6 +73,20 @@ export const containerName: msRest.OperationURLParameter = { } } }; +export const encryptionScopeName: msRest.OperationURLParameter = { + parameterPath: "encryptionScopeName", + mapper: { + required: true, + serializedName: "encryptionScopeName", + constraints: { + MaxLength: 63, + MinLength: 3 + }, + type: { + name: "String" + } + } +}; export const expand0: msRest.OperationQueryParameter = { parameterPath: [ "options", diff --git a/sdk/storage/arm-storage/src/models/privateEndpointConnectionsMappers.ts b/sdk/storage/arm-storage/src/models/privateEndpointConnectionsMappers.ts index f6681b66306c..ade001101396 100644 --- a/sdk/storage/arm-storage/src/models/privateEndpointConnectionsMappers.ts +++ b/sdk/storage/arm-storage/src/models/privateEndpointConnectionsMappers.ts @@ -24,6 +24,8 @@ export { DateAfterModification, DeleteRetentionPolicy, Encryption, + EncryptionScope, + EncryptionScopeKeyVaultProperties, EncryptionService, EncryptionServices, Endpoints, diff --git a/sdk/storage/arm-storage/src/models/privateLinkResourcesMappers.ts b/sdk/storage/arm-storage/src/models/privateLinkResourcesMappers.ts index a60ad13c720b..07454a28f91a 100644 --- a/sdk/storage/arm-storage/src/models/privateLinkResourcesMappers.ts +++ b/sdk/storage/arm-storage/src/models/privateLinkResourcesMappers.ts @@ -25,6 +25,8 @@ export { DateAfterModification, DeleteRetentionPolicy, Encryption, + EncryptionScope, + EncryptionScopeKeyVaultProperties, EncryptionService, EncryptionServices, Endpoints, diff --git a/sdk/storage/arm-storage/src/models/storageAccountsMappers.ts b/sdk/storage/arm-storage/src/models/storageAccountsMappers.ts index 00878042fa32..dd059a1dd293 100644 --- a/sdk/storage/arm-storage/src/models/storageAccountsMappers.ts +++ b/sdk/storage/arm-storage/src/models/storageAccountsMappers.ts @@ -27,6 +27,8 @@ export { DateAfterModification, DeleteRetentionPolicy, Encryption, + EncryptionScope, + EncryptionScopeKeyVaultProperties, EncryptionService, EncryptionServices, Endpoints, diff --git a/sdk/storage/arm-storage/src/operations/blobContainers.ts b/sdk/storage/arm-storage/src/operations/blobContainers.ts index 804baa43d41c..f7391eb44b93 100644 --- a/sdk/storage/arm-storage/src/operations/blobContainers.ts +++ b/sdk/storage/arm-storage/src/operations/blobContainers.ts @@ -424,12 +424,10 @@ export class BlobContainers { * container names must be between 3 and 63 characters in length and use numbers, lower-case * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by * a letter or number. - * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the - * container since the policy creation, in days. * @param [options] The optional parameters * @returns Promise */ - createOrUpdateImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, immutabilityPeriodSinceCreationInDays: number, options?: Models.BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams): Promise; + createOrUpdateImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, options?: Models.BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams): Promise; /** * @param resourceGroupName The name of the resource group within the user's subscription. The name * is case insensitive. @@ -440,11 +438,9 @@ export class BlobContainers { * container names must be between 3 and 63 characters in length and use numbers, lower-case * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by * a letter or number. - * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the - * container since the policy creation, in days. * @param callback The callback */ - createOrUpdateImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, immutabilityPeriodSinceCreationInDays: number, callback: msRest.ServiceCallback): void; + createOrUpdateImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group within the user's subscription. The name * is case insensitive. @@ -455,19 +451,16 @@ export class BlobContainers { * container names must be between 3 and 63 characters in length and use numbers, lower-case * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by * a letter or number. - * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the - * container since the policy creation, in days. * @param options The optional parameters * @param callback The callback */ - createOrUpdateImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, immutabilityPeriodSinceCreationInDays: number, options: Models.BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams, callback: msRest.ServiceCallback): void; - createOrUpdateImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, immutabilityPeriodSinceCreationInDays: number, options?: Models.BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createOrUpdateImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, options: Models.BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams, callback: msRest.ServiceCallback): void; + createOrUpdateImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, options?: Models.BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, containerName, - immutabilityPeriodSinceCreationInDays, options }, createOrUpdateImmutabilityPolicyOperationSpec, @@ -677,12 +670,10 @@ export class BlobContainers { * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of * "*" can be used to apply the operation only if the immutability policy already exists. If * omitted, this operation will always be applied. - * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the - * container since the policy creation, in days. * @param [options] The optional parameters * @returns Promise */ - extendImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, immutabilityPeriodSinceCreationInDays: number, options?: msRest.RequestOptionsBase): Promise; + extendImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, options?: Models.BlobContainersExtendImmutabilityPolicyOptionalParams): Promise; /** * @param resourceGroupName The name of the resource group within the user's subscription. The name * is case insensitive. @@ -696,11 +687,9 @@ export class BlobContainers { * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of * "*" can be used to apply the operation only if the immutability policy already exists. If * omitted, this operation will always be applied. - * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the - * container since the policy creation, in days. * @param callback The callback */ - extendImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, immutabilityPeriodSinceCreationInDays: number, callback: msRest.ServiceCallback): void; + extendImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group within the user's subscription. The name * is case insensitive. @@ -714,20 +703,17 @@ export class BlobContainers { * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of * "*" can be used to apply the operation only if the immutability policy already exists. If * omitted, this operation will always be applied. - * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the - * container since the policy creation, in days. * @param options The optional parameters * @param callback The callback */ - extendImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, immutabilityPeriodSinceCreationInDays: number, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - extendImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, immutabilityPeriodSinceCreationInDays: number, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + extendImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, options: Models.BlobContainersExtendImmutabilityPolicyOptionalParams, callback: msRest.ServiceCallback): void; + extendImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, options?: Models.BlobContainersExtendImmutabilityPolicyOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, containerName, ifMatch, - immutabilityPeriodSinceCreationInDays, options }, extendImmutabilityPolicyOperationSpec, @@ -1075,7 +1061,14 @@ const createOrUpdateImmutabilityPolicyOperationSpec: msRest.OperationSpec = { ], requestBody: { parameterPath: { - immutabilityPeriodSinceCreationInDays: "immutabilityPeriodSinceCreationInDays" + immutabilityPeriodSinceCreationInDays: [ + "options", + "immutabilityPeriodSinceCreationInDays" + ], + allowProtectedAppendWrites: [ + "options", + "allowProtectedAppendWrites" + ] }, mapper: Mappers.ImmutabilityPolicy }, @@ -1195,7 +1188,14 @@ const extendImmutabilityPolicyOperationSpec: msRest.OperationSpec = { ], requestBody: { parameterPath: { - immutabilityPeriodSinceCreationInDays: "immutabilityPeriodSinceCreationInDays" + immutabilityPeriodSinceCreationInDays: [ + "options", + "immutabilityPeriodSinceCreationInDays" + ], + allowProtectedAppendWrites: [ + "options", + "allowProtectedAppendWrites" + ] }, mapper: Mappers.ImmutabilityPolicy }, diff --git a/sdk/storage/arm-storage/src/operations/encryptionScopes.ts b/sdk/storage/arm-storage/src/operations/encryptionScopes.ts new file mode 100644 index 000000000000..efc098645eb2 --- /dev/null +++ b/sdk/storage/arm-storage/src/operations/encryptionScopes.ts @@ -0,0 +1,413 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/encryptionScopesMappers"; +import * as Parameters from "../models/parameters"; +import { StorageManagementClientContext } from "../storageManagementClientContext"; + +/** Class representing a EncryptionScopes. */ +export class EncryptionScopes { + private readonly client: StorageManagementClientContext; + + /** + * Create a EncryptionScopes. + * @param {StorageManagementClientContext} client Reference to the service client. + */ + constructor(client: StorageManagementClientContext) { + this.client = client; + } + + /** + * Synchronously creates or updates an encryption scope under the specified storage account. If an + * encryption scope is already created and a subsequent request is issued with different + * properties, the encryption scope properties will be updated per the specified request. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage + * account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + * lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + * followed by a letter or number. + * @param encryptionScope Encryption scope properties to be used for the create or update. + * @param [options] The optional parameters + * @returns Promise + */ + put(resourceGroupName: string, accountName: string, encryptionScopeName: string, encryptionScope: Models.EncryptionScope, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage + * account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + * lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + * followed by a letter or number. + * @param encryptionScope Encryption scope properties to be used for the create or update. + * @param callback The callback + */ + put(resourceGroupName: string, accountName: string, encryptionScopeName: string, encryptionScope: Models.EncryptionScope, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage + * account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + * lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + * followed by a letter or number. + * @param encryptionScope Encryption scope properties to be used for the create or update. + * @param options The optional parameters + * @param callback The callback + */ + put(resourceGroupName: string, accountName: string, encryptionScopeName: string, encryptionScope: Models.EncryptionScope, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + put(resourceGroupName: string, accountName: string, encryptionScopeName: string, encryptionScope: Models.EncryptionScope, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + encryptionScopeName, + encryptionScope, + options + }, + putOperationSpec, + callback) as Promise; + } + + /** + * Update encryption scope properties as specified in the request body. Update fails if the + * specified encryption scope does not already exist. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage + * account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + * lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + * followed by a letter or number. + * @param encryptionScope Encryption scope properties to be used for the update. + * @param [options] The optional parameters + * @returns Promise + */ + patch(resourceGroupName: string, accountName: string, encryptionScopeName: string, encryptionScope: Models.EncryptionScope, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage + * account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + * lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + * followed by a letter or number. + * @param encryptionScope Encryption scope properties to be used for the update. + * @param callback The callback + */ + patch(resourceGroupName: string, accountName: string, encryptionScopeName: string, encryptionScope: Models.EncryptionScope, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage + * account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + * lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + * followed by a letter or number. + * @param encryptionScope Encryption scope properties to be used for the update. + * @param options The optional parameters + * @param callback The callback + */ + patch(resourceGroupName: string, accountName: string, encryptionScopeName: string, encryptionScope: Models.EncryptionScope, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + patch(resourceGroupName: string, accountName: string, encryptionScopeName: string, encryptionScope: Models.EncryptionScope, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + encryptionScopeName, + encryptionScope, + options + }, + patchOperationSpec, + callback) as Promise; + } + + /** + * Returns the properties for the specified encryption scope. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage + * account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + * lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + * followed by a letter or number. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, accountName: string, encryptionScopeName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage + * account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + * lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + * followed by a letter or number. + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, encryptionScopeName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage + * account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + * lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + * followed by a letter or number. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, encryptionScopeName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, accountName: string, encryptionScopeName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + encryptionScopeName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param callback The callback + */ + list(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const putOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.encryptionScopeName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "encryptionScope", + mapper: { + ...Mappers.EncryptionScope, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.EncryptionScope + }, + 201: { + bodyMapper: Mappers.EncryptionScope + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const patchOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.encryptionScopeName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "encryptionScope", + mapper: { + ...Mappers.EncryptionScope, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.EncryptionScope + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.encryptionScopeName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.EncryptionScope + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.EncryptionScopeListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.EncryptionScopeListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/storage/arm-storage/src/operations/index.ts b/sdk/storage/arm-storage/src/operations/index.ts index f8026756bab0..af5df33ba851 100644 --- a/sdk/storage/arm-storage/src/operations/index.ts +++ b/sdk/storage/arm-storage/src/operations/index.ts @@ -15,6 +15,7 @@ export * from "./usages"; export * from "./managementPolicies"; export * from "./privateEndpointConnections"; export * from "./privateLinkResources"; +export * from "./encryptionScopes"; export * from "./blobServices"; export * from "./blobContainers"; export * from "./fileServices"; diff --git a/sdk/storage/arm-storage/src/storageManagementClient.ts b/sdk/storage/arm-storage/src/storageManagementClient.ts index 219daf6e028a..7277405a90f2 100644 --- a/sdk/storage/arm-storage/src/storageManagementClient.ts +++ b/sdk/storage/arm-storage/src/storageManagementClient.ts @@ -24,6 +24,7 @@ class StorageManagementClient extends StorageManagementClientContext { managementPolicies: operations.ManagementPolicies; privateEndpointConnections: operations.PrivateEndpointConnections; privateLinkResources: operations.PrivateLinkResources; + encryptionScopes: operations.EncryptionScopes; blobServices: operations.BlobServices; blobContainers: operations.BlobContainers; fileServices: operations.FileServices; @@ -44,6 +45,7 @@ class StorageManagementClient extends StorageManagementClientContext { this.managementPolicies = new operations.ManagementPolicies(this); this.privateEndpointConnections = new operations.PrivateEndpointConnections(this); this.privateLinkResources = new operations.PrivateLinkResources(this); + this.encryptionScopes = new operations.EncryptionScopes(this); this.blobServices = new operations.BlobServices(this); this.blobContainers = new operations.BlobContainers(this); this.fileServices = new operations.FileServices(this);