From 7304b52308d21027849460122ec1b6bfc16c46ea Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 13 Jan 2023 10:16:12 +0000 Subject: [PATCH] CodeGen from PR 22154 in Azure/azure-rest-api-specs Merge 45031203cae5a71dec11f2fa7efae2f5a9a837c4 into 891dd18a70057c2fee388573117683e6d0081bda --- sdk/keyvault/arm-keyvault/CHANGELOG.md | 40 ++++-- sdk/keyvault/arm-keyvault/LICENSE | 2 +- sdk/keyvault/arm-keyvault/_meta.json | 8 +- sdk/keyvault/arm-keyvault/package.json | 14 +- .../arm-keyvault/review/arm-keyvault.api.md | 72 ++++++++-- .../src/keyVaultManagementClient.ts | 4 +- sdk/keyvault/arm-keyvault/src/models/index.ts | 134 ++++++++++++++---- .../arm-keyvault/src/models/mappers.ts | 128 ++++++++++++++++- .../arm-keyvault/src/models/parameters.ts | 14 +- .../arm-keyvault/src/operations/keys.ts | 6 +- .../src/operations/managedHsms.ts | 69 +++++++-- .../mhsmPrivateEndpointConnections.ts | 1 - .../arm-keyvault/src/operations/operations.ts | 1 - .../operations/privateEndpointConnections.ts | 1 - .../arm-keyvault/src/operations/secrets.ts | 5 +- .../arm-keyvault/src/operations/vaults.ts | 24 ++-- .../src/operationsInterfaces/keys.ts | 4 +- .../src/operationsInterfaces/managedHsms.ts | 24 +++- .../src/operationsInterfaces/secrets.ts | 4 +- .../src/operationsInterfaces/vaults.ts | 3 + sdk/keyvault/arm-keyvault/src/pagingHelper.ts | 8 +- sdk/keyvault/arm-keyvault/test/sampleTest.ts | 43 ++++++ sdk/keyvault/arm-keyvault/tsconfig.json | 10 +- 23 files changed, 496 insertions(+), 123 deletions(-) create mode 100644 sdk/keyvault/arm-keyvault/test/sampleTest.ts diff --git a/sdk/keyvault/arm-keyvault/CHANGELOG.md b/sdk/keyvault/arm-keyvault/CHANGELOG.md index b6b19d11ad9a..6879039d0067 100644 --- a/sdk/keyvault/arm-keyvault/CHANGELOG.md +++ b/sdk/keyvault/arm-keyvault/CHANGELOG.md @@ -1,25 +1,23 @@ # Release History - -## 2.1.0-beta.3 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 2.1.0-beta.2 (2022-11-28) + +## 3.0.0-beta.1 (2023-01-13) **Features** + - Added operation ManagedHsms.checkMhsmNameAvailability - Added Interface Action + - Added Interface CheckMhsmNameAvailabilityParameters + - Added Interface CheckMhsmNameAvailabilityResult - Added Interface Key - Added Interface KeyReleasePolicy - Added Interface KeyRotationPolicyAttributes - Added Interface LifetimeAction - Added Interface ManagedHsm + - Added Interface ManagedHsmsCheckMhsmNameAvailabilityOptionalParams + - Added Interface ManagedHsmsCreateOrUpdateHeaders + - Added Interface ManagedHsmsDeleteHeaders + - Added Interface ManagedHSMSecurityDomainProperties + - Added Interface ManagedHsmsPurgeDeletedHeaders - Added Interface ManagedHsmsUpdateHeaders - Added Interface MhsmPrivateEndpointConnection - Added Interface MhsmPrivateLinkResource @@ -29,16 +27,34 @@ - Added Interface Secret - Added Interface SecretAttributes - Added Interface Trigger + - Added Type Alias ActivationStatus - Added Type Alias KeyRotationPolicyActionType + - Added Type Alias ManagedHsmsCheckMhsmNameAvailabilityResponse + - Added Type Alias ManagedHsmsPurgeDeletedResponse + - Added Type Alias ResourceManagerApiVersions - Interface KeyProperties has a new optional parameter releasePolicy - Interface KeyProperties has a new optional parameter rotationPolicy + - Interface ManagedHsmProperties has a new optional parameter securityDomainProperties - Interface MhsmPrivateEndpointConnectionItem has a new optional parameter etag - Interface MhsmPrivateEndpointConnectionItem has a new optional parameter id + - Added Enum KnownActivationStatus - Enum KnownJsonWebKeyOperation has a new value Release - Enum KnownKeyPermissions has a new value Getrotationpolicy - Enum KnownKeyPermissions has a new value Release - Enum KnownKeyPermissions has a new value Rotate - Enum KnownKeyPermissions has a new value Setrotationpolicy + - Added function getContinuationToken + +**Breaking Changes** + + - Operation Vaults.list has a new signature + - Interface ManagedHsmsListByResourceGroupNextOptionalParams no longer has parameter top + - Interface ManagedHsmsListBySubscriptionNextOptionalParams no longer has parameter top + - Interface MhsmPrivateEndpointConnectionsDeleteHeaders no longer has parameter retryAfter + - Interface SecretsListNextOptionalParams no longer has parameter top + - Interface VaultsListByResourceGroupNextOptionalParams no longer has parameter top + - Interface VaultsListBySubscriptionNextOptionalParams no longer has parameter top + - Interface VaultsListNextOptionalParams no longer has parameter top ## 2.0.0 (2022-01-17) diff --git a/sdk/keyvault/arm-keyvault/LICENSE b/sdk/keyvault/arm-keyvault/LICENSE index 5d1d36e0af80..3a1d9b6f24f7 100644 --- a/sdk/keyvault/arm-keyvault/LICENSE +++ b/sdk/keyvault/arm-keyvault/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2023 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/keyvault/arm-keyvault/_meta.json b/sdk/keyvault/arm-keyvault/_meta.json index 181c4273f370..8191f606d777 100644 --- a/sdk/keyvault/arm-keyvault/_meta.json +++ b/sdk/keyvault/arm-keyvault/_meta.json @@ -1,8 +1,8 @@ { - "commit": "1fefe3f5cee88319b17c08a2dbf95e1e983a9f8c", + "commit": "db384c8b14627da82ec008f35abe4aa7c10a2792", "readme": "specification/keyvault/resource-manager/readme.md", - "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\keyvault\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221108.1 --generate-sample=true", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/keyvault/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.5", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.6.0", + "use": "@autorest/typescript@6.0.0-rc.5" } \ No newline at end of file diff --git a/sdk/keyvault/arm-keyvault/package.json b/sdk/keyvault/arm-keyvault/package.json index 9530c08e12e3..d47fd091e811 100644 --- a/sdk/keyvault/arm-keyvault/package.json +++ b/sdk/keyvault/arm-keyvault/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for KeyVaultManagementClient.", - "version": "2.1.0-beta.3", + "version": "3.0.0-beta.1", "engines": { "node": ">=14.0.0" }, @@ -110,13 +110,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-keyvault?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/keyvault/arm-keyvault/review/arm-keyvault.api.md b/sdk/keyvault/arm-keyvault/review/arm-keyvault.api.md index 92386afbe3c1..87ae3febb73a 100644 --- a/sdk/keyvault/arm-keyvault/review/arm-keyvault.api.md +++ b/sdk/keyvault/arm-keyvault/review/arm-keyvault.api.md @@ -29,6 +29,9 @@ export interface Action { // @public export type ActionsRequired = string; +// @public +export type ActivationStatus = string; + // @public export interface Attributes { readonly created?: Date; @@ -41,6 +44,18 @@ export interface Attributes { // @public export type CertificatePermissions = string; +// @public +export interface CheckMhsmNameAvailabilityParameters { + name: string; +} + +// @public +export interface CheckMhsmNameAvailabilityResult { + readonly message?: string; + readonly nameAvailable?: boolean; + readonly reason?: Reason; +} + // @public export interface CheckNameAvailabilityResult { readonly message?: string; @@ -322,6 +337,14 @@ export enum KnownActionsRequired { None = "None" } +// @public +export enum KnownActivationStatus { + Active = "Active", + Failed = "Failed", + NotActivated = "NotActivated", + Unknown = "Unknown" +} + // @public export enum KnownCertificatePermissions { All = "all", @@ -551,6 +574,7 @@ export interface ManagedHsmProperties { readonly provisioningState?: ProvisioningState; publicNetworkAccess?: PublicNetworkAccess; readonly scheduledPurgeDate?: Date; + readonly securityDomainProperties?: ManagedHSMSecurityDomainProperties; softDeleteRetentionInDays?: number; readonly statusMessage?: string; tenantId?: string; @@ -575,10 +599,11 @@ export interface ManagedHsms { beginCreateOrUpdateAndWait(resourceGroupName: string, name: string, parameters: ManagedHsm, options?: ManagedHsmsCreateOrUpdateOptionalParams): Promise; beginDelete(resourceGroupName: string, name: string, options?: ManagedHsmsDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, name: string, options?: ManagedHsmsDeleteOptionalParams): Promise; - beginPurgeDeleted(name: string, location: string, options?: ManagedHsmsPurgeDeletedOptionalParams): Promise, void>>; - beginPurgeDeletedAndWait(name: string, location: string, options?: ManagedHsmsPurgeDeletedOptionalParams): Promise; + beginPurgeDeleted(name: string, location: string, options?: ManagedHsmsPurgeDeletedOptionalParams): Promise, ManagedHsmsPurgeDeletedResponse>>; + beginPurgeDeletedAndWait(name: string, location: string, options?: ManagedHsmsPurgeDeletedOptionalParams): Promise; beginUpdate(resourceGroupName: string, name: string, parameters: ManagedHsm, options?: ManagedHsmsUpdateOptionalParams): Promise, ManagedHsmsUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, name: string, parameters: ManagedHsm, options?: ManagedHsmsUpdateOptionalParams): Promise; + checkMhsmNameAvailability(mhsmName: CheckMhsmNameAvailabilityParameters, options?: ManagedHsmsCheckMhsmNameAvailabilityOptionalParams): Promise; get(resourceGroupName: string, name: string, options?: ManagedHsmsGetOptionalParams): Promise; getDeleted(name: string, location: string, options?: ManagedHsmsGetDeletedOptionalParams): Promise; listByResourceGroup(resourceGroupName: string, options?: ManagedHsmsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; @@ -586,6 +611,18 @@ export interface ManagedHsms { listDeleted(options?: ManagedHsmsListDeletedOptionalParams): PagedAsyncIterableIterator; } +// @public +export interface ManagedHsmsCheckMhsmNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagedHsmsCheckMhsmNameAvailabilityResponse = CheckMhsmNameAvailabilityResult; + +// @public +export interface ManagedHsmsCreateOrUpdateHeaders { + location?: string; +} + // @public export interface ManagedHsmsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -595,12 +632,23 @@ export interface ManagedHsmsCreateOrUpdateOptionalParams extends coreClient.Oper // @public export type ManagedHsmsCreateOrUpdateResponse = ManagedHsm; +// @public +export interface ManagedHsmsDeleteHeaders { + location?: string; +} + // @public export interface ManagedHsmsDeleteOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; updateIntervalInMs?: number; } +// @public +export interface ManagedHSMSecurityDomainProperties { + readonly activationStatus?: ActivationStatus; + readonly activationStatusMessage?: string; +} + // @public export interface ManagedHsmsGetDeletedOptionalParams extends coreClient.OperationOptions { } @@ -629,7 +677,6 @@ export type ManagedHsmSkuName = "Standard_B1" | "Custom_B32"; // @public export interface ManagedHsmsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { - top?: number; } // @public @@ -645,7 +692,6 @@ export type ManagedHsmsListByResourceGroupResponse = ManagedHsmListResult; // @public export interface ManagedHsmsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { - top?: number; } // @public @@ -673,12 +719,20 @@ export interface ManagedHsmsListDeletedOptionalParams extends coreClient.Operati // @public export type ManagedHsmsListDeletedResponse = DeletedManagedHsmListResult; +// @public +export interface ManagedHsmsPurgeDeletedHeaders { + location?: string; +} + // @public export interface ManagedHsmsPurgeDeletedOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; updateIntervalInMs?: number; } +// @public +export type ManagedHsmsPurgeDeletedResponse = ManagedHsmsPurgeDeletedHeaders; + // @public export interface ManagedHsmsUpdateHeaders { location?: string; @@ -755,7 +809,6 @@ export interface MhsmPrivateEndpointConnections { // @public export interface MhsmPrivateEndpointConnectionsDeleteHeaders { location?: string; - retryAfter?: number; } // @public @@ -1057,6 +1110,9 @@ export interface ResourceListResult { value?: Resource[]; } +// @public +export type ResourceManagerApiVersions = "2015-11-01" | "2022-02-01-preview"; + // @public (undocumented) export interface RotationPolicy { attributes?: KeyRotationPolicyAttributes; @@ -1137,7 +1193,6 @@ export type SecretsGetResponse = Secret; // @public export interface SecretsListNextOptionalParams extends coreClient.OperationOptions { - top?: number; } // @public @@ -1302,7 +1357,7 @@ export interface Vaults { delete(resourceGroupName: string, vaultName: string, options?: VaultsDeleteOptionalParams): Promise; get(resourceGroupName: string, vaultName: string, options?: VaultsGetOptionalParams): Promise; getDeleted(vaultName: string, location: string, options?: VaultsGetDeletedOptionalParams): Promise; - list(options?: VaultsListOptionalParams): PagedAsyncIterableIterator; + list(apiVersion: ResourceManagerApiVersions, options?: VaultsListOptionalParams): PagedAsyncIterableIterator; listByResourceGroup(resourceGroupName: string, options?: VaultsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscription(options?: VaultsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; listDeleted(options?: VaultsListDeletedOptionalParams): PagedAsyncIterableIterator; @@ -1346,7 +1401,6 @@ export type VaultsGetResponse = Vault; // @public export interface VaultsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { - top?: number; } // @public @@ -1362,7 +1416,6 @@ export type VaultsListByResourceGroupResponse = VaultListResult; // @public export interface VaultsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { - top?: number; } // @public @@ -1392,7 +1445,6 @@ export type VaultsListDeletedResponse = DeletedVaultListResult; // @public export interface VaultsListNextOptionalParams extends coreClient.OperationOptions { - top?: number; } // @public diff --git a/sdk/keyvault/arm-keyvault/src/keyVaultManagementClient.ts b/sdk/keyvault/arm-keyvault/src/keyVaultManagementClient.ts index 27bbe563e0a3..e0c9a2d1dab7 100644 --- a/sdk/keyvault/arm-keyvault/src/keyVaultManagementClient.ts +++ b/sdk/keyvault/arm-keyvault/src/keyVaultManagementClient.ts @@ -71,7 +71,7 @@ export class KeyVaultManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-keyvault/2.1.0-beta.3`; + const packageDetails = `azsdk-js-arm-keyvault/3.0.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -124,7 +124,7 @@ export class KeyVaultManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-11-01-preview"; + this.apiVersion = options.apiVersion || "2022-02-01-preview"; this.keys = new KeysImpl(this); this.vaults = new VaultsImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); diff --git a/sdk/keyvault/arm-keyvault/src/models/index.ts b/sdk/keyvault/arm-keyvault/src/models/index.ts index ace70e9079e7..aea1741db048 100644 --- a/sdk/keyvault/arm-keyvault/src/models/index.ts +++ b/sdk/keyvault/arm-keyvault/src/models/index.ts @@ -204,7 +204,7 @@ export interface VaultProperties { enableSoftDelete?: boolean; /** softDelete data retention days. It accepts >=7 and <=90. */ softDeleteRetentionInDays?: number; - /** Property that controls how data actions are authorized. When true, the key vault will use Role Based Access Control (RBAC) for authorization of data actions, and the access policies specified in vault properties will be ignored (warning: this is a preview feature). When false, the key vault will use the access policies specified in vault properties, and any policy stored on Azure Resource Manager will be ignored. If null or not specified, the vault is created with the default value of false. Note that management actions are always authorized with RBAC. */ + /** Property that controls how data actions are authorized. When true, the key vault will use Role Based Access Control (RBAC) for authorization of data actions, and the access policies specified in vault properties will be ignored. When false, the key vault will use the access policies specified in vault properties, and any policy stored on Azure Resource Manager will be ignored. If null or not specified, the vault is created with the default value of false. Note that management actions are always authorized with RBAC. */ enableRbacAuthorization?: boolean; /** The vault's create mode to indicate whether the vault need to be recovered or not. */ createMode?: CreateMode; @@ -384,7 +384,7 @@ export interface VaultPatchProperties { enabledForTemplateDeployment?: boolean; /** Property to specify whether the 'soft delete' functionality is enabled for this key vault. Once set to true, it cannot be reverted to false. */ enableSoftDelete?: boolean; - /** Property that controls how data actions are authorized. When true, the key vault will use Role Based Access Control (RBAC) for authorization of data actions, and the access policies specified in vault properties will be ignored (warning: this is a preview feature). When false, the key vault will use the access policies specified in vault properties, and any policy stored on Azure Resource Manager will be ignored. If null or not specified, the value of this property will not change. */ + /** Property that controls how data actions are authorized. When true, the key vault will use Role Based Access Control (RBAC) for authorization of data actions, and the access policies specified in vault properties will be ignored. When false, the key vault will use the access policies specified in vault properties, and any policy stored on Azure Resource Manager will be ignored. If null or not specified, the value of this property will not change. */ enableRbacAuthorization?: boolean; /** softDelete data retention days. It accepts >=7 and <=90. */ softDeleteRetentionInDays?: number; @@ -593,6 +593,11 @@ export interface ManagedHsmProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly scheduledPurgeDate?: Date; + /** + * Managed HSM security domain properties. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly securityDomainProperties?: ManagedHSMSecurityDomainProperties; } /** A set of rules governing the network accessibility of a managed hsm pool. */ @@ -652,6 +657,20 @@ export interface MhsmPrivateLinkServiceConnectionState { actionsRequired?: ActionsRequired; } +/** The security domain properties of the managed hsm. */ +export interface ManagedHSMSecurityDomainProperties { + /** + * Activation Status + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly activationStatus?: ActivationStatus; + /** + * Activation Status Message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly activationStatusMessage?: string; +} + /** Managed HSM resource */ export interface ManagedHsmResource { /** @@ -802,6 +821,31 @@ export interface MhsmPrivateLinkResourceListResult { value?: MhsmPrivateLinkResource[]; } +/** The parameters used to check the availability of the managed hsm name. */ +export interface CheckMhsmNameAvailabilityParameters { + /** The managed hsm name. */ + name: string; +} + +/** The CheckMhsmNameAvailability operation response. */ +export interface CheckMhsmNameAvailabilityResult { + /** + * A boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nameAvailable?: boolean; + /** + * The reason that a managed hsm name could not be used. The reason element is only returned if NameAvailable is false. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly reason?: Reason; + /** + * An error message explaining the Reason value in more detail. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; +} + /** Result of the request to list Storage operations. It contains a list of operations and a URL link to get the next set of results. */ export interface OperationListResult { /** List of Storage operations supported by the Storage resource provider. */ @@ -1078,12 +1122,30 @@ export interface PrivateEndpointConnectionsDeleteHeaders { location?: string; } +/** Defines headers for ManagedHsms_createOrUpdate operation. */ +export interface ManagedHsmsCreateOrUpdateHeaders { + /** The URI to poll for completion status. */ + location?: string; +} + /** Defines headers for ManagedHsms_update operation. */ export interface ManagedHsmsUpdateHeaders { /** The URI to poll for completion status. */ location?: string; } +/** Defines headers for ManagedHsms_delete operation. */ +export interface ManagedHsmsDeleteHeaders { + /** The URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for ManagedHsms_purgeDeleted operation. */ +export interface ManagedHsmsPurgeDeletedHeaders { + /** The URI to poll for completion status. */ + location?: string; +} + /** Defines headers for MhsmPrivateEndpointConnections_put operation. */ export interface MhsmPrivateEndpointConnectionsPutHeaders { /** (specified only if operation does not finish synchronously) The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation. */ @@ -1094,8 +1156,6 @@ export interface MhsmPrivateEndpointConnectionsPutHeaders { /** Defines headers for MhsmPrivateEndpointConnections_delete operation. */ export interface MhsmPrivateEndpointConnectionsDeleteHeaders { - /** The recommended number of seconds to wait before calling the URI specified in the location header. */ - retryAfter?: number; /** The URI to poll for completion status. */ location?: string; } @@ -1658,6 +1718,30 @@ export enum KnownPublicNetworkAccess { */ export type PublicNetworkAccess = string; +/** Known values of {@link ActivationStatus} that the service accepts. */ +export enum KnownActivationStatus { + /** The managed HSM Pool is active. */ + Active = "Active", + /** The managed HSM Pool is not yet activated. */ + NotActivated = "NotActivated", + /** An unknown error occurred while activating managed hsm. */ + Unknown = "Unknown", + /** Failed to activate managed hsm. */ + Failed = "Failed" +} + +/** + * Defines values for ActivationStatus. \ + * {@link KnownActivationStatus} can be used interchangeably with ActivationStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Active**: The managed HSM Pool is active. \ + * **NotActivated**: The managed HSM Pool is not yet activated. \ + * **Unknown**: An unknown error occurred while activating managed hsm. \ + * **Failed**: Failed to activate managed hsm. + */ +export type ActivationStatus = string; + /** Known values of {@link ManagedHsmSkuFamily} that the service accepts. */ export enum KnownManagedHsmSkuFamily { /** B */ @@ -1680,6 +1764,8 @@ export type SkuName = "standard" | "premium"; export type CreateMode = "recover" | "default"; /** Defines values for AccessPolicyUpdateKind. */ export type AccessPolicyUpdateKind = "add" | "replace" | "remove"; +/** Defines values for ResourceManagerApiVersions. */ +export type ResourceManagerApiVersions = "2015-11-01" | "2022-02-01-preview"; /** Defines values for Reason. */ export type Reason = "AccountNameInvalid" | "AlreadyExists"; /** Defines values for ManagedHsmSkuName. */ @@ -1829,20 +1915,14 @@ export type VaultsCheckNameAvailabilityResponse = CheckNameAvailabilityResult; /** Optional parameters. */ export interface VaultsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions { - /** Maximum number of results to return. */ - top?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByResourceGroupNext operation. */ export type VaultsListByResourceGroupNextResponse = VaultListResult; /** Optional parameters. */ export interface VaultsListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions { - /** Maximum number of results to return. */ - top?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listBySubscriptionNext operation. */ export type VaultsListBySubscriptionNextResponse = VaultListResult; @@ -1856,10 +1936,7 @@ export type VaultsListDeletedNextResponse = DeletedVaultListResult; /** Optional parameters. */ export interface VaultsListNextOptionalParams - extends coreClient.OperationOptions { - /** Maximum number of results to return. */ - top?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type VaultsListNextResponse = ResourceListResult; @@ -1995,22 +2072,26 @@ export interface ManagedHsmsPurgeDeletedOptionalParams resumeFrom?: string; } +/** Contains response data for the purgeDeleted operation. */ +export type ManagedHsmsPurgeDeletedResponse = ManagedHsmsPurgeDeletedHeaders; + +/** Optional parameters. */ +export interface ManagedHsmsCheckMhsmNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkMhsmNameAvailability operation. */ +export type ManagedHsmsCheckMhsmNameAvailabilityResponse = CheckMhsmNameAvailabilityResult; + /** Optional parameters. */ export interface ManagedHsmsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions { - /** Maximum number of results to return. */ - top?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByResourceGroupNext operation. */ export type ManagedHsmsListByResourceGroupNextResponse = ManagedHsmListResult; /** Optional parameters. */ export interface ManagedHsmsListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions { - /** Maximum number of results to return. */ - top?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listBySubscriptionNext operation. */ export type ManagedHsmsListBySubscriptionNextResponse = ManagedHsmListResult; @@ -2115,10 +2196,7 @@ export type SecretsListResponse = SecretListResult; /** Optional parameters. */ export interface SecretsListNextOptionalParams - extends coreClient.OperationOptions { - /** Maximum number of results to return. */ - top?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type SecretsListNextResponse = SecretListResult; diff --git a/sdk/keyvault/arm-keyvault/src/models/mappers.ts b/sdk/keyvault/arm-keyvault/src/models/mappers.ts index f3d6f9cd9ec4..db92a349963f 100644 --- a/sdk/keyvault/arm-keyvault/src/models/mappers.ts +++ b/sdk/keyvault/arm-keyvault/src/models/mappers.ts @@ -1512,6 +1512,13 @@ export const ManagedHsmProperties: coreClient.CompositeMapper = { type: { name: "DateTime" } + }, + securityDomainProperties: { + serializedName: "securityDomainProperties", + type: { + name: "Composite", + className: "ManagedHSMSecurityDomainProperties" + } } } } @@ -1678,6 +1685,29 @@ export const MhsmPrivateLinkServiceConnectionState: coreClient.CompositeMapper = } }; +export const ManagedHSMSecurityDomainProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedHSMSecurityDomainProperties", + modelProperties: { + activationStatus: { + serializedName: "activationStatus", + readOnly: true, + type: { + name: "String" + } + }, + activationStatusMessage: { + serializedName: "activationStatusMessage", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const ManagedHsmResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1996,6 +2026,53 @@ export const MhsmPrivateLinkResourceListResult: coreClient.CompositeMapper = { } }; +export const CheckMhsmNameAvailabilityParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckMhsmNameAvailabilityParameters", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const CheckMhsmNameAvailabilityResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckMhsmNameAvailabilityResult", + modelProperties: { + nameAvailable: { + serializedName: "nameAvailable", + readOnly: true, + type: { + name: "Boolean" + } + }, + reason: { + serializedName: "reason", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["AccountNameInvalid", "AlreadyExists"] + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2771,6 +2848,21 @@ export const PrivateEndpointConnectionsDeleteHeaders: coreClient.CompositeMapper } }; +export const ManagedHsmsCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedHsmsCreateOrUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + export const ManagedHsmsUpdateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2786,6 +2878,36 @@ export const ManagedHsmsUpdateHeaders: coreClient.CompositeMapper = { } }; +export const ManagedHsmsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedHsmsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ManagedHsmsPurgeDeletedHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedHsmsPurgeDeletedHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + export const MhsmPrivateEndpointConnectionsPutHeaders: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2812,12 +2934,6 @@ export const MhsmPrivateEndpointConnectionsDeleteHeaders: coreClient.CompositeMa name: "Composite", className: "MhsmPrivateEndpointConnectionsDeleteHeaders", modelProperties: { - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number" - } - }, location: { serializedName: "location", type: { diff --git a/sdk/keyvault/arm-keyvault/src/models/parameters.ts b/sdk/keyvault/arm-keyvault/src/models/parameters.ts index 98abfbf521ff..97dbbbefc4a8 100644 --- a/sdk/keyvault/arm-keyvault/src/models/parameters.ts +++ b/sdk/keyvault/arm-keyvault/src/models/parameters.ts @@ -19,6 +19,7 @@ import { VaultCheckNameAvailabilityParameters as VaultCheckNameAvailabilityParametersMapper, PrivateEndpointConnection as PrivateEndpointConnectionMapper, ManagedHsm as ManagedHsmMapper, + CheckMhsmNameAvailabilityParameters as CheckMhsmNameAvailabilityParametersMapper, MhsmPrivateEndpointConnection as MhsmPrivateEndpointConnectionMapper, SecretCreateOrUpdateParameters as SecretCreateOrUpdateParametersMapper, SecretPatchParameters as SecretPatchParametersMapper @@ -118,7 +119,7 @@ export const keyName: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-11-01-preview", + defaultValue: "2022-02-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -227,11 +228,11 @@ export const filter: OperationQueryParameter = { export const apiVersion1: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2015-11-01", - isConstant: true, serializedName: "api-version", + required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["2015-11-01", "2022-02-01-preview"] } } }; @@ -273,6 +274,11 @@ export const name: OperationURLParameter = { } }; +export const mhsmName: OperationParameter = { + parameterPath: "mhsmName", + mapper: CheckMhsmNameAvailabilityParametersMapper +}; + export const properties1: OperationParameter = { parameterPath: "properties", mapper: MhsmPrivateEndpointConnectionMapper diff --git a/sdk/keyvault/arm-keyvault/src/operations/keys.ts b/sdk/keyvault/arm-keyvault/src/operations/keys.ts index 48f203fa737e..e9be9f3f3079 100644 --- a/sdk/keyvault/arm-keyvault/src/operations/keys.ts +++ b/sdk/keyvault/arm-keyvault/src/operations/keys.ts @@ -220,7 +220,9 @@ export class KeysImpl implements Keys { * versions, and does not update existing keys. * @param resourceGroupName The name of the resource group which contains the specified key vault. * @param vaultName The name of the key vault which contains the key to be created. - * @param keyName The name of the key to be created. + * @param keyName The name of the key to be created. The value you provide may be copied globally for + * the purpose of running the service. The value provided should not include personally identifiable or + * sensitive information. * @param parameters The parameters used to create the specified key. * @param options The options parameters. */ @@ -484,7 +486,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -506,7 +507,6 @@ const listVersionsNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/keyvault/arm-keyvault/src/operations/managedHsms.ts b/sdk/keyvault/arm-keyvault/src/operations/managedHsms.ts index 8c80bb16ca8c..1cb1132d3dac 100644 --- a/sdk/keyvault/arm-keyvault/src/operations/managedHsms.ts +++ b/sdk/keyvault/arm-keyvault/src/operations/managedHsms.ts @@ -37,6 +37,10 @@ import { ManagedHsmsGetDeletedOptionalParams, ManagedHsmsGetDeletedResponse, ManagedHsmsPurgeDeletedOptionalParams, + ManagedHsmsPurgeDeletedResponse, + CheckMhsmNameAvailabilityParameters, + ManagedHsmsCheckMhsmNameAvailabilityOptionalParams, + ManagedHsmsCheckMhsmNameAvailabilityResponse, ManagedHsmsListByResourceGroupNextResponse, ManagedHsmsListBySubscriptionNextResponse, ManagedHsmsListDeletedNextResponse @@ -581,11 +585,16 @@ export class ManagedHsmsImpl implements ManagedHsms { name: string, location: string, options?: ManagedHsmsPurgeDeletedOptionalParams - ): Promise, void>> { + ): Promise< + PollerLike< + PollOperationState, + ManagedHsmsPurgeDeletedResponse + > + > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec - ): Promise => { + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperation = async ( @@ -644,11 +653,26 @@ export class ManagedHsmsImpl implements ManagedHsms { name: string, location: string, options?: ManagedHsmsPurgeDeletedOptionalParams - ): Promise { + ): Promise { const poller = await this.beginPurgeDeleted(name, location, options); return poller.pollUntilDone(); } + /** + * Checks that the managed hsm name is valid and is not already in use. + * @param mhsmName The name of the managed hsm. + * @param options The options parameters. + */ + checkMhsmNameAvailability( + mhsmName: CheckMhsmNameAvailabilityParameters, + options?: ManagedHsmsCheckMhsmNameAvailabilityOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { mhsmName, options }, + checkMhsmNameAvailabilityOperationSpec + ); + } + /** * ListByResourceGroupNext * @param resourceGroupName Name of the resource group that contains the managed HSM pool. @@ -796,7 +820,6 @@ const getOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.ManagedHsm }, - 202: {}, 204: {}, default: { bodyMapper: Mappers.ManagedHsmError @@ -894,10 +917,18 @@ const purgeDeletedOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedManagedHSMs/{name}/purge", httpMethod: "POST", responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, + 200: { + headersMapper: Mappers.ManagedHsmsPurgeDeletedHeaders + }, + 201: { + headersMapper: Mappers.ManagedHsmsPurgeDeletedHeaders + }, + 202: { + headersMapper: Mappers.ManagedHsmsPurgeDeletedHeaders + }, + 204: { + headersMapper: Mappers.ManagedHsmsPurgeDeletedHeaders + }, default: { bodyMapper: Mappers.ManagedHsmError } @@ -912,6 +943,25 @@ const purgeDeletedOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const checkMhsmNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkMhsmNameAvailability", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.CheckMhsmNameAvailabilityResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.mhsmName, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", @@ -923,7 +973,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ManagedHsmError } }, - queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -944,7 +993,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ManagedHsmError } }, - queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -964,7 +1012,6 @@ const listDeletedNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ManagedHsmError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/keyvault/arm-keyvault/src/operations/mhsmPrivateEndpointConnections.ts b/sdk/keyvault/arm-keyvault/src/operations/mhsmPrivateEndpointConnections.ts index 7310a38ac41a..1cfa8c06acfa 100644 --- a/sdk/keyvault/arm-keyvault/src/operations/mhsmPrivateEndpointConnections.ts +++ b/sdk/keyvault/arm-keyvault/src/operations/mhsmPrivateEndpointConnections.ts @@ -416,7 +416,6 @@ const listByResourceNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ManagedHsmError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/keyvault/arm-keyvault/src/operations/operations.ts b/sdk/keyvault/arm-keyvault/src/operations/operations.ts index 6ce75a037500..653bd71bbc8a 100644 --- a/sdk/keyvault/arm-keyvault/src/operations/operations.ts +++ b/sdk/keyvault/arm-keyvault/src/operations/operations.ts @@ -143,7 +143,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], serializer diff --git a/sdk/keyvault/arm-keyvault/src/operations/privateEndpointConnections.ts b/sdk/keyvault/arm-keyvault/src/operations/privateEndpointConnections.ts index a9eb66c18fb8..b8ca073a5fdd 100644 --- a/sdk/keyvault/arm-keyvault/src/operations/privateEndpointConnections.ts +++ b/sdk/keyvault/arm-keyvault/src/operations/privateEndpointConnections.ts @@ -425,7 +425,6 @@ const listByResourceNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/keyvault/arm-keyvault/src/operations/secrets.ts b/sdk/keyvault/arm-keyvault/src/operations/secrets.ts index 86c6f42069e1..44fb72457fc0 100644 --- a/sdk/keyvault/arm-keyvault/src/operations/secrets.ts +++ b/sdk/keyvault/arm-keyvault/src/operations/secrets.ts @@ -126,7 +126,9 @@ export class SecretsImpl implements Secrets { * with vault secrets. * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName Name of the vault - * @param secretName Name of the secret + * @param secretName Name of the secret. The value you provide may be copied globally for the purpose + * of running the service. The value provided should not include personally identifiable or sensitive + * information. * @param parameters Parameters to create or update the secret * @param options The options parameters. */ @@ -338,7 +340,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/keyvault/arm-keyvault/src/operations/vaults.ts b/sdk/keyvault/arm-keyvault/src/operations/vaults.ts index cb65a145795e..e25e20888cc1 100644 --- a/sdk/keyvault/arm-keyvault/src/operations/vaults.ts +++ b/sdk/keyvault/arm-keyvault/src/operations/vaults.ts @@ -29,6 +29,7 @@ import { VaultsListDeletedResponse, Resource, VaultsListNextOptionalParams, + ResourceManagerApiVersions, VaultsListOptionalParams, VaultsListResponse, VaultCreateOrUpdateParameters, @@ -249,12 +250,14 @@ export class VaultsImpl implements Vaults { /** * The List operation gets information about the vaults associated with the subscription. + * @param apiVersion Azure Resource Manager Api Version. * @param options The options parameters. */ public list( + apiVersion: ResourceManagerApiVersions, options?: VaultsListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(apiVersion, options); return { next() { return iter.next(); @@ -266,19 +269,20 @@ export class VaultsImpl implements Vaults { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listPagingPage(options, settings); + return this.listPagingPage(apiVersion, options, settings); } }; } private async *listPagingPage( + apiVersion: ResourceManagerApiVersions, options?: VaultsListOptionalParams, settings?: PageSettings ): AsyncIterableIterator { let result: VaultsListResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._list(options); + result = await this._list(apiVersion, options); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); @@ -294,9 +298,10 @@ export class VaultsImpl implements Vaults { } private async *listPagingAll( + apiVersion: ResourceManagerApiVersions, options?: VaultsListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage(apiVersion, options)) { yield* page; } } @@ -606,12 +611,17 @@ export class VaultsImpl implements Vaults { /** * The List operation gets information about the vaults associated with the subscription. + * @param apiVersion Azure Resource Manager Api Version. * @param options The options parameters. */ private _list( + apiVersion: ResourceManagerApiVersions, options?: VaultsListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { apiVersion, options }, + listOperationSpec + ); } /** @@ -970,7 +980,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -991,7 +1000,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -1011,7 +1019,6 @@ const listDeletedNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -1031,7 +1038,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.top, Parameters.filter, Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/keyvault/arm-keyvault/src/operationsInterfaces/keys.ts b/sdk/keyvault/arm-keyvault/src/operationsInterfaces/keys.ts index 13d909c3b9bb..9a0328500286 100644 --- a/sdk/keyvault/arm-keyvault/src/operationsInterfaces/keys.ts +++ b/sdk/keyvault/arm-keyvault/src/operationsInterfaces/keys.ts @@ -53,7 +53,9 @@ export interface Keys { * versions, and does not update existing keys. * @param resourceGroupName The name of the resource group which contains the specified key vault. * @param vaultName The name of the key vault which contains the key to be created. - * @param keyName The name of the key to be created. + * @param keyName The name of the key to be created. The value you provide may be copied globally for + * the purpose of running the service. The value provided should not include personally identifiable or + * sensitive information. * @param parameters The parameters used to create the specified key. * @param options The options parameters. */ diff --git a/sdk/keyvault/arm-keyvault/src/operationsInterfaces/managedHsms.ts b/sdk/keyvault/arm-keyvault/src/operationsInterfaces/managedHsms.ts index 2d82c3e245a6..121c8f760dec 100644 --- a/sdk/keyvault/arm-keyvault/src/operationsInterfaces/managedHsms.ts +++ b/sdk/keyvault/arm-keyvault/src/operationsInterfaces/managedHsms.ts @@ -23,7 +23,11 @@ import { ManagedHsmsGetResponse, ManagedHsmsGetDeletedOptionalParams, ManagedHsmsGetDeletedResponse, - ManagedHsmsPurgeDeletedOptionalParams + ManagedHsmsPurgeDeletedOptionalParams, + ManagedHsmsPurgeDeletedResponse, + CheckMhsmNameAvailabilityParameters, + ManagedHsmsCheckMhsmNameAvailabilityOptionalParams, + ManagedHsmsCheckMhsmNameAvailabilityResponse } from "../models"; /// @@ -169,7 +173,12 @@ export interface ManagedHsms { name: string, location: string, options?: ManagedHsmsPurgeDeletedOptionalParams - ): Promise, void>>; + ): Promise< + PollerLike< + PollOperationState, + ManagedHsmsPurgeDeletedResponse + > + >; /** * Permanently deletes the specified managed HSM. * @param name The name of the soft-deleted managed HSM. @@ -180,5 +189,14 @@ export interface ManagedHsms { name: string, location: string, options?: ManagedHsmsPurgeDeletedOptionalParams - ): Promise; + ): Promise; + /** + * Checks that the managed hsm name is valid and is not already in use. + * @param mhsmName The name of the managed hsm. + * @param options The options parameters. + */ + checkMhsmNameAvailability( + mhsmName: CheckMhsmNameAvailabilityParameters, + options?: ManagedHsmsCheckMhsmNameAvailabilityOptionalParams + ): Promise; } diff --git a/sdk/keyvault/arm-keyvault/src/operationsInterfaces/secrets.ts b/sdk/keyvault/arm-keyvault/src/operationsInterfaces/secrets.ts index 7aa4e6e13104..379b92f98dc2 100644 --- a/sdk/keyvault/arm-keyvault/src/operationsInterfaces/secrets.ts +++ b/sdk/keyvault/arm-keyvault/src/operationsInterfaces/secrets.ts @@ -42,7 +42,9 @@ export interface Secrets { * with vault secrets. * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName Name of the vault - * @param secretName Name of the secret + * @param secretName Name of the secret. The value you provide may be copied globally for the purpose + * of running the service. The value provided should not include personally identifiable or sensitive + * information. * @param parameters Parameters to create or update the secret * @param options The options parameters. */ diff --git a/sdk/keyvault/arm-keyvault/src/operationsInterfaces/vaults.ts b/sdk/keyvault/arm-keyvault/src/operationsInterfaces/vaults.ts index b693f7e61645..1f21f8c586bd 100644 --- a/sdk/keyvault/arm-keyvault/src/operationsInterfaces/vaults.ts +++ b/sdk/keyvault/arm-keyvault/src/operationsInterfaces/vaults.ts @@ -15,6 +15,7 @@ import { DeletedVault, VaultsListDeletedOptionalParams, Resource, + ResourceManagerApiVersions, VaultsListOptionalParams, VaultCreateOrUpdateParameters, VaultsCreateOrUpdateOptionalParams, @@ -66,9 +67,11 @@ export interface Vaults { ): PagedAsyncIterableIterator; /** * The List operation gets information about the vaults associated with the subscription. + * @param apiVersion Azure Resource Manager Api Version. * @param options The options parameters. */ list( + apiVersion: ResourceManagerApiVersions, options?: VaultsListOptionalParams ): PagedAsyncIterableIterator; /** diff --git a/sdk/keyvault/arm-keyvault/src/pagingHelper.ts b/sdk/keyvault/arm-keyvault/src/pagingHelper.ts index d85fc13bce1e..269a2b9814b5 100644 --- a/sdk/keyvault/arm-keyvault/src/pagingHelper.ts +++ b/sdk/keyvault/arm-keyvault/src/pagingHelper.ts @@ -13,11 +13,11 @@ export interface PageInfo { const pageMap = new WeakMap(); /** - * Given a result page from a pageable operation, returns a - * continuation token that can be used to begin paging from + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from * that point later. - * @param page A result object from calling .byPage() on a paged operation. - * @returns The continuation token that can be passed into byPage(). + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. */ export function getContinuationToken(page: unknown): string | undefined { if (typeof page !== "object" || page === null) { diff --git a/sdk/keyvault/arm-keyvault/test/sampleTest.ts b/sdk/keyvault/arm-keyvault/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/keyvault/arm-keyvault/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * 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 { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + 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" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/keyvault/arm-keyvault/tsconfig.json b/sdk/keyvault/arm-keyvault/tsconfig.json index d2c1e922fd67..3e6ae96443f3 100644 --- a/sdk/keyvault/arm-keyvault/tsconfig.json +++ b/sdk/keyvault/arm-keyvault/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-keyvault": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"