diff --git a/sdk/keyvault/arm-keyvault/LICENSE.txt b/sdk/keyvault/arm-keyvault/LICENSE.txt index b73b4a1293c3..ea8fb1516028 100644 --- a/sdk/keyvault/arm-keyvault/LICENSE.txt +++ b/sdk/keyvault/arm-keyvault/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019 Microsoft +Copyright (c) 2020 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/README.md b/sdk/keyvault/arm-keyvault/README.md index d1d514d0f206..07b27872b408 100644 --- a/sdk/keyvault/arm-keyvault/README.md +++ b/sdk/keyvault/arm-keyvault/README.md @@ -19,8 +19,9 @@ npm install @azure/arm-keyvault ##### Install @azure/ms-rest-nodeauth +- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. ```bash -npm install @azure/ms-rest-nodeauth +npm install @azure/ms-rest-nodeauth@"^3.0.0" ``` ##### Sample code @@ -99,5 +100,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fkeyvault%2Farm-keyvault%2FREADME.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/keyvault/arm-keyvault/README.png) diff --git a/sdk/keyvault/arm-keyvault/package.json b/sdk/keyvault/arm-keyvault/package.json index 4786c5929d5d..2301bdfbbffa 100644 --- a/sdk/keyvault/arm-keyvault/package.json +++ b/sdk/keyvault/arm-keyvault/package.json @@ -4,9 +4,9 @@ "description": "KeyVaultManagementClient Library with typescript type definitions for node.js and browser.", "version": "1.2.1", "dependencies": { - "@azure/ms-rest-azure-js": "^1.3.2", - "@azure/ms-rest-js": "^1.8.1", - "tslib": "^1.9.3" + "@azure/ms-rest-azure-js": "^2.0.1", + "@azure/ms-rest-js": "^2.0.4", + "tslib": "^1.10.0" }, "keywords": [ "node", @@ -20,19 +20,19 @@ "module": "./esm/keyVaultManagementClient.js", "types": "./esm/keyVaultManagementClient.d.ts", "devDependencies": { - "typescript": "^3.1.1", - "rollup": "^0.66.2", - "rollup-plugin-node-resolve": "^3.4.0", + "typescript": "^3.5.3", + "rollup": "^1.18.0", + "rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.4.9" + "uglify-js": "^3.6.0" }, - "homepage": "https://github.com/azure/azure-sdk-for-js", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/keyvault/arm-keyvault", "repository": { "type": "git", - "url": "https://github.com/azure/azure-sdk-for-js.git" + "url": "https://github.com/Azure/azure-sdk-for-js.git" }, "bugs": { - "url": "https://github.com/azure/azure-sdk-for-js/issues" + "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", diff --git a/sdk/keyvault/arm-keyvault/rollup.config.js b/sdk/keyvault/arm-keyvault/rollup.config.js index fdc2d21a8733..8388a15967f3 100644 --- a/sdk/keyvault/arm-keyvault/rollup.config.js +++ b/sdk/keyvault/arm-keyvault/rollup.config.js @@ -29,7 +29,7 @@ const config = { */` }, plugins: [ - nodeResolve({ module: true }), + nodeResolve({ mainFields: ['module', 'main'] }), sourcemaps() ] }; diff --git a/sdk/keyvault/arm-keyvault/src/keyVaultManagementClient.ts b/sdk/keyvault/arm-keyvault/src/keyVaultManagementClient.ts index f0901b1beb26..0b45000025a6 100644 --- a/sdk/keyvault/arm-keyvault/src/keyVaultManagementClient.ts +++ b/sdk/keyvault/arm-keyvault/src/keyVaultManagementClient.ts @@ -18,7 +18,10 @@ import { KeyVaultManagementClientContext } from "./keyVaultManagementClientConte class KeyVaultManagementClient extends KeyVaultManagementClientContext { // Operation groups vaults: operations.Vaults; + privateEndpointConnections: operations.PrivateEndpointConnections; + privateLinkResources: operations.PrivateLinkResources; operations: operations.Operations; + managedHsms: operations.ManagedHsms; /** * Initializes a new instance of the KeyVaultManagementClient class. @@ -30,7 +33,10 @@ class KeyVaultManagementClient extends KeyVaultManagementClientContext { constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.KeyVaultManagementClientOptions) { super(credentials, subscriptionId, options); this.vaults = new operations.Vaults(this); + this.privateEndpointConnections = new operations.PrivateEndpointConnections(this); + this.privateLinkResources = new operations.PrivateLinkResources(this); this.operations = new operations.Operations(this); + this.managedHsms = new operations.ManagedHsms(this); } } diff --git a/sdk/keyvault/arm-keyvault/src/keyVaultManagementClientContext.ts b/sdk/keyvault/arm-keyvault/src/keyVaultManagementClientContext.ts index 22862703742e..2569f2fe2372 100644 --- a/sdk/keyvault/arm-keyvault/src/keyVaultManagementClientContext.ts +++ b/sdk/keyvault/arm-keyvault/src/keyVaultManagementClientContext.ts @@ -18,7 +18,6 @@ const packageVersion = "1.2.1"; export class KeyVaultManagementClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; subscriptionId: string; - apiVersion?: string; /** * Initializes a new instance of the KeyVaultManagementClient class. @@ -45,7 +44,6 @@ export class KeyVaultManagementClientContext extends msRestAzure.AzureServiceCli super(credentials, options); - this.apiVersion = '2018-02-14'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; diff --git a/sdk/keyvault/arm-keyvault/src/models/index.ts b/sdk/keyvault/arm-keyvault/src/models/index.ts index f6d55103853c..de07a8259337 100644 --- a/sdk/keyvault/arm-keyvault/src/models/index.ts +++ b/sdk/keyvault/arm-keyvault/src/models/index.ts @@ -115,6 +115,55 @@ export interface NetworkRuleSet { virtualNetworkRules?: VirtualNetworkRule[]; } +/** + * Private endpoint object properties. + */ +export interface PrivateEndpoint { + /** + * Full identifier of the private endpoint resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; +} + +/** + * An object that represents the approval state of the private link connection. + */ +export interface PrivateLinkServiceConnectionState { + /** + * Indicates whether the connection has been approved, rejected or removed by the key vault + * owner. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + */ + status?: PrivateEndpointServiceConnectionStatus; + /** + * The reason for approval or rejection. + */ + description?: string; + /** + * A message indicating if changes on the service provider require any updates on the consumer. + */ + actionRequired?: string; +} + +/** + * Private endpoint connection item. + */ +export interface PrivateEndpointConnectionItem { + /** + * Properties of the private endpoint object. + */ + privateEndpoint?: PrivateEndpoint; + /** + * Approval state of the private link connection. + */ + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + /** + * Provisioning state of the private endpoint connection. Possible values include: 'Succeeded', + * 'Creating', 'Updating', 'Deleting', 'Failed', 'Disconnected' + */ + provisioningState?: PrivateEndpointConnectionProvisioningState; +} + /** * Properties of the vault */ @@ -129,8 +178,8 @@ export interface VaultProperties { */ sku: Sku; /** - * An array of 0 to 16 identities that have access to the key vault. All identities in the array - * must use the same tenant ID as the key vault's tenant ID. When `createMode` is set to + * An array of 0 to 1024 identities that have access to the key vault. All identities in the + * array must use the same tenant ID as the key vault's tenant ID. When `createMode` is set to * `recover`, access policies are not required. Otherwise, access policies are required. */ accessPolicies?: AccessPolicyEntry[]; @@ -154,10 +203,25 @@ export interface VaultProperties { */ enabledForTemplateDeployment?: boolean; /** - * Property to specify whether the 'soft delete' functionality is enabled for this key vault. It - * does not accept false value. + * Property to specify whether the 'soft delete' functionality is enabled for this key vault. If + * it's not set to any value(true or false) when creating new key vault, it will be set to true + * by default. Once set to true, it cannot be reverted to false. Default value: true. */ enableSoftDelete?: boolean; + /** + * softDelete data retention days. It accepts >=7 and <=90. Default value: 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. Default value: false. + */ + enableRbacAuthorization?: boolean; /** * The vault's create mode to indicate whether the vault need to be recovered or not. Possible * values include: 'recover', 'default' @@ -172,10 +236,14 @@ export interface VaultProperties { */ enablePurgeProtection?: boolean; /** - * A collection of rules governing the accessibility of the vault from specific network - * locations. + * Rules governing the accessibility of the key vault from specific network locations. */ networkAcls?: NetworkRuleSet; + /** + * List of private endpoint connections associated with the key vault. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly privateEndpointConnections?: PrivateEndpointConnectionItem[]; } /** @@ -212,10 +280,23 @@ export interface VaultPatchProperties { */ enabledForTemplateDeployment?: boolean; /** - * Property to specify whether the 'soft delete' functionality is enabled for this key vault. It - * does not accept false value. + * 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. + */ + enableRbacAuthorization?: boolean; + /** + * softDelete data retention days. It accepts >=7 and <=90. + */ + softDeleteRetentionInDays?: number; /** * The vault's create mode to indicate whether the vault need to be recovered or not. Possible * values include: 'recover', 'default' @@ -341,38 +422,32 @@ export interface VaultAccessPolicyParameters extends BaseResource { } /** - * Key Vault resource + * Resource information with extended details. */ -export interface Resource extends BaseResource { +export interface Vault extends BaseResource { /** - * The Azure Resource Manager resource ID for the key vault. + * Fully qualified identifier of the key vault resource. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly id?: string; /** - * The name of the key vault. + * Name of the key vault resource. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly name?: string; /** - * The resource type of the key vault. + * Resource type of the key vault resource. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly type?: string; /** - * The supported Azure location where the key vault should be created. + * Azure location of the key vault resource. */ - location: string; + location?: string; /** - * The tags that will be assigned to the key vault. + * Tags assigned to the key vault resource. */ tags?: { [propertyName: string]: string }; -} - -/** - * Resource information with extended details. - */ -export interface Vault extends Resource { /** * Properties of the vault */ @@ -404,6 +479,37 @@ export interface DeletedVault { properties?: DeletedVaultProperties; } +/** + * Key Vault resource + */ +export interface Resource extends BaseResource { + /** + * Fully qualified identifier of the key vault resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * Name of the key vault resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * Resource type of the key vault resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * Azure location of the key vault resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly location?: string; + /** + * Tags assigned to the key vault resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly tags?: { [propertyName: string]: string }; +} + /** * The parameters used to check the availability of the vault name. */ @@ -437,6 +543,55 @@ export interface CheckNameAvailabilityResult { readonly message?: string; } +/** + * Private endpoint connection resource. + */ +export interface PrivateEndpointConnection extends BaseResource { + /** + * Properties of the private endpoint object. + */ + privateEndpoint?: PrivateEndpoint; + /** + * Approval state of the private link connection. + */ + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + /** + * Provisioning state of the private endpoint connection. Possible values include: 'Succeeded', + * 'Creating', 'Updating', 'Deleting', 'Failed', 'Disconnected' + */ + provisioningState?: PrivateEndpointConnectionProvisioningState; +} + +/** + * A private link resource + */ +export interface PrivateLinkResource extends Resource { + /** + * Group identifier of private link resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly groupId?: string; + /** + * Required member names of private link resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly requiredMembers?: string[]; + /** + * Required DNS zone names of the the private link resource. + */ + requiredZoneNames?: string[]; +} + +/** + * A list of private link resources + */ +export interface PrivateLinkResourceListResult { + /** + * Array of private link resources + */ + value?: PrivateLinkResource[]; +} + /** * Display metadata associated with the operation. */ @@ -509,6 +664,145 @@ export interface Operation { serviceSpecification?: ServiceSpecification; } +/** + * SKU details + */ +export interface ManagedHsmSku { + /** + * SKU of the managed HSM Pool. Possible values include: 'Standard_B1', 'Custom_B32' + */ + name: ManagedHsmSkuName; +} + +/** + * Properties of the managed HSM Pool + */ +export interface ManagedHsmProperties { + /** + * The Azure Active Directory tenant ID that should be used for authenticating requests to the + * managed HSM pool. + */ + tenantId?: string; + /** + * Array of initial administrators object ids for this managed hsm pool. + */ + initialAdminObjectIds?: string[]; + /** + * The URI of the managed hsm pool for performing operations on keys. + */ + hsmPoolUri?: string; + /** + * Property to specify whether the 'soft delete' functionality is enabled for this managed HSM + * pool. If it's not set to any value(true or false) when creating new managed HSM pool, it will + * be set to true by default. Once set to true, it cannot be reverted to false. Default value: + * true. + */ + enableSoftDelete?: boolean; + /** + * softDelete data retention days. It accepts >=7 and <=90. Default value: 90. + */ + softDeleteRetentionInDays?: number; + /** + * Property specifying whether protection against purge is enabled for this managed HSM pool. + * Setting this property to true activates protection against purge for this managed HSM pool and + * its content - only the Managed HSM service may initiate a hard, irrecoverable deletion. The + * setting is effective only if soft delete is also enabled. Enabling this functionality is + * irreversible. + */ + enablePurgeProtection?: boolean; + /** + * The create mode to indicate whether the resource is being created or is being recovered from a + * deleted resource. Possible values include: 'recover', 'default' + */ + createMode?: CreateMode; + /** + * Resource Status Message. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly statusMessage?: string; + /** + * Provisioning state. Possible values include: 'Succeeded', 'Provisioning', 'Failed', + * 'Updating', 'Deleting', 'Activated', 'SecurityDomainRestore', 'Restoring' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: ProvisioningState; +} + +/** + * Managed HSM resource + */ +export interface ManagedHsmResource extends BaseResource { + /** + * The Azure Resource Manager resource ID for the managed HSM Pool. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The name of the managed HSM Pool. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The resource type of the managed HSM Pool. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * The supported Azure location where the managed HSM Pool should be created. + */ + location?: string; + /** + * SKU details + */ + sku?: ManagedHsmSku; + /** + * Resource tags + */ + tags?: { [propertyName: string]: string }; +} + +/** + * Resource information with extended details. + */ +export interface ManagedHsm extends ManagedHsmResource { + /** + * Properties of the managed HSM + */ + properties?: ManagedHsmProperties; +} + +/** + * The server error. + */ +export interface ErrorModel { + /** + * The error code. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly code?: string; + /** + * The error message. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; + /** + * The inner error, contains a more specific error code. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly innerError?: ErrorModel; +} + +/** + * The error exception. + */ +export interface ManagedHsmError { + /** + * The server error. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly error?: ErrorModel; +} + /** * Optional Parameters. */ @@ -539,6 +833,26 @@ export interface VaultsListOptionalParams extends msRest.RequestOptionsBase { top?: number; } +/** + * Optional Parameters. + */ +export interface ManagedHsmsListByResourceGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * Maximum number of results to return. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface ManagedHsmsListBySubscriptionOptionalParams extends msRest.RequestOptionsBase { + /** + * Maximum number of results to return. + */ + top?: number; +} + /** * An interface representing KeyVaultManagementClientOptions. */ @@ -546,6 +860,37 @@ export interface KeyVaultManagementClientOptions extends AzureServiceClientOptio baseUri?: string; } +/** + * Defines headers for Put operation. + */ +export interface PrivateEndpointConnectionsPutHeaders { + /** + * (specified only if operation does not finish synchronously) The recommended number of seconds + * to wait before calling the URI specified in Azure-AsyncOperation. + */ + retryAfter: number; + /** + * (specified only if operation does not finish synchronously) The URI to poll for completion + * status. The response of this URI may be synchronous or asynchronous. + */ + azureAsyncOperation: string; +} + +/** + * Defines headers for Delete operation. + */ +export interface PrivateEndpointConnectionsDeleteHeaders { + /** + * 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. + */ + locationHeader: string; +} + /** * @interface * List of vaults @@ -595,6 +940,18 @@ export interface OperationListResult extends Array { nextLink?: string; } +/** + * @interface + * List of managed HSM Pools + * @extends Array + */ +export interface ManagedHsmListResult extends Array { + /** + * The URL to get the next set of managed HSM Pools. + */ + nextLink?: string; +} + /** * Defines values for SkuName. * Possible values include: 'standard', 'premium' @@ -663,6 +1020,23 @@ export type NetworkRuleBypassOptions = 'AzureServices' | 'None'; */ export type NetworkRuleAction = 'Allow' | 'Deny'; +/** + * Defines values for PrivateEndpointServiceConnectionStatus. + * Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + * @readonly + * @enum {string} + */ +export type PrivateEndpointServiceConnectionStatus = 'Pending' | 'Approved' | 'Rejected' | 'Disconnected'; + +/** + * Defines values for PrivateEndpointConnectionProvisioningState. + * Possible values include: 'Succeeded', 'Creating', 'Updating', 'Deleting', 'Failed', + * 'Disconnected' + * @readonly + * @enum {string} + */ +export type PrivateEndpointConnectionProvisioningState = 'Succeeded' | 'Creating' | 'Updating' | 'Deleting' | 'Failed' | 'Disconnected'; + /** * Defines values for Reason. * Possible values include: 'AccountNameInvalid', 'AlreadyExists' @@ -671,6 +1045,23 @@ export type NetworkRuleAction = 'Allow' | 'Deny'; */ export type Reason = 'AccountNameInvalid' | 'AlreadyExists'; +/** + * Defines values for ManagedHsmSkuName. + * Possible values include: 'Standard_B1', 'Custom_B32' + * @readonly + * @enum {string} + */ +export type ManagedHsmSkuName = 'Standard_B1' | 'Custom_B32'; + +/** + * Defines values for ProvisioningState. + * Possible values include: 'Succeeded', 'Provisioning', 'Failed', 'Updating', 'Deleting', + * 'Activated', 'SecurityDomainRestore', 'Restoring' + * @readonly + * @enum {string} + */ +export type ProvisioningState = 'Succeeded' | 'Provisioning' | 'Failed' | 'Updating' | 'Deleting' | 'Activated' | 'SecurityDomainRestore' | 'Restoring'; + /** * Defines values for AccessPolicyUpdateKind. * Possible values include: 'add', 'replace', 'remove' @@ -979,6 +1370,96 @@ export type VaultsListNextResponse = ResourceListResult & { }; }; +/** + * Contains response data for the get operation. + */ +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PrivateEndpointConnection; + }; +}; + +/** + * Contains response data for the put operation. + */ +export type PrivateEndpointConnectionsPutResponse = PrivateEndpointConnection & PrivateEndpointConnectionsPutHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: PrivateEndpointConnectionsPutHeaders; + + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PrivateEndpointConnection; + }; +}; + +/** + * Contains response data for the deleteMethod operation. + */ +export type PrivateEndpointConnectionsDeleteResponse = PrivateEndpointConnection & PrivateEndpointConnectionsDeleteHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: PrivateEndpointConnectionsDeleteHeaders; + + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PrivateEndpointConnection; + }; +}; + +/** + * Contains response data for the listByVault operation. + */ +export type PrivateLinkResourcesListByVaultResponse = PrivateLinkResourceListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PrivateLinkResourceListResult; + }; +}; + /** * Contains response data for the list operation. */ @@ -1018,3 +1499,183 @@ export type OperationsListNextResponse = OperationListResult & { parsedBody: OperationListResult; }; }; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type ManagedHsmsCreateOrUpdateResponse = ManagedHsm & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ManagedHsm; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type ManagedHsmsUpdateResponse = ManagedHsm & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ManagedHsm; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type ManagedHsmsGetResponse = ManagedHsm & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ManagedHsm; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type ManagedHsmsListByResourceGroupResponse = ManagedHsmListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ManagedHsmListResult; + }; +}; + +/** + * Contains response data for the listBySubscription operation. + */ +export type ManagedHsmsListBySubscriptionResponse = ManagedHsmListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ManagedHsmListResult; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type ManagedHsmsBeginCreateOrUpdateResponse = ManagedHsm & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ManagedHsm; + }; +}; + +/** + * Contains response data for the beginUpdate operation. + */ +export type ManagedHsmsBeginUpdateResponse = ManagedHsm & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ManagedHsm; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type ManagedHsmsListByResourceGroupNextResponse = ManagedHsmListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ManagedHsmListResult; + }; +}; + +/** + * Contains response data for the listBySubscriptionNext operation. + */ +export type ManagedHsmsListBySubscriptionNextResponse = ManagedHsmListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ManagedHsmListResult; + }; +}; diff --git a/sdk/keyvault/arm-keyvault/src/models/managedHsmsMappers.ts b/sdk/keyvault/arm-keyvault/src/models/managedHsmsMappers.ts new file mode 100644 index 000000000000..6c18e6257aaf --- /dev/null +++ b/sdk/keyvault/arm-keyvault/src/models/managedHsmsMappers.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + AccessPolicyEntry, + BaseResource, + ErrorModel, + IPRule, + ManagedHsm, + ManagedHsmError, + ManagedHsmListResult, + ManagedHsmProperties, + ManagedHsmResource, + ManagedHsmSku, + NetworkRuleSet, + Permissions, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateEndpointConnectionItem, + PrivateLinkResource, + PrivateLinkServiceConnectionState, + Resource, + Sku, + Vault, + VaultAccessPolicyParameters, + VaultAccessPolicyProperties, + VaultCreateOrUpdateParameters, + VaultPatchParameters, + VaultPatchProperties, + VaultProperties, + VirtualNetworkRule +} from "../models/mappers"; diff --git a/sdk/keyvault/arm-keyvault/src/models/mappers.ts b/sdk/keyvault/arm-keyvault/src/models/mappers.ts index 1442fb113e16..7cfc49be615b 100644 --- a/sdk/keyvault/arm-keyvault/src/models/mappers.ts +++ b/sdk/keyvault/arm-keyvault/src/models/mappers.ts @@ -214,6 +214,81 @@ export const NetworkRuleSet: msRest.CompositeMapper = { } }; +export const PrivateEndpoint: msRest.CompositeMapper = { + serializedName: "PrivateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkServiceConnectionState: msRest.CompositeMapper = { + serializedName: "PrivateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + actionRequired: { + serializedName: "actionRequired", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpointConnectionItem: msRest.CompositeMapper = { + serializedName: "PrivateEndpointConnectionItem", + type: { + name: "Composite", + className: "PrivateEndpointConnectionItem", + modelProperties: { + privateEndpoint: { + serializedName: "properties.privateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint" + } + }, + privateLinkServiceConnectionState: { + serializedName: "properties.privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String" + } + } + } + } +}; + export const VaultProperties: msRest.CompositeMapper = { serializedName: "VaultProperties", type: { @@ -274,6 +349,21 @@ export const VaultProperties: msRest.CompositeMapper = { }, enableSoftDelete: { serializedName: "enableSoftDelete", + defaultValue: true, + type: { + name: "Boolean" + } + }, + softDeleteRetentionInDays: { + serializedName: "softDeleteRetentionInDays", + defaultValue: 90, + type: { + name: "Number" + } + }, + enableRbacAuthorization: { + serializedName: "enableRbacAuthorization", + defaultValue: false, type: { name: "Boolean" } @@ -300,6 +390,19 @@ export const VaultProperties: msRest.CompositeMapper = { name: "Composite", className: "NetworkRuleSet" } + }, + privateEndpointConnections: { + readOnly: true, + serializedName: "privateEndpointConnections", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnectionItem" + } + } + } } } } @@ -360,6 +463,18 @@ export const VaultPatchProperties: msRest.CompositeMapper = { name: "Boolean" } }, + enableRbacAuthorization: { + serializedName: "enableRbacAuthorization", + type: { + name: "Boolean" + } + }, + softDeleteRetentionInDays: { + serializedName: "softDeleteRetentionInDays", + type: { + name: "Number" + } + }, createMode: { serializedName: "createMode", type: { @@ -571,11 +686,11 @@ export const VaultAccessPolicyParameters: msRest.CompositeMapper = { } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const Vault: msRest.CompositeMapper = { + serializedName: "Vault", type: { name: "Composite", - className: "Resource", + className: "Vault", modelProperties: { id: { readOnly: true, @@ -599,7 +714,6 @@ export const Resource: msRest.CompositeMapper = { } }, location: { - required: true, serializedName: "location", type: { name: "String" @@ -615,18 +729,7 @@ export const Resource: msRest.CompositeMapper = { } } } - } - } - } -}; - -export const Vault: msRest.CompositeMapper = { - serializedName: "Vault", - type: { - name: "Composite", - className: "Vault", - modelProperties: { - ...Resource.type.modelProperties, + }, properties: { required: true, serializedName: "properties", @@ -678,6 +781,56 @@ export const DeletedVault: msRest.CompositeMapper = { } }; +export const Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + location: { + readOnly: true, + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + readOnly: true, + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + export const VaultCheckNameAvailabilityParameters: msRest.CompositeMapper = { serializedName: "VaultCheckNameAvailabilityParameters", type: { @@ -739,6 +892,99 @@ export const CheckNameAvailabilityResult: msRest.CompositeMapper = { } }; +export const PrivateEndpointConnection: msRest.CompositeMapper = { + serializedName: "PrivateEndpointConnection", + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + privateEndpoint: { + serializedName: "properties.privateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint" + } + }, + privateLinkServiceConnectionState: { + serializedName: "properties.privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkResource: msRest.CompositeMapper = { + serializedName: "PrivateLinkResource", + type: { + name: "Composite", + className: "PrivateLinkResource", + modelProperties: { + ...Resource.type.modelProperties, + groupId: { + readOnly: true, + serializedName: "properties.groupId", + type: { + name: "String" + } + }, + requiredMembers: { + readOnly: true, + serializedName: "properties.requiredMembers", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + requiredZoneNames: { + serializedName: "properties.requiredZoneNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const PrivateLinkResourceListResult: msRest.CompositeMapper = { + serializedName: "PrivateLinkResourceListResult", + type: { + name: "Composite", + className: "PrivateLinkResourceListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkResource" + } + } + } + } + } + } +}; + export const OperationDisplay: msRest.CompositeMapper = { serializedName: "Operation_display", type: { @@ -859,6 +1105,280 @@ export const Operation: msRest.CompositeMapper = { } }; +export const ManagedHsmSku: msRest.CompositeMapper = { + serializedName: "ManagedHsmSku", + type: { + name: "Composite", + className: "ManagedHsmSku", + modelProperties: { + family: { + required: true, + isConstant: true, + serializedName: "family", + defaultValue: 'B', + type: { + name: "String" + } + }, + name: { + required: true, + serializedName: "name", + type: { + name: "Enum", + allowedValues: [ + "Standard_B1", + "Custom_B32" + ] + } + } + } + } +}; + +export const ManagedHsmProperties: msRest.CompositeMapper = { + serializedName: "ManagedHsmProperties", + type: { + name: "Composite", + className: "ManagedHsmProperties", + modelProperties: { + tenantId: { + serializedName: "tenantId", + type: { + name: "Uuid" + } + }, + initialAdminObjectIds: { + serializedName: "initialAdminObjectIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + hsmPoolUri: { + serializedName: "hsmPoolUri", + type: { + name: "String" + } + }, + enableSoftDelete: { + serializedName: "enableSoftDelete", + defaultValue: true, + type: { + name: "Boolean" + } + }, + softDeleteRetentionInDays: { + serializedName: "softDeleteRetentionInDays", + defaultValue: 90, + type: { + name: "Number" + } + }, + enablePurgeProtection: { + serializedName: "enablePurgeProtection", + type: { + name: "Boolean" + } + }, + createMode: { + serializedName: "createMode", + type: { + name: "Enum", + allowedValues: [ + "recover", + "default" + ] + } + }, + statusMessage: { + readOnly: true, + serializedName: "statusMessage", + type: { + name: "String" + } + }, + provisioningState: { + readOnly: true, + serializedName: "provisioningState", + type: { + name: "String" + } + } + } + } +}; + +export const ManagedHsmResource: msRest.CompositeMapper = { + serializedName: "ManagedHsmResource", + type: { + name: "Composite", + className: "ManagedHsmResource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "ManagedHsmSku" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ManagedHsm: msRest.CompositeMapper = { + serializedName: "ManagedHsm", + type: { + name: "Composite", + className: "ManagedHsm", + modelProperties: { + ...ManagedHsmResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ManagedHsmProperties" + } + } + } + } +}; + +export const ErrorModel: msRest.CompositeMapper = { + serializedName: "Error", + type: { + name: "Composite", + className: "ErrorModel", + modelProperties: { + code: { + readOnly: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + }, + innerError: { + readOnly: true, + serializedName: "innererror", + type: { + name: "Composite", + className: "ErrorModel" + } + } + } + } +}; + +export const ManagedHsmError: msRest.CompositeMapper = { + serializedName: "ManagedHsmError", + type: { + name: "Composite", + className: "ManagedHsmError", + modelProperties: { + error: { + readOnly: true, + serializedName: "error", + type: { + name: "Composite", + className: "ErrorModel" + } + } + } + } +}; + +export const PrivateEndpointConnectionsPutHeaders: msRest.CompositeMapper = { + serializedName: "privateendpointconnections-put-headers", + type: { + name: "Composite", + className: "PrivateEndpointConnectionsPutHeaders", + modelProperties: { + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + }, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpointConnectionsDeleteHeaders: msRest.CompositeMapper = { + serializedName: "privateendpointconnections-delete-headers", + type: { + name: "Composite", + className: "PrivateEndpointConnectionsDeleteHeaders", + modelProperties: { + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + }, + locationHeader: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + export const VaultListResult: msRest.CompositeMapper = { serializedName: "VaultListResult", type: { @@ -970,3 +1490,31 @@ export const OperationListResult: msRest.CompositeMapper = { } } }; + +export const ManagedHsmListResult: msRest.CompositeMapper = { + serializedName: "ManagedHsmListResult", + type: { + name: "Composite", + className: "ManagedHsmListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ManagedHsm" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/keyvault/arm-keyvault/src/models/parameters.ts b/sdk/keyvault/arm-keyvault/src/models/parameters.ts index df134cdbf885..f179c61b7180 100644 --- a/sdk/keyvault/arm-keyvault/src/models/parameters.ts +++ b/sdk/keyvault/arm-keyvault/src/models/parameters.ts @@ -24,7 +24,9 @@ export const apiVersion0: msRest.OperationQueryParameter = { parameterPath: "apiVersion", mapper: { required: true, + isConstant: true, serializedName: "api-version", + defaultValue: '2019-09-01', type: { name: "String" } @@ -42,6 +44,18 @@ export const apiVersion1: msRest.OperationQueryParameter = { } } }; +export const apiVersion2: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + isConstant: true, + serializedName: "api-version", + defaultValue: '2020-04-01-preview', + type: { + name: "String" + } + } +}; export const filter: msRest.OperationQueryParameter = { parameterPath: "filter", mapper: { @@ -64,6 +78,29 @@ export const location: msRest.OperationURLParameter = { } } }; +export const name0: msRest.OperationURLParameter = { + parameterPath: "name", + mapper: { + required: true, + serializedName: "name", + constraints: { + Pattern: /^[a-zA-Z0-9]{3,24}$/ + }, + type: { + name: "String" + } + } +}; +export const name1: msRest.OperationURLParameter = { + parameterPath: "name", + mapper: { + required: true, + serializedName: "name", + type: { + name: "String" + } + } +}; export const nextPageLink: msRest.OperationURLParameter = { parameterPath: "nextPageLink", mapper: { @@ -90,6 +127,16 @@ export const operationKind: msRest.OperationURLParameter = { } } }; +export const privateEndpointConnectionName: msRest.OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", + mapper: { + required: true, + serializedName: "privateEndpointConnectionName", + type: { + name: "String" + } + } +}; export const resourceGroupName: msRest.OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { diff --git a/sdk/keyvault/arm-keyvault/src/models/privateEndpointConnectionsMappers.ts b/sdk/keyvault/arm-keyvault/src/models/privateEndpointConnectionsMappers.ts new file mode 100644 index 000000000000..322b59963a00 --- /dev/null +++ b/sdk/keyvault/arm-keyvault/src/models/privateEndpointConnectionsMappers.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + AccessPolicyEntry, + BaseResource, + CloudError, + IPRule, + ManagedHsm, + ManagedHsmProperties, + ManagedHsmResource, + ManagedHsmSku, + NetworkRuleSet, + Permissions, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateEndpointConnectionItem, + PrivateEndpointConnectionsDeleteHeaders, + PrivateEndpointConnectionsPutHeaders, + PrivateLinkResource, + PrivateLinkServiceConnectionState, + Resource, + Sku, + Vault, + VaultAccessPolicyParameters, + VaultAccessPolicyProperties, + VaultCreateOrUpdateParameters, + VaultPatchParameters, + VaultPatchProperties, + VaultProperties, + VirtualNetworkRule +} from "../models/mappers"; diff --git a/sdk/keyvault/arm-keyvault/src/models/privateLinkResourcesMappers.ts b/sdk/keyvault/arm-keyvault/src/models/privateLinkResourcesMappers.ts new file mode 100644 index 000000000000..fbf0d1c9206a --- /dev/null +++ b/sdk/keyvault/arm-keyvault/src/models/privateLinkResourcesMappers.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + AccessPolicyEntry, + BaseResource, + CloudError, + IPRule, + ManagedHsm, + ManagedHsmProperties, + ManagedHsmResource, + ManagedHsmSku, + NetworkRuleSet, + Permissions, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateEndpointConnectionItem, + PrivateLinkResource, + PrivateLinkResourceListResult, + PrivateLinkServiceConnectionState, + Resource, + Sku, + Vault, + VaultAccessPolicyParameters, + VaultAccessPolicyProperties, + VaultCreateOrUpdateParameters, + VaultPatchParameters, + VaultPatchProperties, + VaultProperties, + VirtualNetworkRule +} from "../models/mappers"; diff --git a/sdk/keyvault/arm-keyvault/src/models/vaultsMappers.ts b/sdk/keyvault/arm-keyvault/src/models/vaultsMappers.ts index 2dece90eaec7..91b2a6d54310 100644 --- a/sdk/keyvault/arm-keyvault/src/models/vaultsMappers.ts +++ b/sdk/keyvault/arm-keyvault/src/models/vaultsMappers.ts @@ -15,8 +15,17 @@ export { DeletedVaultListResult, DeletedVaultProperties, IPRule, + ManagedHsm, + ManagedHsmProperties, + ManagedHsmResource, + ManagedHsmSku, NetworkRuleSet, Permissions, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateEndpointConnectionItem, + PrivateLinkResource, + PrivateLinkServiceConnectionState, Resource, ResourceListResult, Sku, diff --git a/sdk/keyvault/arm-keyvault/src/operations/index.ts b/sdk/keyvault/arm-keyvault/src/operations/index.ts index 88c3eb19f212..729412d0f935 100644 --- a/sdk/keyvault/arm-keyvault/src/operations/index.ts +++ b/sdk/keyvault/arm-keyvault/src/operations/index.ts @@ -9,4 +9,7 @@ */ export * from "./vaults"; +export * from "./privateEndpointConnections"; +export * from "./privateLinkResources"; export * from "./operations"; +export * from "./managedHsms"; diff --git a/sdk/keyvault/arm-keyvault/src/operations/managedHsms.ts b/sdk/keyvault/arm-keyvault/src/operations/managedHsms.ts new file mode 100644 index 000000000000..aaa994a7e2d4 --- /dev/null +++ b/sdk/keyvault/arm-keyvault/src/operations/managedHsms.ts @@ -0,0 +1,482 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/managedHsmsMappers"; +import * as Parameters from "../models/parameters"; +import { KeyVaultManagementClientContext } from "../keyVaultManagementClientContext"; + +/** Class representing a ManagedHsms. */ +export class ManagedHsms { + private readonly client: KeyVaultManagementClientContext; + + /** + * Create a ManagedHsms. + * @param {KeyVaultManagementClientContext} client Reference to the service client. + */ + constructor(client: KeyVaultManagementClientContext) { + this.client = client; + } + + /** + * Create or update a managed HSM Pool in the specified subscription. + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool + * @param parameters Parameters to create or update the managed HSM Pool + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, name: string, parameters: Models.ManagedHsm, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,name,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Update a managed HSM Pool in the specified subscription. + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool + * @param parameters Parameters to patch the managed HSM Pool + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, name: string, parameters: Models.ManagedHsm, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,name,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes the specified managed HSM Pool. + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool to delete + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,name,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Gets the specified managed HSM Pool. + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool. + * @param callback The callback + */ + get(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription + * and within the specified resource group. + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: Models.ManagedHsmsListByResourceGroupOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: Models.ManagedHsmsListByResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: Models.ManagedHsmsListByResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * The List operation gets information about the managed HSM Pools associated with the + * subscription. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscription(options?: Models.ManagedHsmsListBySubscriptionOptionalParams): Promise; + /** + * @param callback The callback + */ + listBySubscription(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listBySubscription(options: Models.ManagedHsmsListBySubscriptionOptionalParams, callback: msRest.ServiceCallback): void; + listBySubscription(options?: Models.ManagedHsmsListBySubscriptionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listBySubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Create or update a managed HSM Pool in the specified subscription. + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool + * @param parameters Parameters to create or update the managed HSM Pool + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(resourceGroupName: string, name: string, parameters: Models.ManagedHsm, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + parameters, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + + /** + * Update a managed HSM Pool in the specified subscription. + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool + * @param parameters Parameters to patch the managed HSM Pool + * @param [options] The optional parameters + * @returns Promise + */ + beginUpdate(resourceGroupName: string, name: string, parameters: Models.ManagedHsm, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + parameters, + options + }, + beginUpdateOperationSpec, + options); + } + + /** + * Deletes the specified managed HSM Pool. + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool to delete + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription + * and within the specified resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * The List operation gets information about the managed HSM Pools associated with the + * subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listBySubscriptionNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name1, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ManagedHsm + }, + default: { + bodyMapper: Mappers.ManagedHsmError + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.top, + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ManagedHsmListResult + }, + default: { + bodyMapper: Mappers.ManagedHsmError + } + }, + serializer +}; + +const listBySubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/managedHSMs", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.top, + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ManagedHsmListResult + }, + default: { + bodyMapper: Mappers.ManagedHsmError + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name0, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ManagedHsm, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ManagedHsm + }, + 202: { + bodyMapper: Mappers.ManagedHsm + }, + default: { + bodyMapper: Mappers.ManagedHsmError + } + }, + serializer +}; + +const beginUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name0, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ManagedHsm, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ManagedHsm + }, + 202: { + bodyMapper: Mappers.ManagedHsm + }, + default: { + bodyMapper: Mappers.ManagedHsmError + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.name1, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ManagedHsmError + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ManagedHsmListResult + }, + default: { + bodyMapper: Mappers.ManagedHsmError + } + }, + serializer +}; + +const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ManagedHsmListResult + }, + default: { + bodyMapper: Mappers.ManagedHsmError + } + }, + serializer +}; diff --git a/sdk/keyvault/arm-keyvault/src/operations/privateEndpointConnections.ts b/sdk/keyvault/arm-keyvault/src/operations/privateEndpointConnections.ts new file mode 100644 index 000000000000..b4f564b66766 --- /dev/null +++ b/sdk/keyvault/arm-keyvault/src/operations/privateEndpointConnections.ts @@ -0,0 +1,243 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/privateEndpointConnectionsMappers"; +import * as Parameters from "../models/parameters"; +import { KeyVaultManagementClientContext } from "../keyVaultManagementClientContext"; + +/** Class representing a PrivateEndpointConnections. */ +export class PrivateEndpointConnections { + private readonly client: KeyVaultManagementClientContext; + + /** + * Create a PrivateEndpointConnections. + * @param {KeyVaultManagementClientContext} client Reference to the service client. + */ + constructor(client: KeyVaultManagementClientContext) { + this.client = client; + } + + /** + * Gets the specified private endpoint connection associated with the key vault. + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the + * key vault. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, vaultName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the + * key vault. + * @param callback The callback + */ + get(resourceGroupName: string, vaultName: string, privateEndpointConnectionName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the + * key vault. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, vaultName: string, privateEndpointConnectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, vaultName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + vaultName, + privateEndpointConnectionName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Updates the specified private endpoint connection associated with the key vault. + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the + * key vault. + * @param properties The intended state of private endpoint connection. + * @param [options] The optional parameters + * @returns Promise + */ + put(resourceGroupName: string, vaultName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the + * key vault. + * @param properties The intended state of private endpoint connection. + * @param callback The callback + */ + put(resourceGroupName: string, vaultName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the + * key vault. + * @param properties The intended state of private endpoint connection. + * @param options The optional parameters + * @param callback The callback + */ + put(resourceGroupName: string, vaultName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + put(resourceGroupName: string, vaultName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + vaultName, + privateEndpointConnectionName, + properties, + options + }, + putOperationSpec, + callback) as Promise; + } + + /** + * Deletes the specified private endpoint connection associated with the key vault. + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the + * key vault. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, vaultName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,vaultName,privateEndpointConnectionName,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes the specified private endpoint connection associated with the key vault. + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the + * key vault. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, vaultName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + vaultName, + privateEndpointConnectionName, + options + }, + beginDeleteMethodOperationSpec, + options); + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName0, + Parameters.privateEndpointConnectionName + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const putOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName0, + Parameters.privateEndpointConnectionName + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "properties", + mapper: { + ...Mappers.PrivateEndpointConnection, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection, + headersMapper: Mappers.PrivateEndpointConnectionsPutHeaders + }, + default: { + bodyMapper: Mappers.CloudError, + headersMapper: Mappers.PrivateEndpointConnectionsPutHeaders + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName0, + Parameters.privateEndpointConnectionName + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection, + headersMapper: Mappers.PrivateEndpointConnectionsDeleteHeaders + }, + 202: { + headersMapper: Mappers.PrivateEndpointConnectionsDeleteHeaders + }, + 204: { + headersMapper: Mappers.PrivateEndpointConnectionsDeleteHeaders + }, + default: { + bodyMapper: Mappers.CloudError, + headersMapper: Mappers.PrivateEndpointConnectionsDeleteHeaders + } + }, + serializer +}; diff --git a/sdk/keyvault/arm-keyvault/src/operations/privateLinkResources.ts b/sdk/keyvault/arm-keyvault/src/operations/privateLinkResources.ts new file mode 100644 index 000000000000..cfcf99282d55 --- /dev/null +++ b/sdk/keyvault/arm-keyvault/src/operations/privateLinkResources.ts @@ -0,0 +1,87 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/privateLinkResourcesMappers"; +import * as Parameters from "../models/parameters"; +import { KeyVaultManagementClientContext } from "../keyVaultManagementClientContext"; + +/** Class representing a PrivateLinkResources. */ +export class PrivateLinkResources { + private readonly client: KeyVaultManagementClientContext; + + /** + * Create a PrivateLinkResources. + * @param {KeyVaultManagementClientContext} client Reference to the service client. + */ + constructor(client: KeyVaultManagementClientContext) { + this.client = client; + } + + /** + * Gets the private link resources supported for the key vault. + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param [options] The optional parameters + * @returns Promise + */ + listByVault(resourceGroupName: string, vaultName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param callback The callback + */ + listByVault(resourceGroupName: string, vaultName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param options The optional parameters + * @param callback The callback + */ + listByVault(resourceGroupName: string, vaultName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByVault(resourceGroupName: string, vaultName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + vaultName, + options + }, + listByVaultOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listByVaultOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateLinkResources", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName0 + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourceListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/keyvault/arm-keyvault/src/operations/vaults.ts b/sdk/keyvault/arm-keyvault/src/operations/vaults.ts index c6ee4218f7c4..c34d91718a97 100644 --- a/sdk/keyvault/arm-keyvault/src/operations/vaults.ts +++ b/sdk/keyvault/arm-keyvault/src/operations/vaults.ts @@ -558,6 +558,7 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { ], responses: { 200: {}, + 204: {}, default: { bodyMapper: Mappers.CloudError } diff --git a/sdk/keyvault/arm-keyvault/tsconfig.json b/sdk/keyvault/arm-keyvault/tsconfig.json index 87bbf5b5fa49..422b584abd5e 100644 --- a/sdk/keyvault/arm-keyvault/tsconfig.json +++ b/sdk/keyvault/arm-keyvault/tsconfig.json @@ -9,7 +9,7 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6"], + "lib": ["es6", "dom"], "declaration": true, "outDir": "./esm", "importHelpers": true