diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 01ec82f75f19..e65f100dbab3 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -619,6 +619,21 @@ packages: - supports-color dev: false + /@azure/arm-storage/17.0.0: + resolution: {integrity: sha512-WS9eT3/vDQ7a1z/8K5BkPhoAi0ilo94yCSws4KyWq6UIA3RaXBDpYYAlN0TOxad9rPeOnWXWcB9gLw3DmjZ4wg==} + engines: {node: '>=12.0.0'} + dependencies: + '@azure/abort-controller': 1.0.4 + '@azure/core-auth': 1.3.2 + '@azure/core-client': 1.4.0 + '@azure/core-lro': 2.2.3 + '@azure/core-paging': 1.2.1 + '@azure/core-rest-pipeline': 1.4.0 + tslib: 2.3.1 + transitivePeerDependencies: + - supports-color + dev: false + /@azure/communication-common/1.1.0: resolution: {integrity: sha512-vqTtzDtb4NG3LWoWoqlOOJApZRRIIImNUKlGyTa6c1YC+v5A7UEOL9TX8NRDxvFVUF2wDHsSnkhLBVBgkcAhIQ==} engines: {node: '>=12.0.0'} @@ -9000,11 +9015,12 @@ packages: dev: false file:projects/arm-batch.tgz: - resolution: {integrity: sha512-pY6AfIYpdFqP+h5xLI9a/M8G7jyv3oJJUdZybMSzXofqoaF6Kitasm26yxA39Ze/fLyD8xtqKEfSykopmlSthg==, tarball: file:projects/arm-batch.tgz} + resolution: {integrity: sha512-B+3DKgCLAxOcRX0VFWQktSHr/zCkG1EICwbGtvDBMlw/Y8RKLaQDW8HLHw2+nfty1CNAq/8Jqcg8KkEOS4I8KA==, tarball: file:projects/arm-batch.tgz} name: '@rush-temp/arm-batch' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 + '@azure/arm-storage': 17.0.0 '@microsoft/api-extractor': 7.19.4 '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 '@rollup/plugin-json': 4.1.0_rollup@1.32.1 @@ -9850,11 +9866,12 @@ packages: dev: false file:projects/arm-eventhub.tgz: - resolution: {integrity: sha512-5ClisVtvID+83iw1KvnH0GlurB224ykbSdBhF+IexseCdDFEhkyBeE064Hh9lpoJKzEDEwqe/Mqjq/w69b6rcQ==, tarball: file:projects/arm-eventhub.tgz} + resolution: {integrity: sha512-lubE3sQwQVCVTyxt1tGyps6B37v7xJpgusZmAFsm7AxQ9HOE9sOtwSAyXLy/89TQNSJUhnoh1rIR3eWsQsfrdQ==, tarball: file:projects/arm-eventhub.tgz} name: '@rush-temp/arm-eventhub' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 + '@azure/arm-storage': 17.0.0 '@microsoft/api-extractor': 7.19.4 '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 '@rollup/plugin-json': 4.1.0_rollup@1.32.1 @@ -10650,11 +10667,12 @@ packages: dev: false file:projects/arm-monitor.tgz: - resolution: {integrity: sha512-fGEPUwHrAFIOY7+1ZoH/b4M+AgudqMrq42bQJTcvBtZXpPz5CaTn3DQmJpPQEUultLOwocA/k9NOsXEk+BxrHQ==, tarball: file:projects/arm-monitor.tgz} + resolution: {integrity: sha512-Z+R8NDuaegxJEnhATAYeqXTyUUWP20WZQ/wdaiORF3fjazbRrF53/Z8V6tFVQHyLtw/pV9EMo6D5ycxQt0Scpg==, tarball: file:projects/arm-monitor.tgz} name: '@rush-temp/arm-monitor' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 + '@azure/arm-storage': 17.0.0 '@microsoft/api-extractor': 7.19.4 '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 '@rollup/plugin-json': 4.1.0_rollup@1.32.1 @@ -11675,7 +11693,7 @@ packages: dev: false file:projects/arm-storage.tgz: - resolution: {integrity: sha512-FMNMh6WilO4ePgzUX86Xk1Bqq4VHtRuqvFfXZkW9O9OEXWB1QtLhNN0KHNq6gpwMkC5Xam4vEzIRaWoN9bEaBg==, tarball: file:projects/arm-storage.tgz} + resolution: {integrity: sha512-+8h93tQKgGcrkPBBmEhiaSyaGWRjCD8hsfP44fAZ4P7I5DjeRFDoQjYrmEcUlR3Lgvig1nxjHlL8a6hMDHf9aA==, tarball: file:projects/arm-storage.tgz} name: '@rush-temp/arm-storage' version: 0.0.0 dependencies: diff --git a/sdk/storage/arm-storage/CHANGELOG.md b/sdk/storage/arm-storage/CHANGELOG.md index 4216b5756022..a8363080c5b7 100644 --- a/sdk/storage/arm-storage/CHANGELOG.md +++ b/sdk/storage/arm-storage/CHANGELOG.md @@ -1,15 +1,46 @@ # Release History - -## 17.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + +## 17.1.0 (2022-01-24) + +**Features** + + - Added operation group LocalUsersOperations + - Added Interface LocalUserKeys + - Added Interface LocalUserRegeneratePasswordResult + - Added Interface LocalUsers + - Added Interface LocalUsersCreateOrUpdateOptionalParams + - Added Interface LocalUsersDeleteOptionalParams + - Added Interface LocalUsersGetOptionalParams + - Added Interface LocalUsersListKeysOptionalParams + - Added Interface LocalUsersListOptionalParams + - Added Interface LocalUsersRegeneratePasswordOptionalParams + - Added Interface PermissionScope + - Added Interface SshPublicKey + - Added Type Alias ActiveDirectoryPropertiesAccountType + - Added Type Alias AllowedCopyScope + - Added Type Alias LocalUser + - Added Type Alias LocalUsersCreateOrUpdateResponse + - Added Type Alias LocalUsersGetResponse + - Added Type Alias LocalUsersListKeysResponse + - Added Type Alias LocalUsersListResponse + - Added Type Alias LocalUsersRegeneratePasswordResponse + - Interface ActiveDirectoryProperties has a new optional parameter accountType + - Interface ActiveDirectoryProperties has a new optional parameter samAccountName + - Interface EncryptionIdentity has a new optional parameter encryptionFederatedIdentityClientId + - Interface StorageAccountCreateParameters has a new optional parameter allowedCopyScope + - Interface StorageAccountCreateParameters has a new optional parameter isLocalUserEnabled + - Interface StorageAccountCreateParameters has a new optional parameter isSftpEnabled + - Interface StorageAccountUpdateParameters has a new optional parameter allowedCopyScope + - Interface StorageAccountUpdateParameters has a new optional parameter isLocalUserEnabled + - Interface StorageAccountUpdateParameters has a new optional parameter isSftpEnabled + - Class StorageManagementClient has a new parameter localUsersOperations + - Type Alias StorageAccount has a new parameter isSftpEnabled + - Type Alias StorageAccount has a new parameter isLocalUserEnabled + - Type Alias StorageAccount has a new parameter allowedCopyScope + - Added Enum KnownActiveDirectoryPropertiesAccountType + - Added Enum KnownAllowedCopyScope + + ## 17.0.0 (2021-12-06) The package of @azure/arm-storage is using our next generation design principles since version 17.0.0, which contains breaking changes. diff --git a/sdk/storage/arm-storage/LICENSE b/sdk/storage/arm-storage/LICENSE index ccb63b166732..5d1d36e0af80 100644 --- a/sdk/storage/arm-storage/LICENSE +++ b/sdk/storage/arm-storage/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/storage/arm-storage/_meta.json b/sdk/storage/arm-storage/_meta.json index 038f1b6617d7..16ac6e182adb 100644 --- a/sdk/storage/arm-storage/_meta.json +++ b/sdk/storage/arm-storage/_meta.json @@ -1,7 +1,7 @@ { - "commit": "3b2f85d320fac5b282bc80240f9e5c2c57753bad", + "commit": "cf445751fc1caad1a539e134d831f2ab1a6b657b", "readme": "specification/storage/resource-manager/readme.md", - "autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/storage/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211130.1", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/storage/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "use": "@autorest/typescript@6.0.0-alpha.16.20211130.1" + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" } \ No newline at end of file diff --git a/sdk/storage/arm-storage/api-extractor.json b/sdk/storage/arm-storage/api-extractor.json index 682357c80942..1ef22e1176ee 100644 --- a/sdk/storage/arm-storage/api-extractor.json +++ b/sdk/storage/arm-storage/api-extractor.json @@ -1,18 +1,31 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", - "docModel": { "enabled": true }, - "apiReport": { "enabled": true, "reportFolder": "./review" }, + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/arm-storage.d.ts" }, "messages": { - "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, "extractorMessageReporting": { - "ae-missing-release-tag": { "logLevel": "none" }, - "ae-unresolved-link": { "logLevel": "none" } + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } } } -} +} \ No newline at end of file diff --git a/sdk/storage/arm-storage/package.json b/sdk/storage/arm-storage/package.json index e154200f09e4..e4ddbf9f60f8 100644 --- a/sdk/storage/arm-storage/package.json +++ b/sdk/storage/arm-storage/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for StorageManagementClient.", - "version": "17.0.1", + "version": "17.1.0", "engines": { "node": ">=12.0.0" }, @@ -42,9 +42,7 @@ "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^1.0.0", "mocha": "^7.1.1", - "cross-env": "^7.0.2", - "chai": "^4.2.0", - "@types/chai": "^4.1.6" + "cross-env": "^7.0.2" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storage/arm-storage", "repository": { @@ -101,4 +99,4 @@ }, "sideEffects": false, "autoPublish": true -} +} \ No newline at end of file diff --git a/sdk/storage/arm-storage/review/arm-storage.api.md b/sdk/storage/arm-storage/review/arm-storage.api.md index eeef45ba4774..60b812986bfa 100644 --- a/sdk/storage/arm-storage/review/arm-storage.api.md +++ b/sdk/storage/arm-storage/review/arm-storage.api.md @@ -47,14 +47,22 @@ export type AccountStatus = "available" | "unavailable"; // @public export interface ActiveDirectoryProperties { + accountType?: ActiveDirectoryPropertiesAccountType; azureStorageSid: string; domainGuid: string; domainName: string; domainSid: string; forestName: string; netBiosDomainName: string; + samAccountName?: string; } +// @public +export type ActiveDirectoryPropertiesAccountType = string; + +// @public +export type AllowedCopyScope = string; + // @public export type AzureEntityResource = Resource & { readonly etag?: string; @@ -414,11 +422,6 @@ export interface CloudError { error?: CloudErrorBody; } -// @public -export interface CloudErrorAutoGenerated { - error?: CloudErrorBodyAutoGenerated; -} - // @public export interface CloudErrorBody { code?: string; @@ -427,14 +430,6 @@ export interface CloudErrorBody { target?: string; } -// @public -export interface CloudErrorBodyAutoGenerated { - code?: string; - details?: CloudErrorBodyAutoGenerated[]; - message?: string; - target?: string; -} - // @public export interface CorsRule { allowedHeaders: string[]; @@ -555,6 +550,7 @@ export interface Encryption { // @public export interface EncryptionIdentity { + encryptionFederatedIdentityClientId?: string; encryptionUserAssignedIdentity?: string; } @@ -974,6 +970,22 @@ export enum KnownAccountImmutabilityPolicyState { Unlocked = "Unlocked" } +// @public +export enum KnownActiveDirectoryPropertiesAccountType { + // (undocumented) + Computer = "Computer", + // (undocumented) + User = "User" +} + +// @public +export enum KnownAllowedCopyScope { + // (undocumented) + AAD = "AAD", + // (undocumented) + PrivateLink = "PrivateLink" +} + // @public export enum KnownBlobInventoryPolicyName { // (undocumented) @@ -1602,6 +1614,83 @@ export interface ListTableServices { readonly value?: TableServiceProperties[]; } +// @public +export type LocalUser = Resource & { + readonly systemData?: SystemData; + permissionScopes?: PermissionScope[]; + homeDirectory?: string; + sshAuthorizedKeys?: SshPublicKey[]; + readonly sid?: string; + hasSharedKey?: boolean; + hasSshKey?: boolean; + hasSshPassword?: boolean; +}; + +// @public +export interface LocalUserKeys { + readonly sharedKey?: string; + sshAuthorizedKeys?: SshPublicKey[]; +} + +// @public +export interface LocalUserRegeneratePasswordResult { + readonly sshPassword?: string; +} + +// @public +export interface LocalUsers { + value?: LocalUser[]; +} + +// @public +export interface LocalUsersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LocalUsersCreateOrUpdateResponse = LocalUser; + +// @public +export interface LocalUsersDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface LocalUsersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LocalUsersGetResponse = LocalUser; + +// @public +export interface LocalUsersListKeysOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LocalUsersListKeysResponse = LocalUserKeys; + +// @public +export interface LocalUsersListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LocalUsersListResponse = LocalUsers; + +// @public +export interface LocalUsersOperations { + createOrUpdate(resourceGroupName: string, accountName: string, username: string, properties: LocalUser, options?: LocalUsersCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, accountName: string, username: string, options?: LocalUsersDeleteOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, username: string, options?: LocalUsersGetOptionalParams): Promise; + list(resourceGroupName: string, accountName: string, options?: LocalUsersListOptionalParams): PagedAsyncIterableIterator; + listKeys(resourceGroupName: string, accountName: string, username: string, options?: LocalUsersListKeysOptionalParams): Promise; + regeneratePassword(resourceGroupName: string, accountName: string, username: string, options?: LocalUsersRegeneratePasswordOptionalParams): Promise; +} + +// @public +export interface LocalUsersRegeneratePasswordOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LocalUsersRegeneratePasswordResponse = LocalUserRegeneratePasswordResult; + // @public export interface ManagementPolicies { createOrUpdate(resourceGroupName: string, accountName: string, managementPolicyName: ManagementPolicyName, properties: ManagementPolicy, options?: ManagementPoliciesCreateOrUpdateOptionalParams): Promise; @@ -1828,6 +1917,13 @@ export type OperationsListResponse = OperationListResult; type Permissions_2 = string; export { Permissions_2 as Permissions } +// @public (undocumented) +export interface PermissionScope { + permissions: string; + resourceName: string; + service: string; +} + // @public export interface PrivateEndpoint { readonly id?: string; @@ -2177,6 +2273,12 @@ export interface SmbSetting { versions?: string; } +// @public (undocumented) +export interface SshPublicKey { + description?: string; + key?: string; +} + // @public export type State = string; @@ -2204,6 +2306,8 @@ export type StorageAccount = TrackedResource & { azureFilesIdentityBasedAuthentication?: AzureFilesIdentityBasedAuthentication; enableHttpsTrafficOnly?: boolean; readonly networkRuleSet?: NetworkRuleSet; + isSftpEnabled?: boolean; + isLocalUserEnabled?: boolean; isHnsEnabled?: boolean; readonly geoReplicationStats?: GeoReplicationStats; readonly failoverInProgress?: boolean; @@ -2219,6 +2323,7 @@ export type StorageAccount = TrackedResource & { defaultToOAuthAuthentication?: boolean; publicNetworkAccess?: PublicNetworkAccess; immutableStorageWithVersioning?: ImmutableStorageAccount; + allowedCopyScope?: AllowedCopyScope; }; // @public @@ -2232,6 +2337,7 @@ export interface StorageAccountCreateParameters { accessTier?: AccessTier; allowBlobPublicAccess?: boolean; allowCrossTenantReplication?: boolean; + allowedCopyScope?: AllowedCopyScope; allowSharedKeyAccess?: boolean; azureFilesIdentityBasedAuthentication?: AzureFilesIdentityBasedAuthentication; customDomain?: CustomDomain; @@ -2243,6 +2349,8 @@ export interface StorageAccountCreateParameters { identity?: Identity; immutableStorageWithVersioning?: ImmutableStorageAccount; isHnsEnabled?: boolean; + isLocalUserEnabled?: boolean; + isSftpEnabled?: boolean; keyPolicy?: KeyPolicy; kind: Kind; largeFileSharesState?: LargeFileSharesState; @@ -2455,6 +2563,7 @@ export interface StorageAccountUpdateParameters { accessTier?: AccessTier; allowBlobPublicAccess?: boolean; allowCrossTenantReplication?: boolean; + allowedCopyScope?: AllowedCopyScope; allowSharedKeyAccess?: boolean; azureFilesIdentityBasedAuthentication?: AzureFilesIdentityBasedAuthentication; customDomain?: CustomDomain; @@ -2463,6 +2572,8 @@ export interface StorageAccountUpdateParameters { encryption?: Encryption; identity?: Identity; immutableStorageWithVersioning?: ImmutableStorageAccount; + isLocalUserEnabled?: boolean; + isSftpEnabled?: boolean; keyPolicy?: KeyPolicy; kind?: Kind; largeFileSharesState?: LargeFileSharesState; @@ -2499,6 +2610,8 @@ export class StorageManagementClient extends coreClient.ServiceClient { // (undocumented) fileShares: FileShares; // (undocumented) + localUsersOperations: LocalUsersOperations; + // (undocumented) managementPolicies: ManagementPolicies; // (undocumented) objectReplicationPoliciesOperations: ObjectReplicationPoliciesOperations; diff --git a/sdk/storage/arm-storage/src/models/index.ts b/sdk/storage/arm-storage/src/models/index.ts index dc8519669b5e..496a28da070d 100644 --- a/sdk/storage/arm-storage/src/models/index.ts +++ b/sdk/storage/arm-storage/src/models/index.ts @@ -187,6 +187,8 @@ export interface StorageAccountCreateParameters { tags?: { [propertyName: string]: string }; /** The identity of the resource. */ identity?: Identity; + /** Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. */ + allowedCopyScope?: AllowedCopyScope; /** Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ publicNetworkAccess?: PublicNetworkAccess; /** SasPolicy assigned to the storage account. */ @@ -195,7 +197,7 @@ export interface StorageAccountCreateParameters { keyPolicy?: KeyPolicy; /** User domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. */ customDomain?: CustomDomain; - /** Not applicable. Azure Storage encryption is enabled for all storage accounts and cannot be disabled. */ + /** Encryption settings to be used for server-side encryption for the storage account. */ encryption?: Encryption; /** Network rule set */ networkRuleSet?: NetworkRuleSet; @@ -205,6 +207,10 @@ export interface StorageAccountCreateParameters { azureFilesIdentityBasedAuthentication?: AzureFilesIdentityBasedAuthentication; /** Allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01. */ enableHttpsTrafficOnly?: boolean; + /** Enables Secure File Transfer Protocol, if set to true */ + isSftpEnabled?: boolean; + /** Enables local users feature, if set to true */ + isLocalUserEnabled?: boolean; /** Account HierarchicalNamespace enabled if sets to true. */ isHnsEnabled?: boolean; /** Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. */ @@ -328,10 +334,10 @@ export interface EncryptionServices { /** A service that allows server-side encryption to be used. */ export interface EncryptionService { - /** A boolean indicating whether or not the service encrypts the data as it is stored. */ + /** A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. */ enabled?: boolean; /** - * Gets a rough estimate of the date/time when the encryption was last enabled by the user. Only returned when encryption is enabled. There might be some unencrypted blobs which were written after this time, as it is just a rough estimate. + * Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by default today and cannot be disabled. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly lastEnabledTime?: Date; @@ -363,6 +369,8 @@ export interface KeyVaultProperties { export interface EncryptionIdentity { /** Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage account. */ encryptionUserAssignedIdentity?: string; + /** ClientId of the multi-tenant application to be used in conjunction with the user-assigned identity for cross-tenant customer-managed-keys server-side encryption on the storage account. */ + encryptionFederatedIdentityClientId?: string; } /** Network rule set */ @@ -429,6 +437,10 @@ export interface ActiveDirectoryProperties { domainSid: string; /** Specifies the security identifier (SID) for Azure Storage. */ azureStorageSid: string; + /** Specifies the Active Directory SAMAccountName for Azure Storage. */ + samAccountName?: string; + /** Specifies the Active Directory account type for Azure Storage. */ + accountType?: ActiveDirectoryPropertiesAccountType; } /** Routing preference defines the type of network, either microsoft or internet routing to be used to deliver the user data, the default option is microsoft routing */ @@ -670,7 +682,7 @@ export interface StorageAccountUpdateParameters { kind?: Kind; /** Custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. */ customDomain?: CustomDomain; - /** Provides the encryption settings on the account. The default setting is unencrypted. */ + /** Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled. */ encryption?: Encryption; /** SasPolicy assigned to the storage account. */ sasPolicy?: SasPolicy; @@ -682,6 +694,10 @@ export interface StorageAccountUpdateParameters { azureFilesIdentityBasedAuthentication?: AzureFilesIdentityBasedAuthentication; /** Allows https traffic only to storage service if sets to true. */ enableHttpsTrafficOnly?: boolean; + /** Enables Secure File Transfer Protocol, if set to true */ + isSftpEnabled?: boolean; + /** Enables local users feature, if set to true */ + isLocalUserEnabled?: boolean; /** Network rule set */ networkRuleSet?: NetworkRuleSet; /** Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. */ @@ -702,6 +718,8 @@ export interface StorageAccountUpdateParameters { publicNetworkAccess?: PublicNetworkAccess; /** The property is immutable and can only be set to true at the account creation time. When set to true, it enables object level immutability for all the containers in the account by default. */ immutableStorageWithVersioning?: ImmutableStorageAccount; + /** Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. */ + allowedCopyScope?: AllowedCopyScope; } /** The response from the List Deleted Accounts operation. */ @@ -1120,6 +1138,48 @@ export interface ObjectReplicationPolicyFilter { minCreationTime?: string; } +/** List storage account local users. */ +export interface LocalUsers { + /** The local users associated with the storage account. */ + value?: LocalUser[]; +} + +export interface PermissionScope { + /** The permissions for the local user. Possible values include: Read (r), Write (w), Delete (d), List (l), and Create (c). */ + permissions: string; + /** The service used by the local user, e.g. blob, file. */ + service: string; + /** The name of resource, normally the container name or the file share name, used by the local user. */ + resourceName: string; +} + +export interface SshPublicKey { + /** Optional. It is used to store the function/usage of the key */ + description?: string; + /** Ssh public key base64 encoded. The format should be: ' ', e.g. ssh-rsa AAAABBBB */ + key?: string; +} + +/** The Storage Account Local User keys. */ +export interface LocalUserKeys { + /** Optional, local user ssh authorized keys for SFTP. */ + sshAuthorizedKeys?: SshPublicKey[]; + /** + * Auto generated by the server for SMB authentication. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly sharedKey?: string; +} + +/** The secrets of Storage Account Local User. */ +export interface LocalUserRegeneratePasswordResult { + /** + * Auto generated password by the server for SSH authentication if hasSshPassword is set to true on the creation of local user. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly sshPassword?: string; +} + /** 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. */ @@ -1457,24 +1517,6 @@ export interface Multichannel { enabled?: boolean; } -/** An error response from the Storage service. */ -export interface CloudErrorAutoGenerated { - /** An error response from the Storage service. */ - error?: CloudErrorBodyAutoGenerated; -} - -/** An error response from the Storage service. */ -export interface CloudErrorBodyAutoGenerated { - /** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */ - code?: string; - /** A message describing the error, intended to be suitable for display in a user interface. */ - message?: string; - /** The target of the particular error. For example, the name of the property in error. */ - target?: string; - /** A list of additional details about the error. */ - details?: CloudErrorBodyAutoGenerated[]; -} - /** Response schema. Contains list of shares returned, and if paging is requested or required, a URL to next page of shares. */ export interface FileShareItems { /** @@ -1666,6 +1708,32 @@ export type ObjectReplicationPolicy = Resource & { rules?: ObjectReplicationPolicyRule[]; }; +/** The local user associated with the storage accounts. */ +export type LocalUser = Resource & { + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The permission scopes of the local user. */ + permissionScopes?: PermissionScope[]; + /** Optional, local user home directory. */ + homeDirectory?: string; + /** Optional, local user ssh authorized keys for SFTP. */ + sshAuthorizedKeys?: SshPublicKey[]; + /** + * A unique Security Identifier that is generated by the server. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly sid?: string; + /** Indicates whether shared key exists. Set it to false to remove existing shared key. */ + hasSharedKey?: boolean; + /** Indicates whether ssh key exists. Set it to false to remove existing SSH key. */ + hasSshKey?: boolean; + /** Indicates whether ssh password exists. Set it to false to remove existing SSH password. */ + hasSshPassword?: boolean; +}; + /** The Encryption Scope resource. */ export type EncryptionScope = Resource & { /** The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. */ @@ -1857,7 +1925,7 @@ export type StorageAccount = TrackedResource & { */ readonly secondaryEndpoints?: Endpoints; /** - * Gets the encryption settings on the account. If unspecified, the account is unencrypted. + * Encryption settings to be used for server-side encryption for the storage account. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly encryption?: Encryption; @@ -1875,6 +1943,10 @@ export type StorageAccount = TrackedResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly networkRuleSet?: NetworkRuleSet; + /** Enables Secure File Transfer Protocol, if set to true */ + isSftpEnabled?: boolean; + /** Enables local users feature, if set to true */ + isLocalUserEnabled?: boolean; /** Account HierarchicalNamespace enabled if sets to true. */ isHnsEnabled?: boolean; /** @@ -1917,6 +1989,8 @@ export type StorageAccount = TrackedResource & { publicNetworkAccess?: PublicNetworkAccess; /** The property is immutable and can only be set to true at the account creation time. When set to true, it enables object level immutability for all the containers in the account by default. */ immutableStorageWithVersioning?: ImmutableStorageAccount; + /** Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. */ + allowedCopyScope?: AllowedCopyScope; }; /** Deleted storage account */ @@ -2407,6 +2481,22 @@ export enum KnownIdentityType { */ export type IdentityType = string; +/** Known values of {@link AllowedCopyScope} that the service accepts. */ +export enum KnownAllowedCopyScope { + PrivateLink = "PrivateLink", + AAD = "AAD" +} + +/** + * Defines values for AllowedCopyScope. \ + * {@link KnownAllowedCopyScope} can be used interchangeably with AllowedCopyScope, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **PrivateLink** \ + * **AAD** + */ +export type AllowedCopyScope = string; + /** Known values of {@link PublicNetworkAccess} that the service accepts. */ export enum KnownPublicNetworkAccess { Enabled = "Enabled", @@ -2529,6 +2619,22 @@ export enum KnownDirectoryServiceOptions { */ export type DirectoryServiceOptions = string; +/** Known values of {@link ActiveDirectoryPropertiesAccountType} that the service accepts. */ +export enum KnownActiveDirectoryPropertiesAccountType { + User = "User", + Computer = "Computer" +} + +/** + * Defines values for ActiveDirectoryPropertiesAccountType. \ + * {@link KnownActiveDirectoryPropertiesAccountType} can be used interchangeably with ActiveDirectoryPropertiesAccountType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Computer** + */ +export type ActiveDirectoryPropertiesAccountType = string; + /** Known values of {@link DefaultSharePermission} that the service accepts. */ export enum KnownDefaultSharePermission { None = "None", @@ -3497,6 +3603,45 @@ export type ObjectReplicationPoliciesCreateOrUpdateResponse = ObjectReplicationP export interface ObjectReplicationPoliciesDeleteOptionalParams extends coreClient.OperationOptions {} +/** Optional parameters. */ +export interface LocalUsersListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type LocalUsersListResponse = LocalUsers; + +/** Optional parameters. */ +export interface LocalUsersGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type LocalUsersGetResponse = LocalUser; + +/** Optional parameters. */ +export interface LocalUsersCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type LocalUsersCreateOrUpdateResponse = LocalUser; + +/** Optional parameters. */ +export interface LocalUsersDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface LocalUsersListKeysOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listKeys operation. */ +export type LocalUsersListKeysResponse = LocalUserKeys; + +/** Optional parameters. */ +export interface LocalUsersRegeneratePasswordOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the regeneratePassword operation. */ +export type LocalUsersRegeneratePasswordResponse = LocalUserRegeneratePasswordResult; + /** Optional parameters. */ export interface EncryptionScopesPutOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/storage/arm-storage/src/models/mappers.ts b/sdk/storage/arm-storage/src/models/mappers.ts index 42ca740f6505..85d1598cb67d 100644 --- a/sdk/storage/arm-storage/src/models/mappers.ts +++ b/sdk/storage/arm-storage/src/models/mappers.ts @@ -464,6 +464,12 @@ export const StorageAccountCreateParameters: coreClient.CompositeMapper = { className: "Identity" } }, + allowedCopyScope: { + serializedName: "properties.allowedCopyScope", + type: { + name: "String" + } + }, publicNetworkAccess: { serializedName: "properties.publicNetworkAccess", type: { @@ -525,6 +531,18 @@ export const StorageAccountCreateParameters: coreClient.CompositeMapper = { name: "Boolean" } }, + isSftpEnabled: { + serializedName: "properties.isSftpEnabled", + type: { + name: "Boolean" + } + }, + isLocalUserEnabled: { + serializedName: "properties.isLocalUserEnabled", + type: { + name: "Boolean" + } + }, isHnsEnabled: { serializedName: "properties.isHnsEnabled", type: { @@ -920,6 +938,12 @@ export const EncryptionIdentity: coreClient.CompositeMapper = { type: { name: "String" } + }, + encryptionFederatedIdentityClientId: { + serializedName: "federatedIdentityClientId", + type: { + name: "String" + } } } } @@ -1136,6 +1160,18 @@ export const ActiveDirectoryProperties: coreClient.CompositeMapper = { type: { name: "String" } + }, + samAccountName: { + serializedName: "samAccountName", + type: { + name: "String" + } + }, + accountType: { + serializedName: "accountType", + type: { + name: "String" + } } } } @@ -1667,6 +1703,18 @@ export const StorageAccountUpdateParameters: coreClient.CompositeMapper = { name: "Boolean" } }, + isSftpEnabled: { + serializedName: "properties.isSftpEnabled", + type: { + name: "Boolean" + } + }, + isLocalUserEnabled: { + serializedName: "properties.isLocalUserEnabled", + type: { + name: "Boolean" + } + }, networkRuleSet: { serializedName: "properties.networkAcls", type: { @@ -1729,6 +1777,12 @@ export const StorageAccountUpdateParameters: coreClient.CompositeMapper = { name: "Composite", className: "ImmutableStorageAccount" } + }, + allowedCopyScope: { + serializedName: "properties.allowedCopyScope", + type: { + name: "String" + } } } } @@ -2904,6 +2958,122 @@ export const ObjectReplicationPolicyFilter: coreClient.CompositeMapper = { } }; +export const LocalUsers: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LocalUsers", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LocalUser" + } + } + } + } + } + } +}; + +export const PermissionScope: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PermissionScope", + modelProperties: { + permissions: { + serializedName: "permissions", + required: true, + type: { + name: "String" + } + }, + service: { + serializedName: "service", + required: true, + type: { + name: "String" + } + }, + resourceName: { + serializedName: "resourceName", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const SshPublicKey: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SshPublicKey", + modelProperties: { + description: { + serializedName: "description", + type: { + name: "String" + } + }, + key: { + serializedName: "key", + type: { + name: "String" + } + } + } + } +}; + +export const LocalUserKeys: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LocalUserKeys", + modelProperties: { + sshAuthorizedKeys: { + serializedName: "sshAuthorizedKeys", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SshPublicKey" + } + } + } + }, + sharedKey: { + serializedName: "sharedKey", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const LocalUserRegeneratePasswordResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LocalUserRegeneratePasswordResult", + modelProperties: { + sshPassword: { + serializedName: "sshPassword", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const EncryptionScopeKeyVaultProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3721,61 +3891,6 @@ export const Multichannel: coreClient.CompositeMapper = { } }; -export const CloudErrorAutoGenerated: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudErrorAutoGenerated", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "CloudErrorBodyAutoGenerated" - } - } - } - } -}; - -export const CloudErrorBodyAutoGenerated: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudErrorBodyAutoGenerated", - modelProperties: { - code: { - serializedName: "code", - type: { - name: "String" - } - }, - message: { - serializedName: "message", - type: { - name: "String" - } - }, - target: { - serializedName: "target", - type: { - name: "String" - } - }, - details: { - serializedName: "details", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CloudErrorBodyAutoGenerated" - } - } - } - } - } - } -}; - export const FileShareItems: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4248,6 +4363,78 @@ export const ObjectReplicationPolicy: coreClient.CompositeMapper = { } }; +export const LocalUser: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LocalUser", + modelProperties: { + ...Resource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + permissionScopes: { + serializedName: "properties.permissionScopes", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PermissionScope" + } + } + } + }, + homeDirectory: { + serializedName: "properties.homeDirectory", + type: { + name: "String" + } + }, + sshAuthorizedKeys: { + serializedName: "properties.sshAuthorizedKeys", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SshPublicKey" + } + } + } + }, + sid: { + serializedName: "properties.sid", + readOnly: true, + type: { + name: "String" + } + }, + hasSharedKey: { + serializedName: "properties.hasSharedKey", + type: { + name: "Boolean" + } + }, + hasSshKey: { + serializedName: "properties.hasSshKey", + type: { + name: "Boolean" + } + }, + hasSshPassword: { + serializedName: "properties.hasSshPassword", + type: { + name: "Boolean" + } + } + } + } +}; + export const EncryptionScope: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4684,6 +4871,18 @@ export const StorageAccount: coreClient.CompositeMapper = { className: "NetworkRuleSet" } }, + isSftpEnabled: { + serializedName: "properties.isSftpEnabled", + type: { + name: "Boolean" + } + }, + isLocalUserEnabled: { + serializedName: "properties.isLocalUserEnabled", + type: { + name: "Boolean" + } + }, isHnsEnabled: { serializedName: "properties.isHnsEnabled", type: { @@ -4785,6 +4984,12 @@ export const StorageAccount: coreClient.CompositeMapper = { name: "Composite", className: "ImmutableStorageAccount" } + }, + allowedCopyScope: { + serializedName: "properties.allowedCopyScope", + type: { + name: "String" + } } } } diff --git a/sdk/storage/arm-storage/src/models/parameters.ts b/sdk/storage/arm-storage/src/models/parameters.ts index a2a6522fb7fd..24d14a565cad 100644 --- a/sdk/storage/arm-storage/src/models/parameters.ts +++ b/sdk/storage/arm-storage/src/models/parameters.ts @@ -23,6 +23,7 @@ import { BlobInventoryPolicy as BlobInventoryPolicyMapper, PrivateEndpointConnection as PrivateEndpointConnectionMapper, ObjectReplicationPolicy as ObjectReplicationPolicyMapper, + LocalUser as LocalUserMapper, EncryptionScope as EncryptionScopeMapper, BlobServiceProperties as BlobServicePropertiesMapper, BlobContainer as BlobContainerMapper, @@ -65,7 +66,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-06-01", + defaultValue: "2021-08-01", isConstant: true, serializedName: "api-version", type: { @@ -305,6 +306,26 @@ export const properties3: OperationParameter = { mapper: ObjectReplicationPolicyMapper }; +export const username: OperationURLParameter = { + parameterPath: "username", + mapper: { + constraints: { + MaxLength: 64, + MinLength: 3 + }, + serializedName: "username", + required: true, + type: { + name: "String" + } + } +}; + +export const properties4: OperationParameter = { + parameterPath: "properties", + mapper: LocalUserMapper +}; + export const encryptionScope: OperationParameter = { parameterPath: "encryptionScope", mapper: EncryptionScopeMapper diff --git a/sdk/storage/arm-storage/src/operations/fileServices.ts b/sdk/storage/arm-storage/src/operations/fileServices.ts index 39cc03a0af8e..433b6962190f 100644 --- a/sdk/storage/arm-storage/src/operations/fileServices.ts +++ b/sdk/storage/arm-storage/src/operations/fileServices.ts @@ -110,7 +110,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.FileServiceItems }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion], @@ -132,7 +132,7 @@ const setServicePropertiesOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.FileServiceProperties }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, requestBody: Parameters.parameters8, @@ -157,7 +157,7 @@ const getServicePropertiesOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.FileServiceProperties }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion], diff --git a/sdk/storage/arm-storage/src/operations/fileShares.ts b/sdk/storage/arm-storage/src/operations/fileShares.ts index 9e82ad3e5298..e8623c585d23 100644 --- a/sdk/storage/arm-storage/src/operations/fileShares.ts +++ b/sdk/storage/arm-storage/src/operations/fileShares.ts @@ -315,7 +315,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.FileShareItems }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, queryParameters: [ @@ -345,7 +345,7 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.FileShare }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, requestBody: Parameters.fileShare, @@ -370,7 +370,7 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.FileShare }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, requestBody: Parameters.fileShare, @@ -395,7 +395,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.FileShare }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion, Parameters.expand2], @@ -417,7 +417,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion, Parameters.include1], @@ -438,7 +438,7 @@ const restoreOperationSpec: coreClient.OperationSpec = { responses: { 200: {}, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, requestBody: Parameters.deletedShare, @@ -464,7 +464,7 @@ const leaseOperationSpec: coreClient.OperationSpec = { headersMapper: Mappers.FileSharesLeaseHeaders }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, requestBody: Parameters.parameters9, @@ -492,7 +492,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.FileShareItems }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, queryParameters: [ diff --git a/sdk/storage/arm-storage/src/operations/index.ts b/sdk/storage/arm-storage/src/operations/index.ts index 49920f67864c..57ae999393b5 100644 --- a/sdk/storage/arm-storage/src/operations/index.ts +++ b/sdk/storage/arm-storage/src/operations/index.ts @@ -16,6 +16,7 @@ export * from "./blobInventoryPolicies"; export * from "./privateEndpointConnections"; export * from "./privateLinkResources"; export * from "./objectReplicationPoliciesOperations"; +export * from "./localUsersOperations"; export * from "./encryptionScopes"; export * from "./blobServices"; export * from "./blobContainers"; diff --git a/sdk/storage/arm-storage/src/operations/localUsersOperations.ts b/sdk/storage/arm-storage/src/operations/localUsersOperations.ts new file mode 100644 index 000000000000..a0463780acb0 --- /dev/null +++ b/sdk/storage/arm-storage/src/operations/localUsersOperations.ts @@ -0,0 +1,371 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { LocalUsersOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { StorageManagementClient } from "../storageManagementClient"; +import { + LocalUser, + LocalUsersListOptionalParams, + LocalUsersListResponse, + LocalUsersGetOptionalParams, + LocalUsersGetResponse, + LocalUsersCreateOrUpdateOptionalParams, + LocalUsersCreateOrUpdateResponse, + LocalUsersDeleteOptionalParams, + LocalUsersListKeysOptionalParams, + LocalUsersListKeysResponse, + LocalUsersRegeneratePasswordOptionalParams, + LocalUsersRegeneratePasswordResponse +} from "../models"; + +/// +/** Class containing LocalUsersOperations operations. */ +export class LocalUsersOperationsImpl implements LocalUsersOperations { + private readonly client: StorageManagementClient; + + /** + * Initialize a new instance of the class LocalUsersOperations class. + * @param client Reference to the service client + */ + constructor(client: StorageManagementClient) { + this.client = client; + } + + /** + * List the local users associated with the storage account. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case letters + * only. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + accountName: string, + options?: LocalUsersListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, accountName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, accountName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + accountName: string, + options?: LocalUsersListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, accountName, options); + yield result.value || []; + } + + private async *listPagingAll( + resourceGroupName: string, + accountName: string, + options?: LocalUsersListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + accountName, + options + )) { + yield* page; + } + } + + /** + * List the local users associated with the storage account. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case letters + * only. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + accountName: string, + options?: LocalUsersListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listOperationSpec + ); + } + + /** + * Get the local user of the storage account by username. + * @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 username The name of local user. The username must contain lowercase letters and numbers + * only. It must be unique only within the storage account. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + username: string, + options?: LocalUsersGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, username, options }, + getOperationSpec + ); + } + + /** + * Create or update the properties of a local user associated with the storage account + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case letters + * only. + * @param username The name of local user. The username must contain lowercase letters and numbers + * only. It must be unique only within the storage account. + * @param properties The local user associated with a storage account. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + accountName: string, + username: string, + properties: LocalUser, + options?: LocalUsersCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, username, properties, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Deletes the local user associated with 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 username The name of local user. The username must contain lowercase letters and numbers + * only. It must be unique only within the storage account. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + accountName: string, + username: string, + options?: LocalUsersDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, username, options }, + deleteOperationSpec + ); + } + + /** + * List SSH authorized keys and shared key of the local user. + * @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 username The name of local user. The username must contain lowercase letters and numbers + * only. It must be unique only within the storage account. + * @param options The options parameters. + */ + listKeys( + resourceGroupName: string, + accountName: string, + username: string, + options?: LocalUsersListKeysOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, username, options }, + listKeysOperationSpec + ); + } + + /** + * Regenerate the local user SSH password. + * @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 username The name of local user. The username must contain lowercase letters and numbers + * only. It must be unique only within the storage account. + * @param options The options parameters. + */ + regeneratePassword( + resourceGroupName: string, + accountName: string, + username: string, + options?: LocalUsersRegeneratePasswordOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, username, options }, + regeneratePasswordOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LocalUsers + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName1 + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LocalUser + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName1, + Parameters.username + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.LocalUser + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.properties4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName1, + Parameters.username + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName1, + Parameters.username + ], + headerParameters: [Parameters.accept], + serializer +}; +const listKeysOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/listKeys", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.LocalUserKeys + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName1, + Parameters.username + ], + headerParameters: [Parameters.accept], + serializer +}; +const regeneratePasswordOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/regeneratePassword", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.LocalUserRegeneratePasswordResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName1, + Parameters.username + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/storage/arm-storage/src/operations/queue.ts b/sdk/storage/arm-storage/src/operations/queue.ts index ece30cd378a5..2996dabcd38f 100644 --- a/sdk/storage/arm-storage/src/operations/queue.ts +++ b/sdk/storage/arm-storage/src/operations/queue.ts @@ -257,7 +257,7 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.StorageQueue }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, requestBody: Parameters.queue, @@ -282,7 +282,7 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.StorageQueue }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, requestBody: Parameters.queue, @@ -307,7 +307,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.StorageQueue }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion], @@ -328,7 +328,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { responses: { 204: {}, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion], @@ -351,7 +351,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ListQueueResource }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, queryParameters: [ @@ -376,7 +376,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ListQueueResource }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, queryParameters: [ diff --git a/sdk/storage/arm-storage/src/operations/queueServices.ts b/sdk/storage/arm-storage/src/operations/queueServices.ts index af477f1915b9..21fad00fbc79 100644 --- a/sdk/storage/arm-storage/src/operations/queueServices.ts +++ b/sdk/storage/arm-storage/src/operations/queueServices.ts @@ -110,7 +110,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ListQueueServices }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion], @@ -132,7 +132,7 @@ const setServicePropertiesOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.QueueServiceProperties }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, requestBody: Parameters.parameters10, @@ -157,7 +157,7 @@ const getServicePropertiesOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.QueueServiceProperties }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion], diff --git a/sdk/storage/arm-storage/src/operations/tableOperations.ts b/sdk/storage/arm-storage/src/operations/tableOperations.ts index 66edc7a88233..5dbe7e45f3fa 100644 --- a/sdk/storage/arm-storage/src/operations/tableOperations.ts +++ b/sdk/storage/arm-storage/src/operations/tableOperations.ts @@ -252,7 +252,7 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.Table }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion], @@ -275,7 +275,7 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.Table }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion], @@ -298,7 +298,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.Table }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion], @@ -319,7 +319,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { responses: { 204: {}, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion], @@ -342,7 +342,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ListTableResource }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion], @@ -363,7 +363,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ListTableResource }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion], diff --git a/sdk/storage/arm-storage/src/operations/tableServices.ts b/sdk/storage/arm-storage/src/operations/tableServices.ts index 9173e68de7ad..3e78fb7ff246 100644 --- a/sdk/storage/arm-storage/src/operations/tableServices.ts +++ b/sdk/storage/arm-storage/src/operations/tableServices.ts @@ -110,7 +110,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ListTableServices }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion], @@ -132,7 +132,7 @@ const setServicePropertiesOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.TableServiceProperties }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, requestBody: Parameters.parameters11, @@ -157,7 +157,7 @@ const getServicePropertiesOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.TableServiceProperties }, default: { - bodyMapper: Mappers.CloudErrorAutoGenerated + bodyMapper: Mappers.CloudError } }, queryParameters: [Parameters.apiVersion], diff --git a/sdk/storage/arm-storage/src/operationsInterfaces/index.ts b/sdk/storage/arm-storage/src/operationsInterfaces/index.ts index 49920f67864c..57ae999393b5 100644 --- a/sdk/storage/arm-storage/src/operationsInterfaces/index.ts +++ b/sdk/storage/arm-storage/src/operationsInterfaces/index.ts @@ -16,6 +16,7 @@ export * from "./blobInventoryPolicies"; export * from "./privateEndpointConnections"; export * from "./privateLinkResources"; export * from "./objectReplicationPoliciesOperations"; +export * from "./localUsersOperations"; export * from "./encryptionScopes"; export * from "./blobServices"; export * from "./blobContainers"; diff --git a/sdk/storage/arm-storage/src/operationsInterfaces/localUsersOperations.ts b/sdk/storage/arm-storage/src/operationsInterfaces/localUsersOperations.ts new file mode 100644 index 000000000000..3f09f0c0deb3 --- /dev/null +++ b/sdk/storage/arm-storage/src/operationsInterfaces/localUsersOperations.ts @@ -0,0 +1,128 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + LocalUser, + LocalUsersListOptionalParams, + LocalUsersGetOptionalParams, + LocalUsersGetResponse, + LocalUsersCreateOrUpdateOptionalParams, + LocalUsersCreateOrUpdateResponse, + LocalUsersDeleteOptionalParams, + LocalUsersListKeysOptionalParams, + LocalUsersListKeysResponse, + LocalUsersRegeneratePasswordOptionalParams, + LocalUsersRegeneratePasswordResponse +} from "../models"; + +/// +/** Interface representing a LocalUsersOperations. */ +export interface LocalUsersOperations { + /** + * List the local users associated with the storage account. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case letters + * only. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + accountName: string, + options?: LocalUsersListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get the local user of the storage account by username. + * @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 username The name of local user. The username must contain lowercase letters and numbers + * only. It must be unique only within the storage account. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + username: string, + options?: LocalUsersGetOptionalParams + ): Promise; + /** + * Create or update the properties of a local user associated with the storage account + * @param resourceGroupName The name of the resource group within the user's subscription. The name is + * case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case letters + * only. + * @param username The name of local user. The username must contain lowercase letters and numbers + * only. It must be unique only within the storage account. + * @param properties The local user associated with a storage account. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + accountName: string, + username: string, + properties: LocalUser, + options?: LocalUsersCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the local user associated with 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 username The name of local user. The username must contain lowercase letters and numbers + * only. It must be unique only within the storage account. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + accountName: string, + username: string, + options?: LocalUsersDeleteOptionalParams + ): Promise; + /** + * List SSH authorized keys and shared key of the local user. + * @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 username The name of local user. The username must contain lowercase letters and numbers + * only. It must be unique only within the storage account. + * @param options The options parameters. + */ + listKeys( + resourceGroupName: string, + accountName: string, + username: string, + options?: LocalUsersListKeysOptionalParams + ): Promise; + /** + * Regenerate the local user SSH password. + * @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 username The name of local user. The username must contain lowercase letters and numbers + * only. It must be unique only within the storage account. + * @param options The options parameters. + */ + regeneratePassword( + resourceGroupName: string, + accountName: string, + username: string, + options?: LocalUsersRegeneratePasswordOptionalParams + ): Promise; +} diff --git a/sdk/storage/arm-storage/src/storageManagementClient.ts b/sdk/storage/arm-storage/src/storageManagementClient.ts index e90467746f6a..8634cc7a451e 100644 --- a/sdk/storage/arm-storage/src/storageManagementClient.ts +++ b/sdk/storage/arm-storage/src/storageManagementClient.ts @@ -19,6 +19,7 @@ import { PrivateEndpointConnectionsImpl, PrivateLinkResourcesImpl, ObjectReplicationPoliciesOperationsImpl, + LocalUsersOperationsImpl, EncryptionScopesImpl, BlobServicesImpl, BlobContainersImpl, @@ -40,6 +41,7 @@ import { PrivateEndpointConnections, PrivateLinkResources, ObjectReplicationPoliciesOperations, + LocalUsersOperations, EncryptionScopes, BlobServices, BlobContainers, @@ -84,7 +86,7 @@ export class StorageManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-storage/17.0.0`; + const packageDetails = `azsdk-js-arm-storage/17.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -107,7 +109,7 @@ export class StorageManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-06-01"; + this.apiVersion = options.apiVersion || "2021-08-01"; this.operations = new OperationsImpl(this); this.skus = new SkusImpl(this); this.storageAccounts = new StorageAccountsImpl(this); @@ -120,6 +122,7 @@ export class StorageManagementClient extends coreClient.ServiceClient { this.objectReplicationPoliciesOperations = new ObjectReplicationPoliciesOperationsImpl( this ); + this.localUsersOperations = new LocalUsersOperationsImpl(this); this.encryptionScopes = new EncryptionScopesImpl(this); this.blobServices = new BlobServicesImpl(this); this.blobContainers = new BlobContainersImpl(this); @@ -141,6 +144,7 @@ export class StorageManagementClient extends coreClient.ServiceClient { privateEndpointConnections: PrivateEndpointConnections; privateLinkResources: PrivateLinkResources; objectReplicationPoliciesOperations: ObjectReplicationPoliciesOperations; + localUsersOperations: LocalUsersOperations; encryptionScopes: EncryptionScopes; blobServices: BlobServices; blobContainers: BlobContainers; diff --git a/sdk/storage/arm-storage/test/sampleTest.ts b/sdk/storage/arm-storage/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/storage/arm-storage/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/storage/arm-storage/tsconfig.json b/sdk/storage/arm-storage/tsconfig.json index 6e3251194117..3e6ae96443f3 100644 --- a/sdk/storage/arm-storage/tsconfig.json +++ b/sdk/storage/arm-storage/tsconfig.json @@ -9,11 +9,19 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "declaration": true, "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts", "./test/**/*.ts"], - "exclude": ["node_modules"] -} + "include": [ + "./src/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file