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..648e9f53a639 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. */ @@ -1863,7 +1907,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; /** @@ -2264,6 +2312,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 +2593,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 +3121,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..8d35082dca6a 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: { @@ -3006,6 +3066,12 @@ export const BlobServiceProperties: msRest.CompositeMapper = { className: "DeleteRetentionPolicy" } }, + isVersioningEnabled: { + serializedName: "properties.isVersioningEnabled", + type: { + name: "Boolean" + } + }, automaticSnapshotPolicyEnabled: { serializedName: "properties.automaticSnapshotPolicyEnabled", type: { @@ -3412,6 +3478,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/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);