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..d9f8f6cc763a 100644 --- a/sdk/keyvault/arm-keyvault/src/keyVaultManagementClient.ts +++ b/sdk/keyvault/arm-keyvault/src/keyVaultManagementClient.ts @@ -18,6 +18,8 @@ import { KeyVaultManagementClientContext } from "./keyVaultManagementClientConte class KeyVaultManagementClient extends KeyVaultManagementClientContext { // Operation groups vaults: operations.Vaults; + privateEndpointConnections: operations.PrivateEndpointConnections; + privateLinkResources: operations.PrivateLinkResources; operations: operations.Operations; /** @@ -30,6 +32,8 @@ 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); } } diff --git a/sdk/keyvault/arm-keyvault/src/keyVaultManagementClientContext.ts b/sdk/keyvault/arm-keyvault/src/keyVaultManagementClientContext.ts index 22862703742e..4be8ed00d199 100644 --- a/sdk/keyvault/arm-keyvault/src/keyVaultManagementClientContext.ts +++ b/sdk/keyvault/arm-keyvault/src/keyVaultManagementClientContext.ts @@ -45,7 +45,7 @@ export class KeyVaultManagementClientContext extends msRestAzure.AzureServiceCli super(credentials, options); - this.apiVersion = '2018-02-14'; + this.apiVersion = '2019-09-01'; 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..0e9004df4976 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. */ @@ -546,6 +701,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 @@ -663,6 +849,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' @@ -979,6 +1182,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. */ diff --git a/sdk/keyvault/arm-keyvault/src/models/mappers.ts b/sdk/keyvault/arm-keyvault/src/models/mappers.ts index 1442fb113e16..c6c6c3d17598 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,50 @@ export const Operation: msRest.CompositeMapper = { } }; +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: { diff --git a/sdk/keyvault/arm-keyvault/src/models/parameters.ts b/sdk/keyvault/arm-keyvault/src/models/parameters.ts index df134cdbf885..31fe57c3fb22 100644 --- a/sdk/keyvault/arm-keyvault/src/models/parameters.ts +++ b/sdk/keyvault/arm-keyvault/src/models/parameters.ts @@ -90,6 +90,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..19f45f68a17f --- /dev/null +++ b/sdk/keyvault/arm-keyvault/src/models/privateEndpointConnectionsMappers.ts @@ -0,0 +1,33 @@ +/* + * 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, + 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..38c006c4aaec --- /dev/null +++ b/sdk/keyvault/arm-keyvault/src/models/privateLinkResourcesMappers.ts @@ -0,0 +1,32 @@ +/* + * 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, + 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..bf9b6b534a5a 100644 --- a/sdk/keyvault/arm-keyvault/src/models/vaultsMappers.ts +++ b/sdk/keyvault/arm-keyvault/src/models/vaultsMappers.ts @@ -17,6 +17,11 @@ export { IPRule, 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..0e3343cb31c0 100644 --- a/sdk/keyvault/arm-keyvault/src/operations/index.ts +++ b/sdk/keyvault/arm-keyvault/src/operations/index.ts @@ -9,4 +9,6 @@ */ export * from "./vaults"; +export * from "./privateEndpointConnections"; +export * from "./privateLinkResources"; export * from "./operations"; 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