From 0479cec7b2728731d75dc5afbb2a68c26ab6c6e2 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Wed, 11 Nov 2020 04:03:26 +0000 Subject: [PATCH] Generated from 73677f19181157fb0c154a084922a92fa6b528cd --- sdk/keyvault/arm-keyvault/LICENSE.txt | 2 +- sdk/keyvault/arm-keyvault/README.md | 15 +- sdk/keyvault/arm-keyvault/package.json | 20 +- sdk/keyvault/arm-keyvault/rollup.config.js | 6 +- .../src/keyVaultManagementClient.ts | 11 +- .../src/keyVaultManagementClientContext.ts | 7 +- sdk/keyvault/arm-keyvault/src/models/index.ts | 704 +++++++++++++++++- .../arm-keyvault/src/models/keysMappers.ts | 37 + .../arm-keyvault/src/models/mappers.ts | 571 +++++++++++++- .../src/models/operationsMappers.ts | 4 +- .../arm-keyvault/src/models/parameters.ts | 41 +- .../privateEndpointConnectionsMappers.ts | 38 + .../src/models/privateLinkResourcesMappers.ts | 37 + .../arm-keyvault/src/models/vaultsMappers.ts | 14 +- .../arm-keyvault/src/operations/index.ts | 8 +- .../arm-keyvault/src/operations/keys.ts | 456 ++++++++++++ .../arm-keyvault/src/operations/operations.ts | 8 +- .../operations/privateEndpointConnections.ts | 242 ++++++ .../src/operations/privateLinkResources.ts | 86 +++ .../arm-keyvault/src/operations/vaults.ts | 40 +- sdk/keyvault/arm-keyvault/tsconfig.json | 2 +- 21 files changed, 2242 insertions(+), 107 deletions(-) create mode 100644 sdk/keyvault/arm-keyvault/src/models/keysMappers.ts create mode 100644 sdk/keyvault/arm-keyvault/src/models/privateEndpointConnectionsMappers.ts create mode 100644 sdk/keyvault/arm-keyvault/src/models/privateLinkResourcesMappers.ts create mode 100644 sdk/keyvault/arm-keyvault/src/operations/keys.ts create mode 100644 sdk/keyvault/arm-keyvault/src/operations/privateEndpointConnections.ts create mode 100644 sdk/keyvault/arm-keyvault/src/operations/privateLinkResources.ts 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..d77c63099935 100644 --- a/sdk/keyvault/arm-keyvault/README.md +++ b/sdk/keyvault/arm-keyvault/README.md @@ -15,21 +15,21 @@ npm install @azure/arm-keyvault ### How to use -#### nodejs - Authentication, client creation and get vaults as an example written in TypeScript. +#### nodejs - client creation and get vaults as an example written in TypeScript. ##### 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 +While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package ```typescript -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { KeyVaultManagementClient, KeyVaultManagementModels, KeyVaultManagementMappers } from "@azure/arm-keyvault"; +const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +const { KeyVaultManagementClient } = require("@azure/arm-keyvault"); const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; msRestNodeAuth.interactiveLogin().then((creds) => { @@ -99,5 +99,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..70cbe1c376cf 100644 --- a/sdk/keyvault/arm-keyvault/rollup.config.js +++ b/sdk/keyvault/arm-keyvault/rollup.config.js @@ -21,15 +21,15 @@ const config = { "@azure/ms-rest-azure-js": "msRestAzure" }, banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */` }, 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..f609c0139d89 100644 --- a/sdk/keyvault/arm-keyvault/src/keyVaultManagementClient.ts +++ b/sdk/keyvault/arm-keyvault/src/keyVaultManagementClient.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -18,7 +17,10 @@ import { KeyVaultManagementClientContext } from "./keyVaultManagementClientConte class KeyVaultManagementClient extends KeyVaultManagementClientContext { // Operation groups vaults: operations.Vaults; + privateEndpointConnections: operations.PrivateEndpointConnections; + privateLinkResources: operations.PrivateLinkResources; operations: operations.Operations; + keys: operations.Keys; /** * Initializes a new instance of the KeyVaultManagementClient class. @@ -30,7 +32,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.keys = new operations.Keys(this); } } diff --git a/sdk/keyvault/arm-keyvault/src/keyVaultManagementClientContext.ts b/sdk/keyvault/arm-keyvault/src/keyVaultManagementClientContext.ts index 22862703742e..c3a0269011fe 100644 --- a/sdk/keyvault/arm-keyvault/src/keyVaultManagementClientContext.ts +++ b/sdk/keyvault/arm-keyvault/src/keyVaultManagementClientContext.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -45,7 +44,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..64840752c6c4 100644 --- a/sdk/keyvault/arm-keyvault/src/models/index.ts +++ b/sdk/keyvault/arm-keyvault/src/models/index.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -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,132 @@ export interface Operation { serviceSpecification?: ServiceSpecification; } +/** + * The object attributes managed by the Azure Key Vault service. + */ +export interface Attributes { + /** + * Determines whether or not the object is enabled. + */ + enabled?: boolean; + /** + * Not before date in seconds since 1970-01-01T00:00:00Z. + */ + notBefore?: number; + /** + * Expiry date in seconds since 1970-01-01T00:00:00Z. + */ + expires?: number; + /** + * Creation time in seconds since 1970-01-01T00:00:00Z. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly created?: number; + /** + * Last updated time in seconds since 1970-01-01T00:00:00Z. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly updated?: number; + /** + * The deletion recovery level currently in effect for the object. If it contains 'Purgeable', + * then the object can be permanently deleted by a privileged user; otherwise, only the system + * can purge the object at the end of the retention interval. Possible values include: + * 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly recoveryLevel?: DeletionRecoveryLevel; +} + +/** + * The attributes of the key. + */ +export interface KeyAttributes extends Attributes { +} + +/** + * The properties of the key. + */ +export interface KeyProperties { + /** + * The attributes of the key. + */ + attributes?: KeyAttributes; + /** + * The type of the key. For valid values, see JsonWebKeyType. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM' + */ + kty?: JsonWebKeyType; + keyOps?: JsonWebKeyOperation[]; + /** + * The key size in bits. For example: 2048, 3072, or 4096 for RSA. + */ + keySize?: number; + /** + * The elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: + * 'P-256', 'P-384', 'P-521', 'P-256K' + */ + curveName?: JsonWebKeyCurveName; + /** + * The URI to retrieve the current version of the key. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly keyUri?: string; + /** + * The URI to retrieve the specific version of the key. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly keyUriWithVersion?: string; +} + +/** + * The parameters used to create a key. + */ +export interface KeyCreateParameters extends BaseResource { + /** + * The tags that will be assigned to the key. + */ + tags?: { [propertyName: string]: string }; + /** + * The properties of the key to be created. + */ + properties: KeyProperties; +} + +/** + * The key resource. + */ +export interface Key extends Resource { + /** + * The attributes of the key. + */ + attributes?: KeyAttributes; + /** + * The type of the key. For valid values, see JsonWebKeyType. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM' + */ + kty?: JsonWebKeyType; + keyOps?: JsonWebKeyOperation[]; + /** + * The key size in bits. For example: 2048, 3072, or 4096 for RSA. + */ + keySize?: number; + /** + * The elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: + * 'P-256', 'P-384', 'P-521', 'P-256K' + */ + curveName?: JsonWebKeyCurveName; + /** + * The URI to retrieve the current version of the key. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly keyUri?: string; + /** + * The URI to retrieve the specific version of the key. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly keyUriWithVersion?: string; +} + /** * Optional Parameters. */ @@ -539,6 +820,36 @@ export interface VaultsListOptionalParams extends msRest.RequestOptionsBase { top?: number; } +/** + * Optional Parameters. + */ +export interface VaultsListByResourceGroupNextOptionalParams extends msRest.RequestOptionsBase { + /** + * Maximum number of results to return. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface VaultsListBySubscriptionNextOptionalParams extends msRest.RequestOptionsBase { + /** + * Maximum number of results to return. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface VaultsListNextOptionalParams extends msRest.RequestOptionsBase { + /** + * Maximum number of results to return. + */ + top?: number; +} + /** * An interface representing KeyVaultManagementClientOptions. */ @@ -546,6 +857,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 +937,18 @@ export interface OperationListResult extends Array { nextLink?: string; } +/** + * @interface + * The page of keys. + * @extends Array + */ +export interface KeyListResult extends Array { + /** + * The URL to get the next page of keys. + */ + nextLink?: string; +} + /** * Defines values for SkuName. * Possible values include: 'standard', 'premium' @@ -605,39 +959,40 @@ export type SkuName = 'standard' | 'premium'; /** * Defines values for KeyPermissions. - * Possible values include: 'encrypt', 'decrypt', 'wrapKey', 'unwrapKey', 'sign', 'verify', 'get', - * 'list', 'create', 'update', 'import', 'delete', 'backup', 'restore', 'recover', 'purge' + * Possible values include: 'all', 'encrypt', 'decrypt', 'wrapKey', 'unwrapKey', 'sign', 'verify', + * 'get', 'list', 'create', 'update', 'import', 'delete', 'backup', 'restore', 'recover', 'purge' * @readonly * @enum {string} */ -export type KeyPermissions = 'encrypt' | 'decrypt' | 'wrapKey' | 'unwrapKey' | 'sign' | 'verify' | 'get' | 'list' | 'create' | 'update' | 'import' | 'delete' | 'backup' | 'restore' | 'recover' | 'purge'; +export type KeyPermissions = 'all' | 'encrypt' | 'decrypt' | 'wrapKey' | 'unwrapKey' | 'sign' | 'verify' | 'get' | 'list' | 'create' | 'update' | 'import' | 'delete' | 'backup' | 'restore' | 'recover' | 'purge'; /** * Defines values for SecretPermissions. - * Possible values include: 'get', 'list', 'set', 'delete', 'backup', 'restore', 'recover', 'purge' + * Possible values include: 'all', 'get', 'list', 'set', 'delete', 'backup', 'restore', 'recover', + * 'purge' * @readonly * @enum {string} */ -export type SecretPermissions = 'get' | 'list' | 'set' | 'delete' | 'backup' | 'restore' | 'recover' | 'purge'; +export type SecretPermissions = 'all' | 'get' | 'list' | 'set' | 'delete' | 'backup' | 'restore' | 'recover' | 'purge'; /** * Defines values for CertificatePermissions. - * Possible values include: 'get', 'list', 'delete', 'create', 'import', 'update', + * Possible values include: 'all', 'get', 'list', 'delete', 'create', 'import', 'update', * 'managecontacts', 'getissuers', 'listissuers', 'setissuers', 'deleteissuers', 'manageissuers', * 'recover', 'purge', 'backup', 'restore' * @readonly * @enum {string} */ -export type CertificatePermissions = 'get' | 'list' | 'delete' | 'create' | 'import' | 'update' | 'managecontacts' | 'getissuers' | 'listissuers' | 'setissuers' | 'deleteissuers' | 'manageissuers' | 'recover' | 'purge' | 'backup' | 'restore'; +export type CertificatePermissions = 'all' | 'get' | 'list' | 'delete' | 'create' | 'import' | 'update' | 'managecontacts' | 'getissuers' | 'listissuers' | 'setissuers' | 'deleteissuers' | 'manageissuers' | 'recover' | 'purge' | 'backup' | 'restore'; /** * Defines values for StoragePermissions. - * Possible values include: 'get', 'list', 'delete', 'set', 'update', 'regeneratekey', 'recover', - * 'purge', 'backup', 'restore', 'setsas', 'listsas', 'getsas', 'deletesas' + * Possible values include: 'all', 'get', 'list', 'delete', 'set', 'update', 'regeneratekey', + * 'recover', 'purge', 'backup', 'restore', 'setsas', 'listsas', 'getsas', 'deletesas' * @readonly * @enum {string} */ -export type StoragePermissions = 'get' | 'list' | 'delete' | 'set' | 'update' | 'regeneratekey' | 'recover' | 'purge' | 'backup' | 'restore' | 'setsas' | 'listsas' | 'getsas' | 'deletesas'; +export type StoragePermissions = 'all' | 'get' | 'list' | 'delete' | 'set' | 'update' | 'regeneratekey' | 'recover' | 'purge' | 'backup' | 'restore' | 'setsas' | 'listsas' | 'getsas' | 'deletesas'; /** * Defines values for CreateMode. @@ -663,6 +1018,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 +1043,40 @@ export type NetworkRuleAction = 'Allow' | 'Deny'; */ export type Reason = 'AccountNameInvalid' | 'AlreadyExists'; +/** + * Defines values for DeletionRecoveryLevel. + * Possible values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' + * @readonly + * @enum {string} + */ +export type DeletionRecoveryLevel = 'Purgeable' | 'Recoverable+Purgeable' | 'Recoverable' | 'Recoverable+ProtectedSubscription'; + +/** + * Defines values for JsonWebKeyType. + * Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM' + * @readonly + * @enum {string} + */ +export type JsonWebKeyType = 'EC' | 'EC-HSM' | 'RSA' | 'RSA-HSM'; + +/** + * Defines values for JsonWebKeyOperation. + * Possible values include: 'encrypt', 'decrypt', 'sign', 'verify', 'wrapKey', 'unwrapKey', + * 'import' + * @readonly + * @enum {string} + */ +export type JsonWebKeyOperation = 'encrypt' | 'decrypt' | 'sign' | 'verify' | 'wrapKey' | 'unwrapKey' | 'import'; + +/** + * Defines values for JsonWebKeyCurveName. + * Possible values include: 'P-256', 'P-384', 'P-521', 'P-256K' + * @readonly + * @enum {string} + */ +export type JsonWebKeyCurveName = 'P-256' | 'P-384' | 'P-521' | 'P-256K'; + /** * Defines values for AccessPolicyUpdateKind. * Possible values include: 'add', 'replace', 'remove' @@ -979,6 +1385,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 +1514,143 @@ export type OperationsListNextResponse = OperationListResult & { parsedBody: OperationListResult; }; }; + +/** + * Contains response data for the createIfNotExist operation. + */ +export type KeysCreateIfNotExistResponse = Key & { + /** + * 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: Key; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type KeysGetResponse = Key & { + /** + * 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: Key; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type KeysListResponse = KeyListResult & { + /** + * 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: KeyListResult; + }; +}; + +/** + * Contains response data for the getVersion operation. + */ +export type KeysGetVersionResponse = Key & { + /** + * 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: Key; + }; +}; + +/** + * Contains response data for the listVersions operation. + */ +export type KeysListVersionsResponse = KeyListResult & { + /** + * 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: KeyListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type KeysListNextResponse = KeyListResult & { + /** + * 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: KeyListResult; + }; +}; + +/** + * Contains response data for the listVersionsNext operation. + */ +export type KeysListVersionsNextResponse = KeyListResult & { + /** + * 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: KeyListResult; + }; +}; diff --git a/sdk/keyvault/arm-keyvault/src/models/keysMappers.ts b/sdk/keyvault/arm-keyvault/src/models/keysMappers.ts new file mode 100644 index 000000000000..7399888709a9 --- /dev/null +++ b/sdk/keyvault/arm-keyvault/src/models/keysMappers.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + AccessPolicyEntry, + Attributes, + BaseResource, + CloudError, + IPRule, + Key, + KeyAttributes, + KeyCreateParameters, + KeyListResult, + KeyProperties, + 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..aa343e392962 100644 --- a/sdk/keyvault/arm-keyvault/src/models/mappers.ts +++ b/sdk/keyvault/arm-keyvault/src/models/mappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -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,267 @@ export const Operation: msRest.CompositeMapper = { } }; +export const Attributes: msRest.CompositeMapper = { + serializedName: "Attributes", + type: { + name: "Composite", + className: "Attributes", + modelProperties: { + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + }, + notBefore: { + serializedName: "nbf", + type: { + name: "Number" + } + }, + expires: { + serializedName: "exp", + type: { + name: "Number" + } + }, + created: { + readOnly: true, + serializedName: "created", + type: { + name: "Number" + } + }, + updated: { + readOnly: true, + serializedName: "updated", + type: { + name: "Number" + } + }, + recoveryLevel: { + nullable: false, + readOnly: true, + serializedName: "recoveryLevel", + type: { + name: "String" + } + } + } + } +}; + +export const KeyAttributes: msRest.CompositeMapper = { + serializedName: "KeyAttributes", + type: { + name: "Composite", + className: "KeyAttributes", + modelProperties: { + ...Attributes.type.modelProperties + } + } +}; + +export const KeyProperties: msRest.CompositeMapper = { + serializedName: "KeyProperties", + type: { + name: "Composite", + className: "KeyProperties", + modelProperties: { + attributes: { + serializedName: "attributes", + type: { + name: "Composite", + className: "KeyAttributes" + } + }, + kty: { + serializedName: "kty", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + }, + keyOps: { + serializedName: "keyOps", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + keySize: { + serializedName: "keySize", + type: { + name: "Number" + } + }, + curveName: { + serializedName: "curveName", + type: { + name: "String" + } + }, + keyUri: { + readOnly: true, + serializedName: "keyUri", + type: { + name: "String" + } + }, + keyUriWithVersion: { + readOnly: true, + serializedName: "keyUriWithVersion", + type: { + name: "String" + } + } + } + } +}; + +export const KeyCreateParameters: msRest.CompositeMapper = { + serializedName: "KeyCreateParameters", + type: { + name: "Composite", + className: "KeyCreateParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + properties: { + required: true, + serializedName: "properties", + type: { + name: "Composite", + className: "KeyProperties" + } + } + } + } +}; + +export const Key: msRest.CompositeMapper = { + serializedName: "Key", + type: { + name: "Composite", + className: "Key", + modelProperties: { + ...Resource.type.modelProperties, + attributes: { + serializedName: "properties.attributes", + type: { + name: "Composite", + className: "KeyAttributes" + } + }, + kty: { + serializedName: "properties.kty", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + }, + keyOps: { + serializedName: "properties.keyOps", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + keySize: { + serializedName: "properties.keySize", + type: { + name: "Number" + } + }, + curveName: { + serializedName: "properties.curveName", + type: { + name: "String" + } + }, + keyUri: { + readOnly: true, + serializedName: "properties.keyUri", + type: { + name: "String" + } + }, + keyUriWithVersion: { + readOnly: true, + serializedName: "properties.keyUriWithVersion", + type: { + name: "String" + } + } + } + } +}; + +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 +1477,31 @@ export const OperationListResult: msRest.CompositeMapper = { } } }; + +export const KeyListResult: msRest.CompositeMapper = { + serializedName: "KeyListResult", + type: { + name: "Composite", + className: "KeyListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Key" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/keyvault/arm-keyvault/src/models/operationsMappers.ts b/sdk/keyvault/arm-keyvault/src/models/operationsMappers.ts index 9e480a46a87f..3ada863bb4f1 100644 --- a/sdk/keyvault/arm-keyvault/src/models/operationsMappers.ts +++ b/sdk/keyvault/arm-keyvault/src/models/operationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/sdk/keyvault/arm-keyvault/src/models/parameters.ts b/sdk/keyvault/arm-keyvault/src/models/parameters.ts index df134cdbf885..93ad57ab9315 100644 --- a/sdk/keyvault/arm-keyvault/src/models/parameters.ts +++ b/sdk/keyvault/arm-keyvault/src/models/parameters.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -54,6 +53,32 @@ export const filter: msRest.OperationQueryParameter = { } } }; +export const keyName: msRest.OperationURLParameter = { + parameterPath: "keyName", + mapper: { + required: true, + serializedName: "keyName", + constraints: { + Pattern: /^[a-zA-Z0-9-]{1,127}$/ + }, + type: { + name: "String" + } + } +}; +export const keyVersion: msRest.OperationURLParameter = { + parameterPath: "keyVersion", + mapper: { + required: true, + serializedName: "keyVersion", + constraints: { + Pattern: /^[a-fA-F0-9]{32}$/ + }, + type: { + name: "String" + } + } +}; export const location: msRest.OperationURLParameter = { parameterPath: "location", mapper: { @@ -90,6 +115,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..4fa67047e9a8 --- /dev/null +++ b/sdk/keyvault/arm-keyvault/src/models/privateEndpointConnectionsMappers.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + AccessPolicyEntry, + Attributes, + BaseResource, + CloudError, + IPRule, + Key, + KeyAttributes, + KeyCreateParameters, + KeyProperties, + 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..19f8aaa4069d --- /dev/null +++ b/sdk/keyvault/arm-keyvault/src/models/privateLinkResourcesMappers.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + AccessPolicyEntry, + Attributes, + BaseResource, + CloudError, + IPRule, + Key, + KeyAttributes, + KeyCreateParameters, + KeyProperties, + 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..90567bcc8e16 100644 --- a/sdk/keyvault/arm-keyvault/src/models/vaultsMappers.ts +++ b/sdk/keyvault/arm-keyvault/src/models/vaultsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -8,6 +8,7 @@ export { AccessPolicyEntry, + Attributes, BaseResource, CheckNameAvailabilityResult, CloudError, @@ -15,8 +16,17 @@ export { DeletedVaultListResult, DeletedVaultProperties, IPRule, + Key, + KeyAttributes, + KeyCreateParameters, + KeyProperties, 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..528e6e3feeda 100644 --- a/sdk/keyvault/arm-keyvault/src/operations/index.ts +++ b/sdk/keyvault/arm-keyvault/src/operations/index.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -9,4 +8,7 @@ */ export * from "./vaults"; +export * from "./privateEndpointConnections"; +export * from "./privateLinkResources"; export * from "./operations"; +export * from "./keys"; diff --git a/sdk/keyvault/arm-keyvault/src/operations/keys.ts b/sdk/keyvault/arm-keyvault/src/operations/keys.ts new file mode 100644 index 000000000000..9ed30fe9a450 --- /dev/null +++ b/sdk/keyvault/arm-keyvault/src/operations/keys.ts @@ -0,0 +1,456 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/keysMappers"; +import * as Parameters from "../models/parameters"; +import { KeyVaultManagementClientContext } from "../keyVaultManagementClientContext"; + +/** Class representing a Keys. */ +export class Keys { + private readonly client: KeyVaultManagementClientContext; + + /** + * Create a Keys. + * @param {KeyVaultManagementClientContext} client Reference to the service client. + */ + constructor(client: KeyVaultManagementClientContext) { + this.client = client; + } + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the + * existing key is returned without any write operations being performed. This API does not create + * subsequent versions, and does not update existing keys. + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the key vault which contains the key to be created. + * @param keyName The name of the key to be created. + * @param parameters The parameters used to create the specified key. + * @param [options] The optional parameters + * @returns Promise + */ + createIfNotExist(resourceGroupName: string, vaultName: string, keyName: string, parameters: Models.KeyCreateParameters, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the key vault which contains the key to be created. + * @param keyName The name of the key to be created. + * @param parameters The parameters used to create the specified key. + * @param callback The callback + */ + createIfNotExist(resourceGroupName: string, vaultName: string, keyName: string, parameters: Models.KeyCreateParameters, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the key vault which contains the key to be created. + * @param keyName The name of the key to be created. + * @param parameters The parameters used to create the specified key. + * @param options The optional parameters + * @param callback The callback + */ + createIfNotExist(resourceGroupName: string, vaultName: string, keyName: string, parameters: Models.KeyCreateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createIfNotExist(resourceGroupName: string, vaultName: string, keyName: string, parameters: Models.KeyCreateParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + vaultName, + keyName, + parameters, + options + }, + createIfNotExistOperationSpec, + callback) as Promise; + } + + /** + * Gets the current version of the specified key from the specified key vault. + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, vaultName: string, keyName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @param callback The callback + */ + get(resourceGroupName: string, vaultName: string, keyName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, vaultName: string, keyName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, vaultName: string, keyName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + vaultName, + keyName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Lists the keys in the specified key vault. + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, vaultName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @param callback The callback + */ + list(resourceGroupName: string, vaultName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, vaultName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, vaultName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + vaultName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Gets the specified version of the specified key in the specified key vault. + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @param [options] The optional parameters + * @returns Promise + */ + getVersion(resourceGroupName: string, vaultName: string, keyName: string, keyVersion: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @param callback The callback + */ + getVersion(resourceGroupName: string, vaultName: string, keyName: string, keyVersion: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @param options The optional parameters + * @param callback The callback + */ + getVersion(resourceGroupName: string, vaultName: string, keyName: string, keyVersion: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getVersion(resourceGroupName: string, vaultName: string, keyName: string, keyVersion: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + vaultName, + keyName, + keyVersion, + options + }, + getVersionOperationSpec, + callback) as Promise; + } + + /** + * Lists the versions of the specified key in the specified key vault. + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @param [options] The optional parameters + * @returns Promise + */ + listVersions(resourceGroupName: string, vaultName: string, keyName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @param callback The callback + */ + listVersions(resourceGroupName: string, vaultName: string, keyName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @param options The optional parameters + * @param callback The callback + */ + listVersions(resourceGroupName: string, vaultName: string, keyName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listVersions(resourceGroupName: string, vaultName: string, keyName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + vaultName, + keyName, + options + }, + listVersionsOperationSpec, + callback) as Promise; + } + + /** + * Lists the keys in the specified key vault. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } + + /** + * Lists the versions of the specified key in the specified key vault. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listVersionsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listVersionsNext(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 + */ + listVersionsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listVersionsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listVersionsNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const createIfNotExistOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys/{keyName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName0, + Parameters.keyName + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.KeyCreateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Key + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys/{keyName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName0, + Parameters.keyName + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Key + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName0 + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.KeyListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getVersionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys/{keyName}/versions/{keyVersion}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName0, + Parameters.keyName, + Parameters.keyVersion + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Key + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listVersionsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys/{keyName}/versions", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.vaultName0, + Parameters.keyName + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.KeyListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.KeyListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listVersionsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.KeyListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/keyvault/arm-keyvault/src/operations/operations.ts b/sdk/keyvault/arm-keyvault/src/operations/operations.ts index 56cd43eb33ca..aa0c5c62b317 100644 --- a/sdk/keyvault/arm-keyvault/src/operations/operations.ts +++ b/sdk/keyvault/arm-keyvault/src/operations/operations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -108,6 +107,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion0 + ], headerParameters: [ Parameters.acceptLanguage ], 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..c0314d28ad70 --- /dev/null +++ b/sdk/keyvault/arm-keyvault/src/operations/privateEndpointConnections.ts @@ -0,0 +1,242 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * 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..cca698e0dc3d --- /dev/null +++ b/sdk/keyvault/arm-keyvault/src/operations/privateLinkResources.ts @@ -0,0 +1,86 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * 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..897d89012718 100644 --- a/sdk/keyvault/arm-keyvault/src/operations/vaults.ts +++ b/sdk/keyvault/arm-keyvault/src/operations/vaults.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -398,7 +397,7 @@ export class Vaults { * @param [options] The optional parameters * @returns Promise */ - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listByResourceGroupNext(nextPageLink: string, options?: Models.VaultsListByResourceGroupNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -409,8 +408,8 @@ export class Vaults { * @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 { + listByResourceGroupNext(nextPageLink: string, options: Models.VaultsListByResourceGroupNextOptionalParams, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: Models.VaultsListByResourceGroupNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -426,7 +425,7 @@ export class Vaults { * @param [options] The optional parameters * @returns Promise */ - listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listBySubscriptionNext(nextPageLink: string, options?: Models.VaultsListBySubscriptionNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -437,8 +436,8 @@ export class Vaults { * @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 { + listBySubscriptionNext(nextPageLink: string, options: Models.VaultsListBySubscriptionNextOptionalParams, callback: msRest.ServiceCallback): void; + listBySubscriptionNext(nextPageLink: string, options?: Models.VaultsListBySubscriptionNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -482,7 +481,7 @@ export class Vaults { * @param [options] The optional parameters * @returns Promise */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listNext(nextPageLink: string, options?: Models.VaultsListNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -493,8 +492,8 @@ export class Vaults { * @param options The optional parameters * @param callback The callback */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listNext(nextPageLink: string, options: Models.VaultsListNextOptionalParams, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: Models.VaultsListNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -558,6 +557,7 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { ], responses: { 200: {}, + 204: {}, default: { bodyMapper: Mappers.CloudError } @@ -844,6 +844,10 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.top, + Parameters.apiVersion0 + ], headerParameters: [ Parameters.acceptLanguage ], @@ -865,6 +869,10 @@ const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.top, + Parameters.apiVersion0 + ], headerParameters: [ Parameters.acceptLanguage ], @@ -886,6 +894,9 @@ const listDeletedNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion0 + ], headerParameters: [ Parameters.acceptLanguage ], @@ -907,6 +918,11 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.filter, + Parameters.top, + Parameters.apiVersion1 + ], headerParameters: [ Parameters.acceptLanguage ], 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