From 2d97617191ab6a4185b8469c206202ff07efadbd Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Fri, 26 Jun 2020 13:38:51 +0000 Subject: [PATCH 1/5] core to generated --- sdk/keyvault/keyvault-certificates/.eslintrc.json | 2 +- sdk/keyvault/keyvault-certificates/.prettierignore | 3 +-- sdk/keyvault/keyvault-certificates/package.json | 12 ------------ .../keyvault-certificates/src/certificatesModels.ts | 2 +- .../src/{core => generated}/clientOptions.ts | 0 .../src/{core => generated}/index.ts | 0 .../src/{core => generated}/keyVaultBase.ts | 0 .../src/{core => generated}/keyVaultClient.ts | 0 .../src/{core => generated}/keyVaultClientContext.ts | 0 .../src/{core => generated}/models/index.ts | 0 .../src/{core => generated}/models/mappers.ts | 0 .../src/{core => generated}/models/parameters.ts | 0 .../src/{core => generated}/utils.ts | 0 .../src/{core => generated}/utils/constants.ts | 0 sdk/keyvault/keyvault-certificates/src/index.ts | 8 ++++---- .../src/lro/create/operation.ts | 2 +- .../test/internal/userAgent.spec.ts | 4 ++-- sdk/keyvault/keyvault-certificates/typedoc.json | 2 +- 18 files changed, 11 insertions(+), 24 deletions(-) rename sdk/keyvault/keyvault-certificates/src/{core => generated}/clientOptions.ts (100%) rename sdk/keyvault/keyvault-certificates/src/{core => generated}/index.ts (100%) rename sdk/keyvault/keyvault-certificates/src/{core => generated}/keyVaultBase.ts (100%) rename sdk/keyvault/keyvault-certificates/src/{core => generated}/keyVaultClient.ts (100%) rename sdk/keyvault/keyvault-certificates/src/{core => generated}/keyVaultClientContext.ts (100%) rename sdk/keyvault/keyvault-certificates/src/{core => generated}/models/index.ts (100%) rename sdk/keyvault/keyvault-certificates/src/{core => generated}/models/mappers.ts (100%) rename sdk/keyvault/keyvault-certificates/src/{core => generated}/models/parameters.ts (100%) rename sdk/keyvault/keyvault-certificates/src/{core => generated}/utils.ts (100%) rename sdk/keyvault/keyvault-certificates/src/{core => generated}/utils/constants.ts (100%) diff --git a/sdk/keyvault/keyvault-certificates/.eslintrc.json b/sdk/keyvault/keyvault-certificates/.eslintrc.json index 4f409a486c3f..57874aa10492 100644 --- a/sdk/keyvault/keyvault-certificates/.eslintrc.json +++ b/sdk/keyvault/keyvault-certificates/.eslintrc.json @@ -1,7 +1,7 @@ { "plugins": ["@azure/azure-sdk"], "extends": ["plugin:@azure/azure-sdk/azure-sdk-base"], - "ignorePatterns": ["src/core"], + "ignorePatterns": ["src/generated"], "rules": { "@typescript-eslint/no-this-alias": "off", "no-invalid-this": "off", diff --git a/sdk/keyvault/keyvault-certificates/.prettierignore b/sdk/keyvault/keyvault-certificates/.prettierignore index 656f37824af2..ede107590808 100644 --- a/sdk/keyvault/keyvault-certificates/.prettierignore +++ b/sdk/keyvault/keyvault-certificates/.prettierignore @@ -1,2 +1 @@ -/src/core/* -!/src/core/challengeBasedAuthenticationPolicy.ts \ No newline at end of file +/src/generated/* diff --git a/sdk/keyvault/keyvault-certificates/package.json b/sdk/keyvault/keyvault-certificates/package.json index e9d7ef3fe693..c07b8014a89e 100644 --- a/sdk/keyvault/keyvault-certificates/package.json +++ b/sdk/keyvault/keyvault-certificates/package.json @@ -72,18 +72,6 @@ "unit-test": "npm run unit-test:node && npm run unit-test:browser" }, "sideEffects": false, - "//metadata": { - "constantPaths": [ - { - "path": "src/core/keyVaultClientContext.ts", - "prefix": "packageVersion" - }, - { - "path": "src/core/utils/constants.ts", - "prefix": "SDK_VERSION" - } - ] - }, "dependencies": { "@azure/abort-controller": "^1.0.0", "@azure/core-http": "^1.1.1", diff --git a/sdk/keyvault/keyvault-certificates/src/certificatesModels.ts b/sdk/keyvault/keyvault-certificates/src/certificatesModels.ts index f784a2d90263..98e6d6bc07ed 100644 --- a/sdk/keyvault/keyvault-certificates/src/certificatesModels.ts +++ b/sdk/keyvault/keyvault-certificates/src/certificatesModels.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import * as coreHttp from "@azure/core-http"; -import { DeletionRecoveryLevel, KeyUsageType } from "./core/models"; +import { DeletionRecoveryLevel, KeyUsageType } from "./generated/models"; /** * Defines values for CertificateKeyType. diff --git a/sdk/keyvault/keyvault-certificates/src/core/clientOptions.ts b/sdk/keyvault/keyvault-certificates/src/generated/clientOptions.ts similarity index 100% rename from sdk/keyvault/keyvault-certificates/src/core/clientOptions.ts rename to sdk/keyvault/keyvault-certificates/src/generated/clientOptions.ts diff --git a/sdk/keyvault/keyvault-certificates/src/core/index.ts b/sdk/keyvault/keyvault-certificates/src/generated/index.ts similarity index 100% rename from sdk/keyvault/keyvault-certificates/src/core/index.ts rename to sdk/keyvault/keyvault-certificates/src/generated/index.ts diff --git a/sdk/keyvault/keyvault-certificates/src/core/keyVaultBase.ts b/sdk/keyvault/keyvault-certificates/src/generated/keyVaultBase.ts similarity index 100% rename from sdk/keyvault/keyvault-certificates/src/core/keyVaultBase.ts rename to sdk/keyvault/keyvault-certificates/src/generated/keyVaultBase.ts diff --git a/sdk/keyvault/keyvault-certificates/src/core/keyVaultClient.ts b/sdk/keyvault/keyvault-certificates/src/generated/keyVaultClient.ts similarity index 100% rename from sdk/keyvault/keyvault-certificates/src/core/keyVaultClient.ts rename to sdk/keyvault/keyvault-certificates/src/generated/keyVaultClient.ts diff --git a/sdk/keyvault/keyvault-certificates/src/core/keyVaultClientContext.ts b/sdk/keyvault/keyvault-certificates/src/generated/keyVaultClientContext.ts similarity index 100% rename from sdk/keyvault/keyvault-certificates/src/core/keyVaultClientContext.ts rename to sdk/keyvault/keyvault-certificates/src/generated/keyVaultClientContext.ts diff --git a/sdk/keyvault/keyvault-certificates/src/core/models/index.ts b/sdk/keyvault/keyvault-certificates/src/generated/models/index.ts similarity index 100% rename from sdk/keyvault/keyvault-certificates/src/core/models/index.ts rename to sdk/keyvault/keyvault-certificates/src/generated/models/index.ts diff --git a/sdk/keyvault/keyvault-certificates/src/core/models/mappers.ts b/sdk/keyvault/keyvault-certificates/src/generated/models/mappers.ts similarity index 100% rename from sdk/keyvault/keyvault-certificates/src/core/models/mappers.ts rename to sdk/keyvault/keyvault-certificates/src/generated/models/mappers.ts diff --git a/sdk/keyvault/keyvault-certificates/src/core/models/parameters.ts b/sdk/keyvault/keyvault-certificates/src/generated/models/parameters.ts similarity index 100% rename from sdk/keyvault/keyvault-certificates/src/core/models/parameters.ts rename to sdk/keyvault/keyvault-certificates/src/generated/models/parameters.ts diff --git a/sdk/keyvault/keyvault-certificates/src/core/utils.ts b/sdk/keyvault/keyvault-certificates/src/generated/utils.ts similarity index 100% rename from sdk/keyvault/keyvault-certificates/src/core/utils.ts rename to sdk/keyvault/keyvault-certificates/src/generated/utils.ts diff --git a/sdk/keyvault/keyvault-certificates/src/core/utils/constants.ts b/sdk/keyvault/keyvault-certificates/src/generated/utils/constants.ts similarity index 100% rename from sdk/keyvault/keyvault-certificates/src/core/utils/constants.ts rename to sdk/keyvault/keyvault-certificates/src/generated/utils/constants.ts diff --git a/sdk/keyvault/keyvault-certificates/src/index.ts b/sdk/keyvault/keyvault-certificates/src/index.ts index af0b9bd5611b..fa99fce5b05a 100644 --- a/sdk/keyvault/keyvault-certificates/src/index.ts +++ b/sdk/keyvault/keyvault-certificates/src/index.ts @@ -136,10 +136,10 @@ import { CertificateAttributes, Contacts as CoreContacts, IssuerBundle -} from "./core/models"; -import { KeyVaultClient } from "./core/keyVaultClient"; -import { SDK_VERSION } from "./core/utils/constants"; -import { parseKeyvaultIdentifier as parseKeyvaultEntityIdentifier } from "./core/utils"; +} from "./generated/models"; +import { KeyVaultClient } from "./generated/keyVaultClient"; +import { SDK_VERSION } from "./generated/utils/constants"; +import { parseKeyvaultIdentifier as parseKeyvaultEntityIdentifier } from "./generated/utils"; import "@azure/core-paging"; import { PageSettings, PagedAsyncIterableIterator } from "@azure/core-paging"; import { challengeBasedAuthenticationPolicy } from "../../keyvault-common/src"; diff --git a/sdk/keyvault/keyvault-certificates/src/lro/create/operation.ts b/sdk/keyvault/keyvault-certificates/src/lro/create/operation.ts index cd9eed521c4e..601a62779d9d 100644 --- a/sdk/keyvault/keyvault-certificates/src/lro/create/operation.ts +++ b/sdk/keyvault/keyvault-certificates/src/lro/create/operation.ts @@ -10,7 +10,7 @@ import { CertificatePolicy, CertificateClientInterface } from "../../certificatesModels"; -import { CertificateOperation } from "../../core/models"; +import { CertificateOperation } from "../../generated/models"; /** * The public representation of the CreateCertificatePoller operation state. diff --git a/sdk/keyvault/keyvault-certificates/test/internal/userAgent.spec.ts b/sdk/keyvault/keyvault-certificates/test/internal/userAgent.spec.ts index b8758871c0e4..8ec7965324f5 100644 --- a/sdk/keyvault/keyvault-certificates/test/internal/userAgent.spec.ts +++ b/sdk/keyvault/keyvault-certificates/test/internal/userAgent.spec.ts @@ -3,8 +3,8 @@ import * as assert from "assert"; import { version } from "../../package.json"; -import { SDK_VERSION } from "../../src/core/utils/constants"; -import { packageVersion } from "../../src/core/keyVaultClientContext"; +import { SDK_VERSION } from "../../src/generated/utils/constants"; +import { packageVersion } from "../../src/generated/keyVaultClientContext"; describe("Certificates client's user agent", () => { // The tests follow diff --git a/sdk/keyvault/keyvault-certificates/typedoc.json b/sdk/keyvault/keyvault-certificates/typedoc.json index e2d6a7a75854..ee712dc67f39 100644 --- a/sdk/keyvault/keyvault-certificates/typedoc.json +++ b/sdk/keyvault/keyvault-certificates/typedoc.json @@ -3,6 +3,6 @@ "out": "../../../docGen/keyvault-certificates", "excludeNotExported": true, "excludePrivate": true, - "exclude": ["node_modules/**/*", "src/core/**/*"], + "exclude": ["node_modules/**/*", "src/generated/**/*"], "ignoreCompilerErrors": true } From 188b25132bf99a92c227305c23b4822226b88ef2 Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Fri, 26 Jun 2020 13:40:46 +0000 Subject: [PATCH 2/5] swagger config updates --- sdk/keyvault/keyvault-certificates/package.json | 2 +- sdk/keyvault/keyvault-certificates/swagger/README.md | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sdk/keyvault/keyvault-certificates/package.json b/sdk/keyvault/keyvault-certificates/package.json index c07b8014a89e..74472e469c2c 100644 --- a/sdk/keyvault/keyvault-certificates/package.json +++ b/sdk/keyvault/keyvault-certificates/package.json @@ -62,7 +62,7 @@ "lint:terminal": "eslint package.json api-extractor.json src test --ext .ts", "pack": "npm pack 2>&1", "prebuild": "npm run clean", - "regenerate": "npx autorest swagger/README.md --typescript", + "regenerate": "npx autorest swagger/README.md --typescript --version=3.0.6267", "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser", "test:node": "npm run clean && npm run build:test && npm run unit-test:node", "test": "npm run clean && npm run build:test && npm run unit-test", diff --git a/sdk/keyvault/keyvault-certificates/swagger/README.md b/sdk/keyvault/keyvault-certificates/swagger/README.md index 0bc3be4ea30a..b8197dadfccc 100644 --- a/sdk/keyvault/keyvault-certificates/swagger/README.md +++ b/sdk/keyvault/keyvault-certificates/swagger/README.md @@ -3,15 +3,14 @@ > see https://aka.ms/autorest ``` yaml -typescript: - package-name: "@azure/keyvault-certificates" +package-name: "@azure/keyvault-certificates" use-extension: - "@microsoft.azure/autorest.typescript": "~5.0.1" + "@autorest/typescript": "6.0.0-dev.20200623.2" azure-arm: false generate-metadata: false add-credentials: false license-header: MICROSOFT_MIT_NO_VERSION -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.1/certificates.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.2-preview/certificates.json output-folder: ../ -source-code-folder-path: ./src/core +source-code-folder-path: ./src/generated ``` From 48839fa489ddc8868fc63946f63c7f37d8a2639f Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Fri, 26 Jun 2020 13:43:06 +0000 Subject: [PATCH 3/5] new generated code --- .../src/generated/keyVaultClient.ts | 1880 +++++++---------- .../src/generated/keyVaultClientContext.ts | 28 +- .../src/generated/models/index.ts | 1737 ++++++++------- .../src/generated/models/mappers.ts | 1079 +++++----- .../src/generated/models/parameters.ts | 181 +- 5 files changed, 2225 insertions(+), 2680 deletions(-) diff --git a/sdk/keyvault/keyvault-certificates/src/generated/keyVaultClient.ts b/sdk/keyvault/keyvault-certificates/src/generated/keyVaultClient.ts index c63e4d8ff7f9..20aabec5dbce 100644 --- a/sdk/keyvault/keyvault-certificates/src/generated/keyVaultClient.ts +++ b/sdk/keyvault/keyvault-certificates/src/generated/keyVaultClient.ts @@ -1,992 +1,775 @@ /* - * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ import * as coreHttp from "@azure/core-http"; +import * as Parameters from "./models/parameters"; import * as Models from "./models"; import * as Mappers from "./models/mappers"; -import * as Parameters from "./models/parameters"; import { KeyVaultClientContext } from "./keyVaultClientContext"; +import { + KeyVaultClientOptionalParams, + KeyVaultClientGetCertificatesOptionalParams, + KeyVaultClientGetCertificatesResponse, + KeyVaultClientDeleteCertificateResponse, + Contacts, + KeyVaultClientSetCertificateContactsResponse, + KeyVaultClientGetCertificateContactsResponse, + KeyVaultClientDeleteCertificateContactsResponse, + KeyVaultClientGetCertificateIssuersOptionalParams, + KeyVaultClientGetCertificateIssuersResponse, + CertificateIssuerSetParameters, + KeyVaultClientSetCertificateIssuerResponse, + CertificateIssuerUpdateParameters, + KeyVaultClientUpdateCertificateIssuerResponse, + KeyVaultClientGetCertificateIssuerResponse, + KeyVaultClientDeleteCertificateIssuerResponse, + CertificateCreateParameters, + KeyVaultClientCreateCertificateResponse, + CertificateImportParameters, + KeyVaultClientImportCertificateResponse, + KeyVaultClientGetCertificateVersionsOptionalParams, + KeyVaultClientGetCertificateVersionsResponse, + KeyVaultClientGetCertificatePolicyResponse, + CertificatePolicy, + KeyVaultClientUpdateCertificatePolicyResponse, + CertificateUpdateParameters, + KeyVaultClientUpdateCertificateResponse, + KeyVaultClientGetCertificateResponse, + CertificateOperationUpdateParameter, + KeyVaultClientUpdateCertificateOperationResponse, + KeyVaultClientGetCertificateOperationResponse, + KeyVaultClientDeleteCertificateOperationResponse, + CertificateMergeParameters, + KeyVaultClientMergeCertificateResponse, + KeyVaultClientBackupCertificateResponse, + CertificateRestoreParameters, + KeyVaultClientRestoreCertificateResponse, + KeyVaultClientGetDeletedCertificatesOptionalParams, + KeyVaultClientGetDeletedCertificatesResponse, + KeyVaultClientGetDeletedCertificateResponse, + KeyVaultClientRecoverDeletedCertificateResponse, + KeyVaultClientGetCertificatesNextOptionalParams, + KeyVaultClientGetCertificatesNextResponse, + KeyVaultClientGetCertificateIssuersNextOptionalParams, + KeyVaultClientGetCertificateIssuersNextResponse, + KeyVaultClientGetCertificateVersionsNextOptionalParams, + KeyVaultClientGetCertificateVersionsNextResponse, + KeyVaultClientGetDeletedCertificatesNextOptionalParams, + KeyVaultClientGetDeletedCertificatesNextResponse +} from "./models"; class KeyVaultClient extends KeyVaultClientContext { /** * Initializes a new instance of the KeyVaultClient class. - * @param apiVersion Client API version. - * @param [options] The parameter options + * @param options The parameter options */ - constructor(apiVersion: string, options?: coreHttp.ServiceClientOptions) { - super(apiVersion, options); + constructor(options?: KeyVaultClientOptionalParams) { + super(options); } /** - * The GetCertificates operation returns the set of certificates resources in the specified key - * vault. This operation requires the certificates/list permission. - * @summary List certificates in a specified key vault - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param [options] The optional parameters - * @returns Promise - */ - getCertificates(vaultBaseUrl: string, options?: Models.KeyVaultClientGetCertificatesOptionalParams): Promise; - /** + * The GetCertificates operation returns the set of certificates resources in the specified key vault. + * This operation requires the certificates/list permission. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param callback The callback + * @param options The options parameters. */ - getCertificates(vaultBaseUrl: string, callback: coreHttp.ServiceCallback): void; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param options The optional parameters - * @param callback The callback - */ - getCertificates(vaultBaseUrl: string, options: Models.KeyVaultClientGetCertificatesOptionalParams, callback: coreHttp.ServiceCallback): void; - getCertificates(vaultBaseUrl: string, options?: Models.KeyVaultClientGetCertificatesOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + getCertificates( + vaultBaseUrl: string, + options?: KeyVaultClientGetCertificatesOptionalParams + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - options - }, - getCertificatesOperationSpec, - callback) as Promise; + { vaultBaseUrl, options: operationOptions }, + getCertificatesOperationSpec + ) as Promise; } /** - * Deletes all versions of a certificate object along with its associated policy. Delete - * certificate cannot be used to remove individual versions of a certificate object. This operation - * requires the certificates/delete permission. - * @summary Deletes a certificate from a specified key vault. + * Deletes all versions of a certificate object along with its associated policy. Delete certificate + * cannot be used to remove individual versions of a certificate object. This operation requires the + * certificates/delete permission. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param certificateName The name of the certificate. - * @param [options] The optional parameters - * @returns Promise - */ - deleteCertificate(vaultBaseUrl: string, certificateName: string, options?: coreHttp.RequestOptionsBase): Promise; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate. - * @param callback The callback - */ - deleteCertificate(vaultBaseUrl: string, certificateName: string, callback: coreHttp.ServiceCallback): void; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate. - * @param options The optional parameters - * @param callback The callback - */ - deleteCertificate(vaultBaseUrl: string, certificateName: string, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - deleteCertificate(vaultBaseUrl: string, certificateName: string, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + * @param options The options parameters. + */ + deleteCertificate( + vaultBaseUrl: string, + certificateName: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - certificateName, - options - }, - deleteCertificateOperationSpec, - callback) as Promise; + { vaultBaseUrl, certificateName, options: operationOptions }, + deleteCertificateOperationSpec + ) as Promise; } /** * Sets the certificate contacts for the specified key vault. This operation requires the * certificates/managecontacts permission. - * @summary Sets the certificate contacts for the specified key vault. - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param contacts The contacts for the key vault certificate. - * @param [options] The optional parameters - * @returns Promise - */ - setCertificateContacts(vaultBaseUrl: string, contacts: Models.Contacts, options?: coreHttp.RequestOptionsBase): Promise; - /** * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param contacts The contacts for the key vault certificate. - * @param callback The callback - */ - setCertificateContacts(vaultBaseUrl: string, contacts: Models.Contacts, callback: coreHttp.ServiceCallback): void; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param contacts The contacts for the key vault certificate. - * @param options The optional parameters - * @param callback The callback - */ - setCertificateContacts(vaultBaseUrl: string, contacts: Models.Contacts, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - setCertificateContacts(vaultBaseUrl: string, contacts: Models.Contacts, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + * @param options The options parameters. + */ + setCertificateContacts( + vaultBaseUrl: string, + contacts: Contacts, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - contacts, - options - }, - setCertificateContactsOperationSpec, - callback) as Promise; + { vaultBaseUrl, contacts, options: operationOptions }, + setCertificateContactsOperationSpec + ) as Promise; } /** * The GetCertificateContacts operation returns the set of certificate contact resources in the * specified key vault. This operation requires the certificates/managecontacts permission. - * @summary Lists the certificate contacts for a specified key vault. - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param [options] The optional parameters - * @returns Promise - */ - getCertificateContacts(vaultBaseUrl: string, options?: coreHttp.RequestOptionsBase): Promise; - /** * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param callback The callback + * @param options The options parameters. */ - getCertificateContacts(vaultBaseUrl: string, callback: coreHttp.ServiceCallback): void; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param options The optional parameters - * @param callback The callback - */ - getCertificateContacts(vaultBaseUrl: string, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - getCertificateContacts(vaultBaseUrl: string, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + getCertificateContacts( + vaultBaseUrl: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - options - }, - getCertificateContactsOperationSpec, - callback) as Promise; + { vaultBaseUrl, options: operationOptions }, + getCertificateContactsOperationSpec + ) as Promise; } /** - * Deletes the certificate contacts for a specified key vault certificate. This operation requires - * the certificates/managecontacts permission. - * @summary Deletes the certificate contacts for a specified key vault. - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param [options] The optional parameters - * @returns Promise - */ - deleteCertificateContacts(vaultBaseUrl: string, options?: coreHttp.RequestOptionsBase): Promise; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param callback The callback - */ - deleteCertificateContacts(vaultBaseUrl: string, callback: coreHttp.ServiceCallback): void; - /** + * Deletes the certificate contacts for a specified key vault certificate. This operation requires the + * certificates/managecontacts permission. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteCertificateContacts(vaultBaseUrl: string, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - deleteCertificateContacts(vaultBaseUrl: string, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + deleteCertificateContacts( + vaultBaseUrl: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - options - }, - deleteCertificateContactsOperationSpec, - callback) as Promise; + { vaultBaseUrl, options: operationOptions }, + deleteCertificateContactsOperationSpec + ) as Promise; } /** - * The GetCertificateIssuers operation returns the set of certificate issuer resources in the - * specified key vault. This operation requires the certificates/manageissuers/getissuers - * permission. - * @summary List certificate issuers for a specified key vault. + * The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified + * key vault. This operation requires the certificates/manageissuers/getissuers permission. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - getCertificateIssuers(vaultBaseUrl: string, options?: Models.KeyVaultClientGetCertificateIssuersOptionalParams): Promise; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param callback The callback - */ - getCertificateIssuers(vaultBaseUrl: string, callback: coreHttp.ServiceCallback): void; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param options The optional parameters - * @param callback The callback - */ - getCertificateIssuers(vaultBaseUrl: string, options: Models.KeyVaultClientGetCertificateIssuersOptionalParams, callback: coreHttp.ServiceCallback): void; - getCertificateIssuers(vaultBaseUrl: string, options?: Models.KeyVaultClientGetCertificateIssuersOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + getCertificateIssuers( + vaultBaseUrl: string, + options?: KeyVaultClientGetCertificateIssuersOptionalParams + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - options - }, - getCertificateIssuersOperationSpec, - callback) as Promise; + { vaultBaseUrl, options: operationOptions }, + getCertificateIssuersOperationSpec + ) as Promise; } /** - * The SetCertificateIssuer operation adds or updates the specified certificate issuer. This - * operation requires the certificates/setissuers permission. - * @summary Sets the specified certificate issuer. - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param issuerName The name of the issuer. - * @param provider The issuer provider. - * @param [options] The optional parameters - * @returns Promise - */ - setCertificateIssuer(vaultBaseUrl: string, issuerName: string, provider: string, options?: Models.KeyVaultClientSetCertificateIssuerOptionalParams): Promise; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param issuerName The name of the issuer. - * @param provider The issuer provider. - * @param callback The callback - */ - setCertificateIssuer(vaultBaseUrl: string, issuerName: string, provider: string, callback: coreHttp.ServiceCallback): void; - /** + * The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation + * requires the certificates/setissuers permission. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param issuerName The name of the issuer. - * @param provider The issuer provider. - * @param options The optional parameters - * @param callback The callback - */ - setCertificateIssuer(vaultBaseUrl: string, issuerName: string, provider: string, options: Models.KeyVaultClientSetCertificateIssuerOptionalParams, callback: coreHttp.ServiceCallback): void; - setCertificateIssuer(vaultBaseUrl: string, issuerName: string, provider: string, options?: Models.KeyVaultClientSetCertificateIssuerOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + * @param parameter Certificate issuer set parameter. + * @param options The options parameters. + */ + setCertificateIssuer( + vaultBaseUrl: string, + issuerName: string, + parameter: CertificateIssuerSetParameters, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - issuerName, - provider, - options - }, - setCertificateIssuerOperationSpec, - callback) as Promise; + { vaultBaseUrl, issuerName, parameter, options: operationOptions }, + setCertificateIssuerOperationSpec + ) as Promise; } /** - * The UpdateCertificateIssuer operation performs an update on the specified certificate issuer - * entity. This operation requires the certificates/setissuers permission. - * @summary Updates the specified certificate issuer. + * The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. + * This operation requires the certificates/setissuers permission. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param issuerName The name of the issuer. - * @param [options] The optional parameters - * @returns Promise - */ - updateCertificateIssuer(vaultBaseUrl: string, issuerName: string, options?: Models.KeyVaultClientUpdateCertificateIssuerOptionalParams): Promise; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param issuerName The name of the issuer. - * @param callback The callback - */ - updateCertificateIssuer(vaultBaseUrl: string, issuerName: string, callback: coreHttp.ServiceCallback): void; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param issuerName The name of the issuer. - * @param options The optional parameters - * @param callback The callback - */ - updateCertificateIssuer(vaultBaseUrl: string, issuerName: string, options: Models.KeyVaultClientUpdateCertificateIssuerOptionalParams, callback: coreHttp.ServiceCallback): void; - updateCertificateIssuer(vaultBaseUrl: string, issuerName: string, options?: Models.KeyVaultClientUpdateCertificateIssuerOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + * @param parameter Certificate issuer update parameter. + * @param options The options parameters. + */ + updateCertificateIssuer( + vaultBaseUrl: string, + issuerName: string, + parameter: CertificateIssuerUpdateParameters, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - issuerName, - options - }, - updateCertificateIssuerOperationSpec, - callback) as Promise; + { vaultBaseUrl, issuerName, parameter, options: operationOptions }, + updateCertificateIssuerOperationSpec + ) as Promise; } /** * The GetCertificateIssuer operation returns the specified certificate issuer resources in the - * specified key vault. This operation requires the certificates/manageissuers/getissuers - * permission. - * @summary Lists the specified certificate issuer. + * specified key vault. This operation requires the certificates/manageissuers/getissuers permission. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param issuerName The name of the issuer. - * @param [options] The optional parameters - * @returns Promise - */ - getCertificateIssuer(vaultBaseUrl: string, issuerName: string, options?: coreHttp.RequestOptionsBase): Promise; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param issuerName The name of the issuer. - * @param callback The callback - */ - getCertificateIssuer(vaultBaseUrl: string, issuerName: string, callback: coreHttp.ServiceCallback): void; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param issuerName The name of the issuer. - * @param options The optional parameters - * @param callback The callback - */ - getCertificateIssuer(vaultBaseUrl: string, issuerName: string, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - getCertificateIssuer(vaultBaseUrl: string, issuerName: string, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + * @param options The options parameters. + */ + getCertificateIssuer( + vaultBaseUrl: string, + issuerName: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - issuerName, - options - }, - getCertificateIssuerOperationSpec, - callback) as Promise; + { vaultBaseUrl, issuerName, options: operationOptions }, + getCertificateIssuerOperationSpec + ) as Promise; } /** - * The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from - * the vault. This operation requires the certificates/manageissuers/deleteissuers permission. - * @summary Deletes the specified certificate issuer. + * The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the + * vault. This operation requires the certificates/manageissuers/deleteissuers permission. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param issuerName The name of the issuer. - * @param [options] The optional parameters - * @returns Promise - */ - deleteCertificateIssuer(vaultBaseUrl: string, issuerName: string, options?: coreHttp.RequestOptionsBase): Promise; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param issuerName The name of the issuer. - * @param callback The callback - */ - deleteCertificateIssuer(vaultBaseUrl: string, issuerName: string, callback: coreHttp.ServiceCallback): void; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param issuerName The name of the issuer. - * @param options The optional parameters - * @param callback The callback - */ - deleteCertificateIssuer(vaultBaseUrl: string, issuerName: string, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - deleteCertificateIssuer(vaultBaseUrl: string, issuerName: string, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + * @param options The options parameters. + */ + deleteCertificateIssuer( + vaultBaseUrl: string, + issuerName: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - issuerName, - options - }, - deleteCertificateIssuerOperationSpec, - callback) as Promise; + { vaultBaseUrl, issuerName, options: operationOptions }, + deleteCertificateIssuerOperationSpec + ) as Promise; } /** * If this is the first version, the certificate resource is created. This operation requires the * certificates/create permission. - * @summary Creates a new certificate. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param certificateName The name of the certificate. - * @param [options] The optional parameters - * @returns Promise - */ - createCertificate(vaultBaseUrl: string, certificateName: string, options?: Models.KeyVaultClientCreateCertificateOptionalParams): Promise; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate. - * @param callback The callback - */ - createCertificate(vaultBaseUrl: string, certificateName: string, callback: coreHttp.ServiceCallback): void; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate. - * @param options The optional parameters - * @param callback The callback - */ - createCertificate(vaultBaseUrl: string, certificateName: string, options: Models.KeyVaultClientCreateCertificateOptionalParams, callback: coreHttp.ServiceCallback): void; - createCertificate(vaultBaseUrl: string, certificateName: string, options?: Models.KeyVaultClientCreateCertificateOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + * @param parameters The parameters to create a certificate. + * @param options The options parameters. + */ + createCertificate( + vaultBaseUrl: string, + certificateName: string, + parameters: CertificateCreateParameters, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - certificateName, - options - }, - createCertificateOperationSpec, - callback) as Promise; + { vaultBaseUrl, certificateName, parameters, options: operationOptions }, + createCertificateOperationSpec + ) as Promise; } /** * Imports an existing valid certificate, containing a private key, into Azure Key Vault. The - * certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM - * format the PEM file must contain the key as well as x509 certificates. This operation requires - * the certificates/import permission. - * @summary Imports a certificate into a specified key vault. - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate. - * @param base64EncodedCertificate Base64 encoded representation of the certificate object to - * import. This certificate needs to contain the private key. - * @param [options] The optional parameters - * @returns Promise - */ - importCertificate(vaultBaseUrl: string, certificateName: string, base64EncodedCertificate: string, options?: Models.KeyVaultClientImportCertificateOptionalParams): Promise; - /** + * certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format + * the PEM file must contain the key as well as x509 certificates. This operation requires the + * certificates/import permission. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param certificateName The name of the certificate. - * @param base64EncodedCertificate Base64 encoded representation of the certificate object to - * import. This certificate needs to contain the private key. - * @param callback The callback - */ - importCertificate(vaultBaseUrl: string, certificateName: string, base64EncodedCertificate: string, callback: coreHttp.ServiceCallback): void; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate. - * @param base64EncodedCertificate Base64 encoded representation of the certificate object to - * import. This certificate needs to contain the private key. - * @param options The optional parameters - * @param callback The callback - */ - importCertificate(vaultBaseUrl: string, certificateName: string, base64EncodedCertificate: string, options: Models.KeyVaultClientImportCertificateOptionalParams, callback: coreHttp.ServiceCallback): void; - importCertificate(vaultBaseUrl: string, certificateName: string, base64EncodedCertificate: string, options?: Models.KeyVaultClientImportCertificateOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + * @param parameters The parameters to import the certificate. + * @param options The options parameters. + */ + importCertificate( + vaultBaseUrl: string, + certificateName: string, + parameters: CertificateImportParameters, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - certificateName, - base64EncodedCertificate, - options - }, - importCertificateOperationSpec, - callback) as Promise; + { vaultBaseUrl, certificateName, parameters, options: operationOptions }, + importCertificateOperationSpec + ) as Promise; } /** * The GetCertificateVersions operation returns the versions of a certificate in the specified key * vault. This operation requires the certificates/list permission. - * @summary List the versions of a certificate. - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate. - * @param [options] The optional parameters - * @returns Promise - */ - getCertificateVersions(vaultBaseUrl: string, certificateName: string, options?: Models.KeyVaultClientGetCertificateVersionsOptionalParams): Promise; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate. - * @param callback The callback - */ - getCertificateVersions(vaultBaseUrl: string, certificateName: string, callback: coreHttp.ServiceCallback): void; - /** * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param certificateName The name of the certificate. - * @param options The optional parameters - * @param callback The callback - */ - getCertificateVersions(vaultBaseUrl: string, certificateName: string, options: Models.KeyVaultClientGetCertificateVersionsOptionalParams, callback: coreHttp.ServiceCallback): void; - getCertificateVersions(vaultBaseUrl: string, certificateName: string, options?: Models.KeyVaultClientGetCertificateVersionsOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + * @param options The options parameters. + */ + getCertificateVersions( + vaultBaseUrl: string, + certificateName: string, + options?: KeyVaultClientGetCertificateVersionsOptionalParams + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - certificateName, - options - }, - getCertificateVersionsOperationSpec, - callback) as Promise; + { vaultBaseUrl, certificateName, options: operationOptions }, + getCertificateVersionsOperationSpec + ) as Promise; } /** * The GetCertificatePolicy operation returns the specified certificate policy resources in the * specified key vault. This operation requires the certificates/get permission. - * @summary Lists the policy for a certificate. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param certificateName The name of the certificate in a given key vault. - * @param [options] The optional parameters - * @returns Promise - */ - getCertificatePolicy(vaultBaseUrl: string, certificateName: string, options?: coreHttp.RequestOptionsBase): Promise; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate in a given key vault. - * @param callback The callback - */ - getCertificatePolicy(vaultBaseUrl: string, certificateName: string, callback: coreHttp.ServiceCallback): void; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate in a given key vault. - * @param options The optional parameters - * @param callback The callback - */ - getCertificatePolicy(vaultBaseUrl: string, certificateName: string, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - getCertificatePolicy(vaultBaseUrl: string, certificateName: string, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + * @param options The options parameters. + */ + getCertificatePolicy( + vaultBaseUrl: string, + certificateName: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - certificateName, - options - }, - getCertificatePolicyOperationSpec, - callback) as Promise; + { vaultBaseUrl, certificateName, options: operationOptions }, + getCertificatePolicyOperationSpec + ) as Promise; } /** - * Set specified members in the certificate policy. Leave others as null. This operation requires - * the certificates/update permission. - * @summary Updates the policy for a certificate. - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate in the given vault. - * @param certificatePolicy The policy for the certificate. - * @param [options] The optional parameters - * @returns Promise - */ - updateCertificatePolicy(vaultBaseUrl: string, certificateName: string, certificatePolicy: Models.CertificatePolicy, options?: coreHttp.RequestOptionsBase): Promise; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate in the given vault. - * @param certificatePolicy The policy for the certificate. - * @param callback The callback - */ - updateCertificatePolicy(vaultBaseUrl: string, certificateName: string, certificatePolicy: Models.CertificatePolicy, callback: coreHttp.ServiceCallback): void; - /** + * Set specified members in the certificate policy. Leave others as null. This operation requires the + * certificates/update permission. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param certificateName The name of the certificate in the given vault. * @param certificatePolicy The policy for the certificate. - * @param options The optional parameters - * @param callback The callback - */ - updateCertificatePolicy(vaultBaseUrl: string, certificateName: string, certificatePolicy: Models.CertificatePolicy, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - updateCertificatePolicy(vaultBaseUrl: string, certificateName: string, certificatePolicy: Models.CertificatePolicy, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + * @param options The options parameters. + */ + updateCertificatePolicy( + vaultBaseUrl: string, + certificateName: string, + certificatePolicy: CertificatePolicy, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( { vaultBaseUrl, certificateName, certificatePolicy, - options + options: operationOptions }, - updateCertificatePolicyOperationSpec, - callback) as Promise; + updateCertificatePolicyOperationSpec + ) as Promise; } /** * The UpdateCertificate operation applies the specified update on the given certificate; the only - * elements updated are the certificate's attributes. This operation requires the - * certificates/update permission. - * @summary Updates the specified attributes associated with the given certificate. - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate in the given key vault. - * @param certificateVersion The version of the certificate. - * @param [options] The optional parameters - * @returns Promise - */ - updateCertificate(vaultBaseUrl: string, certificateName: string, certificateVersion: string, options?: Models.KeyVaultClientUpdateCertificateOptionalParams): Promise; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate in the given key vault. - * @param certificateVersion The version of the certificate. - * @param callback The callback - */ - updateCertificate(vaultBaseUrl: string, certificateName: string, certificateVersion: string, callback: coreHttp.ServiceCallback): void; - /** + * elements updated are the certificate's attributes. This operation requires the certificates/update + * permission. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param certificateName The name of the certificate in the given key vault. * @param certificateVersion The version of the certificate. - * @param options The optional parameters - * @param callback The callback - */ - updateCertificate(vaultBaseUrl: string, certificateName: string, certificateVersion: string, options: Models.KeyVaultClientUpdateCertificateOptionalParams, callback: coreHttp.ServiceCallback): void; - updateCertificate(vaultBaseUrl: string, certificateName: string, certificateVersion: string, options?: Models.KeyVaultClientUpdateCertificateOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + * @param parameters The parameters for certificate update. + * @param options The options parameters. + */ + updateCertificate( + vaultBaseUrl: string, + certificateName: string, + certificateVersion: string, + parameters: CertificateUpdateParameters, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( { vaultBaseUrl, certificateName, certificateVersion, - options + parameters, + options: operationOptions }, - updateCertificateOperationSpec, - callback) as Promise; + updateCertificateOperationSpec + ) as Promise; } /** * Gets information about a specific certificate. This operation requires the certificates/get * permission. - * @summary Gets information about a certificate. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param certificateName The name of the certificate in the given vault. * @param certificateVersion The version of the certificate. This URI fragment is optional. If not - * specified, the latest version of the certificate is returned. - * @param [options] The optional parameters - * @returns Promise - */ - getCertificate(vaultBaseUrl: string, certificateName: string, certificateVersion: string, options?: coreHttp.RequestOptionsBase): Promise; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate in the given vault. - * @param certificateVersion The version of the certificate. This URI fragment is optional. If not - * specified, the latest version of the certificate is returned. - * @param callback The callback - */ - getCertificate(vaultBaseUrl: string, certificateName: string, certificateVersion: string, callback: coreHttp.ServiceCallback): void; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate in the given vault. - * @param certificateVersion The version of the certificate. This URI fragment is optional. If not - * specified, the latest version of the certificate is returned. - * @param options The optional parameters - * @param callback The callback - */ - getCertificate(vaultBaseUrl: string, certificateName: string, certificateVersion: string, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - getCertificate(vaultBaseUrl: string, certificateName: string, certificateVersion: string, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + * specified, the latest version of the certificate is returned. + * @param options The options parameters. + */ + getCertificate( + vaultBaseUrl: string, + certificateName: string, + certificateVersion: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( { vaultBaseUrl, certificateName, certificateVersion, - options + options: operationOptions }, - getCertificateOperationSpec, - callback) as Promise; + getCertificateOperationSpec + ) as Promise; } /** - * Updates a certificate creation operation that is already in progress. This operation requires - * the certificates/update permission. - * @summary Updates a certificate operation. - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate. - * @param cancellationRequested Indicates if cancellation was requested on the certificate - * operation. - * @param [options] The optional parameters - * @returns Promise - */ - updateCertificateOperation(vaultBaseUrl: string, certificateName: string, cancellationRequested: boolean, options?: coreHttp.RequestOptionsBase): Promise; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate. - * @param cancellationRequested Indicates if cancellation was requested on the certificate - * operation. - * @param callback The callback - */ - updateCertificateOperation(vaultBaseUrl: string, certificateName: string, cancellationRequested: boolean, callback: coreHttp.ServiceCallback): void; - /** + * Updates a certificate creation operation that is already in progress. This operation requires the + * certificates/update permission. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param certificateName The name of the certificate. - * @param cancellationRequested Indicates if cancellation was requested on the certificate - * operation. - * @param options The optional parameters - * @param callback The callback - */ - updateCertificateOperation(vaultBaseUrl: string, certificateName: string, cancellationRequested: boolean, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - updateCertificateOperation(vaultBaseUrl: string, certificateName: string, cancellationRequested: boolean, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + * @param certificateOperation The certificate operation response. + * @param options The options parameters. + */ + updateCertificateOperation( + vaultBaseUrl: string, + certificateName: string, + certificateOperation: CertificateOperationUpdateParameter, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( { vaultBaseUrl, certificateName, - cancellationRequested, - options + certificateOperation, + options: operationOptions }, - updateCertificateOperationOperationSpec, - callback) as Promise; + updateCertificateOperationOperationSpec + ) as Promise; } /** * Gets the creation operation associated with a specified certificate. This operation requires the * certificates/get permission. - * @summary Gets the creation operation of a certificate. - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate. - * @param [options] The optional parameters - * @returns Promise - */ - getCertificateOperation(vaultBaseUrl: string, certificateName: string, options?: coreHttp.RequestOptionsBase): Promise; - /** * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param certificateName The name of the certificate. - * @param callback The callback - */ - getCertificateOperation(vaultBaseUrl: string, certificateName: string, callback: coreHttp.ServiceCallback): void; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate. - * @param options The optional parameters - * @param callback The callback - */ - getCertificateOperation(vaultBaseUrl: string, certificateName: string, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - getCertificateOperation(vaultBaseUrl: string, certificateName: string, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + * @param options The options parameters. + */ + getCertificateOperation( + vaultBaseUrl: string, + certificateName: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - certificateName, - options - }, - getCertificateOperationOperationSpec, - callback) as Promise; + { vaultBaseUrl, certificateName, options: operationOptions }, + getCertificateOperationOperationSpec + ) as Promise; } /** - * Deletes the creation operation for a specified certificate that is in the process of being - * created. The certificate is no longer created. This operation requires the certificates/update - * permission. - * @summary Deletes the creation operation for a specific certificate. - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate. - * @param [options] The optional parameters - * @returns Promise - */ - deleteCertificateOperation(vaultBaseUrl: string, certificateName: string, options?: coreHttp.RequestOptionsBase): Promise; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate. - * @param callback The callback - */ - deleteCertificateOperation(vaultBaseUrl: string, certificateName: string, callback: coreHttp.ServiceCallback): void; - /** + * Deletes the creation operation for a specified certificate that is in the process of being created. + * The certificate is no longer created. This operation requires the certificates/update permission. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param certificateName The name of the certificate. - * @param options The optional parameters - * @param callback The callback - */ - deleteCertificateOperation(vaultBaseUrl: string, certificateName: string, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - deleteCertificateOperation(vaultBaseUrl: string, certificateName: string, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + * @param options The options parameters. + */ + deleteCertificateOperation( + vaultBaseUrl: string, + certificateName: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - certificateName, - options - }, - deleteCertificateOperationOperationSpec, - callback) as Promise; + { vaultBaseUrl, certificateName, options: operationOptions }, + deleteCertificateOperationOperationSpec + ) as Promise; } /** - * The MergeCertificate operation performs the merging of a certificate or certificate chain with a - * key pair currently available in the service. This operation requires the certificates/create - * permission. - * @summary Merges a certificate or a certificate chain with a key pair existing on the server. + * The MergeCertificate operation performs the merging of a certificate or certificate chain with a key + * pair currently available in the service. This operation requires the certificates/create permission. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param certificateName The name of the certificate. - * @param x509Certificates The certificate or the certificate chain to merge. - * @param [options] The optional parameters - * @returns Promise - */ - mergeCertificate(vaultBaseUrl: string, certificateName: string, x509Certificates: Uint8Array[], options?: Models.KeyVaultClientMergeCertificateOptionalParams): Promise; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate. - * @param x509Certificates The certificate or the certificate chain to merge. - * @param callback The callback - */ - mergeCertificate(vaultBaseUrl: string, certificateName: string, x509Certificates: Uint8Array[], callback: coreHttp.ServiceCallback): void; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate. - * @param x509Certificates The certificate or the certificate chain to merge. - * @param options The optional parameters - * @param callback The callback - */ - mergeCertificate(vaultBaseUrl: string, certificateName: string, x509Certificates: Uint8Array[], options: Models.KeyVaultClientMergeCertificateOptionalParams, callback: coreHttp.ServiceCallback): void; - mergeCertificate(vaultBaseUrl: string, certificateName: string, x509Certificates: Uint8Array[], options?: Models.KeyVaultClientMergeCertificateOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + * @param parameters The parameters to merge certificate. + * @param options The options parameters. + */ + mergeCertificate( + vaultBaseUrl: string, + certificateName: string, + parameters: CertificateMergeParameters, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - certificateName, - x509Certificates, - options - }, - mergeCertificateOperationSpec, - callback) as Promise; + { vaultBaseUrl, certificateName, parameters, options: operationOptions }, + mergeCertificateOperationSpec + ) as Promise; } /** - * Requests that a backup of the specified certificate be downloaded to the client. All versions of - * the certificate will be downloaded. This operation requires the certificates/backup permission. - * @summary Backs up the specified certificate. - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate. - * @param [options] The optional parameters - * @returns Promise - */ - backupCertificate(vaultBaseUrl: string, certificateName: string, options?: coreHttp.RequestOptionsBase): Promise; - /** + * Requests that a backup of the specified certificate be downloaded to the client. All versions of the + * certificate will be downloaded. This operation requires the certificates/backup permission. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param certificateName The name of the certificate. - * @param callback The callback - */ - backupCertificate(vaultBaseUrl: string, certificateName: string, callback: coreHttp.ServiceCallback): void; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate. - * @param options The optional parameters - * @param callback The callback - */ - backupCertificate(vaultBaseUrl: string, certificateName: string, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - backupCertificate(vaultBaseUrl: string, certificateName: string, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + * @param options The options parameters. + */ + backupCertificate( + vaultBaseUrl: string, + certificateName: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - certificateName, - options - }, - backupCertificateOperationSpec, - callback) as Promise; + { vaultBaseUrl, certificateName, options: operationOptions }, + backupCertificateOperationSpec + ) as Promise; } /** * Restores a backed up certificate, and all its versions, to a vault. This operation requires the * certificates/restore permission. - * @summary Restores a backed up certificate to a vault. - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateBundleBackup The backup blob associated with a certificate bundle. - * @param [options] The optional parameters - * @returns Promise - */ - restoreCertificate(vaultBaseUrl: string, certificateBundleBackup: Uint8Array, options?: coreHttp.RequestOptionsBase): Promise; - /** * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateBundleBackup The backup blob associated with a certificate bundle. - * @param callback The callback - */ - restoreCertificate(vaultBaseUrl: string, certificateBundleBackup: Uint8Array, callback: coreHttp.ServiceCallback): void; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateBundleBackup The backup blob associated with a certificate bundle. - * @param options The optional parameters - * @param callback The callback - */ - restoreCertificate(vaultBaseUrl: string, certificateBundleBackup: Uint8Array, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - restoreCertificate(vaultBaseUrl: string, certificateBundleBackup: Uint8Array, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + * @param parameters The parameters to restore the certificate. + * @param options The options parameters. + */ + restoreCertificate( + vaultBaseUrl: string, + parameters: CertificateRestoreParameters, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - certificateBundleBackup, - options - }, - restoreCertificateOperationSpec, - callback) as Promise; + { vaultBaseUrl, parameters, options: operationOptions }, + restoreCertificateOperationSpec + ) as Promise; } /** - * The GetDeletedCertificates operation retrieves the certificates in the current vault which are - * in a deleted state and ready for recovery or purging. This operation includes deletion-specific - * information. This operation requires the certificates/get/list permission. This operation can - * only be enabled on soft-delete enabled vaults. - * @summary Lists the deleted certificates in the specified vault currently available for recovery. - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param [options] The optional parameters - * @returns Promise - */ - getDeletedCertificates(vaultBaseUrl: string, options?: Models.KeyVaultClientGetDeletedCertificatesOptionalParams): Promise; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param callback The callback - */ - getDeletedCertificates(vaultBaseUrl: string, callback: coreHttp.ServiceCallback): void; - /** + * The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a + * deleted state and ready for recovery or purging. This operation includes deletion-specific + * information. This operation requires the certificates/get/list permission. This operation can only + * be enabled on soft-delete enabled vaults. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - getDeletedCertificates(vaultBaseUrl: string, options: Models.KeyVaultClientGetDeletedCertificatesOptionalParams, callback: coreHttp.ServiceCallback): void; - getDeletedCertificates(vaultBaseUrl: string, options?: Models.KeyVaultClientGetDeletedCertificatesOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + getDeletedCertificates( + vaultBaseUrl: string, + options?: KeyVaultClientGetDeletedCertificatesOptionalParams + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - options - }, - getDeletedCertificatesOperationSpec, - callback) as Promise; + { vaultBaseUrl, options: operationOptions }, + getDeletedCertificatesOperationSpec + ) as Promise; } /** * The GetDeletedCertificate operation retrieves the deleted certificate information plus its * attributes, such as retention interval, scheduled permanent deletion and the current deletion * recovery level. This operation requires the certificates/get permission. - * @summary Retrieves information about the specified deleted certificate. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param certificateName The name of the certificate - * @param [options] The optional parameters - * @returns Promise - */ - getDeletedCertificate(vaultBaseUrl: string, certificateName: string, options?: coreHttp.RequestOptionsBase): Promise; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate - * @param callback The callback - */ - getDeletedCertificate(vaultBaseUrl: string, certificateName: string, callback: coreHttp.ServiceCallback): void; - /** - * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate - * @param options The optional parameters - * @param callback The callback - */ - getDeletedCertificate(vaultBaseUrl: string, certificateName: string, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - getDeletedCertificate(vaultBaseUrl: string, certificateName: string, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + * @param options The options parameters. + */ + getDeletedCertificate( + vaultBaseUrl: string, + certificateName: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - certificateName, - options - }, - getDeletedCertificateOperationSpec, - callback) as Promise; + { vaultBaseUrl, certificateName, options: operationOptions }, + getDeletedCertificateOperationSpec + ) as Promise; } /** * The PurgeDeletedCertificate operation performs an irreversible deletion of the specified - * certificate, without possibility for recovery. The operation is not available if the recovery - * level does not specify 'Purgeable'. This operation requires the certificate/purge permission. - * @summary Permanently deletes the specified deleted certificate. + * certificate, without possibility for recovery. The operation is not available if the recovery level + * does not specify 'Purgeable'. This operation requires the certificate/purge permission. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param certificateName The name of the certificate - * @param [options] The optional parameters - * @returns Promise - */ - purgeDeletedCertificate(vaultBaseUrl: string, certificateName: string, options?: coreHttp.RequestOptionsBase): Promise; + * @param options The options parameters. + */ + purgeDeletedCertificate( + vaultBaseUrl: string, + certificateName: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); + return this.sendOperationRequest( + { vaultBaseUrl, certificateName, options: operationOptions }, + purgeDeletedCertificateOperationSpec + ) as Promise; + } + /** + * The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The operation + * is applicable in vaults enabled for soft-delete, and must be issued during the retention interval + * (available in the deleted certificate's attributes). This operation requires the + * certificates/recover permission. * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate - * @param callback The callback - */ - purgeDeletedCertificate(vaultBaseUrl: string, certificateName: string, callback: coreHttp.ServiceCallback): void; + * @param certificateName The name of the deleted certificate + * @param options The options parameters. + */ + recoverDeletedCertificate( + vaultBaseUrl: string, + certificateName: string, + options?: coreHttp.OperationOptions + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); + return this.sendOperationRequest( + { vaultBaseUrl, certificateName, options: operationOptions }, + recoverDeletedCertificateOperationSpec + ) as Promise; + } + /** + * GetCertificatesNext * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the certificate - * @param options The optional parameters - * @param callback The callback + * @param nextLink The nextLink from the previous successful call to the GetCertificates method. + * @param options The options parameters. */ - purgeDeletedCertificate(vaultBaseUrl: string, certificateName: string, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - purgeDeletedCertificate(vaultBaseUrl: string, certificateName: string, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + getCertificatesNext( + vaultBaseUrl: string, + nextLink: string, + options?: KeyVaultClientGetCertificatesNextOptionalParams + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - certificateName, - options - }, - purgeDeletedCertificateOperationSpec, - callback); + { vaultBaseUrl, nextLink, options: operationOptions }, + getCertificatesNextOperationSpec + ) as Promise; } /** - * The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The - * operation is applicable in vaults enabled for soft-delete, and must be issued during the - * retention interval (available in the deleted certificate's attributes). This operation requires - * the certificates/recover permission. - * @summary Recovers the deleted certificate back to its current version under /certificates. + * GetCertificateIssuersNext * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the deleted certificate - * @param [options] The optional parameters - * @returns Promise + * @param nextLink The nextLink from the previous successful call to the GetCertificateIssuers method. + * @param options The options parameters. */ - recoverDeletedCertificate(vaultBaseUrl: string, certificateName: string, options?: coreHttp.RequestOptionsBase): Promise; + getCertificateIssuersNext( + vaultBaseUrl: string, + nextLink: string, + options?: KeyVaultClientGetCertificateIssuersNextOptionalParams + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); + return this.sendOperationRequest( + { vaultBaseUrl, nextLink, options: operationOptions }, + getCertificateIssuersNextOperationSpec + ) as Promise; + } + /** + * GetCertificateVersionsNext * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the deleted certificate - * @param callback The callback - */ - recoverDeletedCertificate(vaultBaseUrl: string, certificateName: string, callback: coreHttp.ServiceCallback): void; + * @param certificateName The name of the certificate. + * @param nextLink The nextLink from the previous successful call to the GetCertificateVersions method. + * @param options The options parameters. + */ + getCertificateVersionsNext( + vaultBaseUrl: string, + certificateName: string, + nextLink: string, + options?: KeyVaultClientGetCertificateVersionsNextOptionalParams + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); + return this.sendOperationRequest( + { vaultBaseUrl, certificateName, nextLink, options: operationOptions }, + getCertificateVersionsNextOperationSpec + ) as Promise; + } + /** + * GetDeletedCertificatesNext * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. - * @param certificateName The name of the deleted certificate - * @param options The optional parameters - * @param callback The callback + * @param nextLink The nextLink from the previous successful call to the GetDeletedCertificates method. + * @param options The options parameters. */ - recoverDeletedCertificate(vaultBaseUrl: string, certificateName: string, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback): void; - recoverDeletedCertificate(vaultBaseUrl: string, certificateName: string, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + getDeletedCertificatesNext( + vaultBaseUrl: string, + nextLink: string, + options?: KeyVaultClientGetDeletedCertificatesNextOptionalParams + ): Promise { + const operationOptions: coreHttp.RequestOptionsBase = coreHttp.operationOptionsToRequestOptionsBase( + options || {} + ); return this.sendOperationRequest( - { - vaultBaseUrl, - certificateName, - options - }, - recoverDeletedCertificateOperationSpec, - callback) as Promise; + { vaultBaseUrl, nextLink, options: operationOptions }, + getDeletedCertificatesNextOperationSpec + ) as Promise; } } - // Operation Specifications -const serializer = new coreHttp.Serializer(Mappers); + +const serializer = new coreHttp.Serializer(Mappers, /* isXml */ false); + const getCertificatesOperationSpec: coreHttp.OperationSpec = { + path: "/certificates", httpMethod: "GET", - path: "certificates", - urlParameters: [ - Parameters.vaultBaseUrl - ], - queryParameters: [ - Parameters.maxresults, - Parameters.includePending, - Parameters.apiVersion - ], responses: { 200: { bodyMapper: Mappers.CertificateListResult @@ -995,19 +778,17 @@ const getCertificatesOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + queryParameters: [ + Parameters.maxresults, + Parameters.includePending, + Parameters.apiVersion + ], + urlParameters: [Parameters.vaultBaseUrl], serializer }; - const deleteCertificateOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/{certificate-name}", httpMethod: "DELETE", - path: "certificates/{certificate-name}", - urlParameters: [ - Parameters.vaultBaseUrl, - Parameters.certificateName0 - ], - queryParameters: [ - Parameters.apiVersion - ], responses: { 200: { bodyMapper: Mappers.DeletedCertificateBundle @@ -1016,25 +797,13 @@ const deleteCertificateOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl, Parameters.certificateName], serializer }; - const setCertificateContactsOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/contacts", httpMethod: "PUT", - path: "certificates/contacts", - urlParameters: [ - Parameters.vaultBaseUrl - ], - queryParameters: [ - Parameters.apiVersion - ], - requestBody: { - parameterPath: "contacts", - mapper: { - ...Mappers.Contacts, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.Contacts @@ -1043,18 +812,16 @@ const setCertificateContactsOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + requestBody: Parameters.contacts, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl], + headerParameters: [Parameters.contentType], + mediaType: "json", serializer }; - const getCertificateContactsOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/contacts", httpMethod: "GET", - path: "certificates/contacts", - urlParameters: [ - Parameters.vaultBaseUrl - ], - queryParameters: [ - Parameters.apiVersion - ], responses: { 200: { bodyMapper: Mappers.Contacts @@ -1063,18 +830,13 @@ const getCertificateContactsOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl], serializer }; - const deleteCertificateContactsOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/contacts", httpMethod: "DELETE", - path: "certificates/contacts", - urlParameters: [ - Parameters.vaultBaseUrl - ], - queryParameters: [ - Parameters.apiVersion - ], responses: { 200: { bodyMapper: Mappers.Contacts @@ -1083,19 +845,13 @@ const deleteCertificateContactsOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl], serializer }; - const getCertificateIssuersOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/issuers", httpMethod: "GET", - path: "certificates/issuers", - urlParameters: [ - Parameters.vaultBaseUrl - ], - queryParameters: [ - Parameters.maxresults, - Parameters.apiVersion - ], responses: { 200: { bodyMapper: Mappers.CertificateIssuerListResult @@ -1104,40 +860,13 @@ const getCertificateIssuersOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + queryParameters: [Parameters.maxresults, Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl], serializer }; - const setCertificateIssuerOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/issuers/{issuer-name}", httpMethod: "PUT", - path: "certificates/issuers/{issuer-name}", - urlParameters: [ - Parameters.vaultBaseUrl, - Parameters.issuerName - ], - queryParameters: [ - Parameters.apiVersion - ], - requestBody: { - parameterPath: { - provider: "provider", - credentials: [ - "options", - "credentials" - ], - organizationDetails: [ - "options", - "organizationDetails" - ], - attributes: [ - "options", - "attributes" - ] - }, - mapper: { - ...Mappers.CertificateIssuerSetParameters, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.IssuerBundle @@ -1146,43 +875,16 @@ const setCertificateIssuerOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + requestBody: Parameters.parameter, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl, Parameters.issuerName], + headerParameters: [Parameters.contentType], + mediaType: "json", serializer }; - const updateCertificateIssuerOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/issuers/{issuer-name}", httpMethod: "PATCH", - path: "certificates/issuers/{issuer-name}", - urlParameters: [ - Parameters.vaultBaseUrl, - Parameters.issuerName - ], - queryParameters: [ - Parameters.apiVersion - ], - requestBody: { - parameterPath: { - provider: [ - "options", - "provider" - ], - credentials: [ - "options", - "credentials" - ], - organizationDetails: [ - "options", - "organizationDetails" - ], - attributes: [ - "options", - "attributes" - ] - }, - mapper: { - ...Mappers.CertificateIssuerUpdateParameters, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.IssuerBundle @@ -1191,19 +893,16 @@ const updateCertificateIssuerOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + requestBody: Parameters.parameter1, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl, Parameters.issuerName], + headerParameters: [Parameters.contentType], + mediaType: "json", serializer }; - const getCertificateIssuerOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/issuers/{issuer-name}", httpMethod: "GET", - path: "certificates/issuers/{issuer-name}", - urlParameters: [ - Parameters.vaultBaseUrl, - Parameters.issuerName - ], - queryParameters: [ - Parameters.apiVersion - ], responses: { 200: { bodyMapper: Mappers.IssuerBundle @@ -1212,19 +911,13 @@ const getCertificateIssuerOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl, Parameters.issuerName], serializer }; - const deleteCertificateIssuerOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/issuers/{issuer-name}", httpMethod: "DELETE", - path: "certificates/issuers/{issuer-name}", - urlParameters: [ - Parameters.vaultBaseUrl, - Parameters.issuerName - ], - queryParameters: [ - Parameters.apiVersion - ], responses: { 200: { bodyMapper: Mappers.IssuerBundle @@ -1233,39 +926,13 @@ const deleteCertificateIssuerOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl, Parameters.issuerName], serializer }; - const createCertificateOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/{certificate-name}/create", httpMethod: "POST", - path: "certificates/{certificate-name}/create", - urlParameters: [ - Parameters.vaultBaseUrl, - Parameters.certificateName1 - ], - queryParameters: [ - Parameters.apiVersion - ], - requestBody: { - parameterPath: { - certificatePolicy: [ - "options", - "certificatePolicy" - ], - certificateAttributes: [ - "options", - "certificateAttributes" - ], - tags: [ - "options", - "tags" - ] - }, - mapper: { - ...Mappers.CertificateCreateParameters, - required: true - } - }, responses: { 202: { bodyMapper: Mappers.CertificateOperation @@ -1274,44 +941,16 @@ const createCertificateOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl, Parameters.certificateName1], + headerParameters: [Parameters.contentType], + mediaType: "json", serializer }; - const importCertificateOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/{certificate-name}/import", httpMethod: "POST", - path: "certificates/{certificate-name}/import", - urlParameters: [ - Parameters.vaultBaseUrl, - Parameters.certificateName1 - ], - queryParameters: [ - Parameters.apiVersion - ], - requestBody: { - parameterPath: { - base64EncodedCertificate: "base64EncodedCertificate", - password: [ - "options", - "password" - ], - certificatePolicy: [ - "options", - "certificatePolicy" - ], - certificateAttributes: [ - "options", - "certificateAttributes" - ], - tags: [ - "options", - "tags" - ] - }, - mapper: { - ...Mappers.CertificateImportParameters, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.CertificateBundle @@ -1320,20 +959,16 @@ const importCertificateOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl, Parameters.certificateName1], + headerParameters: [Parameters.contentType], + mediaType: "json", serializer }; - const getCertificateVersionsOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/{certificate-name}/versions", httpMethod: "GET", - path: "certificates/{certificate-name}/versions", - urlParameters: [ - Parameters.vaultBaseUrl, - Parameters.certificateName0 - ], - queryParameters: [ - Parameters.maxresults, - Parameters.apiVersion - ], responses: { 200: { bodyMapper: Mappers.CertificateListResult @@ -1342,19 +977,13 @@ const getCertificateVersionsOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + queryParameters: [Parameters.maxresults, Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl, Parameters.certificateName], serializer }; - const getCertificatePolicyOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/{certificate-name}/policy", httpMethod: "GET", - path: "certificates/{certificate-name}/policy", - urlParameters: [ - Parameters.vaultBaseUrl, - Parameters.certificateName0 - ], - queryParameters: [ - Parameters.apiVersion - ], responses: { 200: { bodyMapper: Mappers.CertificatePolicy @@ -1363,26 +992,13 @@ const getCertificatePolicyOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl, Parameters.certificateName], serializer }; - const updateCertificatePolicyOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/{certificate-name}/policy", httpMethod: "PATCH", - path: "certificates/{certificate-name}/policy", - urlParameters: [ - Parameters.vaultBaseUrl, - Parameters.certificateName0 - ], - queryParameters: [ - Parameters.apiVersion - ], - requestBody: { - parameterPath: "certificatePolicy", - mapper: { - ...Mappers.CertificatePolicy, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.CertificatePolicy @@ -1391,40 +1007,16 @@ const updateCertificatePolicyOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + requestBody: Parameters.certificatePolicy, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl, Parameters.certificateName], + headerParameters: [Parameters.contentType], + mediaType: "json", serializer }; - const updateCertificateOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/{certificate-name}/{certificate-version}", httpMethod: "PATCH", - path: "certificates/{certificate-name}/{certificate-version}", - urlParameters: [ - Parameters.vaultBaseUrl, - Parameters.certificateName0, - Parameters.certificateVersion - ], - queryParameters: [ - Parameters.apiVersion - ], - requestBody: { - parameterPath: { - certificatePolicy: [ - "options", - "certificatePolicy" - ], - certificateAttributes: [ - "options", - "certificateAttributes" - ], - tags: [ - "options", - "tags" - ] - }, - mapper: { - ...Mappers.CertificateUpdateParameters, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.CertificateBundle @@ -1433,20 +1025,20 @@ const updateCertificateOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, - serializer -}; - -const getCertificateOperationSpec: coreHttp.OperationSpec = { - httpMethod: "GET", - path: "certificates/{certificate-name}/{certificate-version}", + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.vaultBaseUrl, - Parameters.certificateName0, + Parameters.certificateName, Parameters.certificateVersion ], - queryParameters: [ - Parameters.apiVersion - ], + headerParameters: [Parameters.contentType], + mediaType: "json", + serializer +}; +const getCertificateOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/{certificate-name}/{certificate-version}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.CertificateBundle @@ -1455,28 +1047,17 @@ const getCertificateOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.vaultBaseUrl, + Parameters.certificateName, + Parameters.certificateVersion + ], serializer }; - const updateCertificateOperationOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/{certificate-name}/pending", httpMethod: "PATCH", - path: "certificates/{certificate-name}/pending", - urlParameters: [ - Parameters.vaultBaseUrl, - Parameters.certificateName0 - ], - queryParameters: [ - Parameters.apiVersion - ], - requestBody: { - parameterPath: { - cancellationRequested: "cancellationRequested" - }, - mapper: { - ...Mappers.CertificateOperationUpdateParameter, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.CertificateOperation @@ -1485,19 +1066,16 @@ const updateCertificateOperationOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + requestBody: Parameters.certificateOperation, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl, Parameters.certificateName], + headerParameters: [Parameters.contentType], + mediaType: "json", serializer }; - const getCertificateOperationOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/{certificate-name}/pending", httpMethod: "GET", - path: "certificates/{certificate-name}/pending", - urlParameters: [ - Parameters.vaultBaseUrl, - Parameters.certificateName0 - ], - queryParameters: [ - Parameters.apiVersion - ], responses: { 200: { bodyMapper: Mappers.CertificateOperation @@ -1506,19 +1084,13 @@ const getCertificateOperationOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl, Parameters.certificateName], serializer }; - const deleteCertificateOperationOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/{certificate-name}/pending", httpMethod: "DELETE", - path: "certificates/{certificate-name}/pending", - urlParameters: [ - Parameters.vaultBaseUrl, - Parameters.certificateName0 - ], - queryParameters: [ - Parameters.apiVersion - ], responses: { 200: { bodyMapper: Mappers.CertificateOperation @@ -1527,36 +1099,13 @@ const deleteCertificateOperationOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl, Parameters.certificateName], serializer }; - const mergeCertificateOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/{certificate-name}/pending/merge", httpMethod: "POST", - path: "certificates/{certificate-name}/pending/merge", - urlParameters: [ - Parameters.vaultBaseUrl, - Parameters.certificateName0 - ], - queryParameters: [ - Parameters.apiVersion - ], - requestBody: { - parameterPath: { - x509Certificates: "x509Certificates", - certificateAttributes: [ - "options", - "certificateAttributes" - ], - tags: [ - "options", - "tags" - ] - }, - mapper: { - ...Mappers.CertificateMergeParameters, - required: true - } - }, responses: { 201: { bodyMapper: Mappers.CertificateBundle @@ -1565,19 +1114,16 @@ const mergeCertificateOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl, Parameters.certificateName], + headerParameters: [Parameters.contentType], + mediaType: "json", serializer }; - const backupCertificateOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/{certificate-name}/backup", httpMethod: "POST", - path: "certificates/{certificate-name}/backup", - urlParameters: [ - Parameters.vaultBaseUrl, - Parameters.certificateName0 - ], - queryParameters: [ - Parameters.apiVersion - ], responses: { 200: { bodyMapper: Mappers.BackupCertificateResult @@ -1586,27 +1132,13 @@ const backupCertificateOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl, Parameters.certificateName], serializer }; - const restoreCertificateOperationSpec: coreHttp.OperationSpec = { + path: "/certificates/restore", httpMethod: "POST", - path: "certificates/restore", - urlParameters: [ - Parameters.vaultBaseUrl - ], - queryParameters: [ - Parameters.apiVersion - ], - requestBody: { - parameterPath: { - certificateBundleBackup: "certificateBundleBackup" - }, - mapper: { - ...Mappers.CertificateRestoreParameters, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.CertificateBundle @@ -1615,20 +1147,16 @@ const restoreCertificateOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl], + headerParameters: [Parameters.contentType], + mediaType: "json", serializer }; - const getDeletedCertificatesOperationSpec: coreHttp.OperationSpec = { + path: "/deletedcertificates", httpMethod: "GET", - path: "deletedcertificates", - urlParameters: [ - Parameters.vaultBaseUrl - ], - queryParameters: [ - Parameters.maxresults, - Parameters.includePending, - Parameters.apiVersion - ], responses: { 200: { bodyMapper: Mappers.DeletedCertificateListResult @@ -1637,19 +1165,17 @@ const getDeletedCertificatesOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + queryParameters: [ + Parameters.maxresults, + Parameters.includePending, + Parameters.apiVersion + ], + urlParameters: [Parameters.vaultBaseUrl], serializer }; - const getDeletedCertificateOperationSpec: coreHttp.OperationSpec = { + path: "/deletedcertificates/{certificate-name}", httpMethod: "GET", - path: "deletedcertificates/{certificate-name}", - urlParameters: [ - Parameters.vaultBaseUrl, - Parameters.certificateName0 - ], - queryParameters: [ - Parameters.apiVersion - ], responses: { 200: { bodyMapper: Mappers.DeletedCertificateBundle @@ -1658,48 +1184,112 @@ const getDeletedCertificateOperationSpec: coreHttp.OperationSpec = { bodyMapper: Mappers.KeyVaultError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl, Parameters.certificateName], serializer }; - const purgeDeletedCertificateOperationSpec: coreHttp.OperationSpec = { + path: "/deletedcertificates/{certificate-name}", httpMethod: "DELETE", - path: "deletedcertificates/{certificate-name}", - urlParameters: [ - Parameters.vaultBaseUrl, - Parameters.certificateName0 - ], - queryParameters: [ - Parameters.apiVersion - ], responses: { 204: {}, default: { bodyMapper: Mappers.KeyVaultError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl, Parameters.certificateName], serializer }; - const recoverDeletedCertificateOperationSpec: coreHttp.OperationSpec = { + path: "/deletedcertificates/{certificate-name}/recover", httpMethod: "POST", - path: "deletedcertificates/{certificate-name}/recover", - urlParameters: [ - Parameters.vaultBaseUrl, - Parameters.certificateName0 - ], + responses: { + 200: { + bodyMapper: Mappers.CertificateBundle + }, + default: { + bodyMapper: Mappers.KeyVaultError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl, Parameters.certificateName], + serializer +}; +const getCertificatesNextOperationSpec: coreHttp.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CertificateListResult + }, + default: { + bodyMapper: Mappers.KeyVaultError + } + }, queryParameters: [ + Parameters.maxresults, + Parameters.includePending, Parameters.apiVersion ], + urlParameters: [Parameters.vaultBaseUrl, Parameters.nextLink], + serializer +}; +const getCertificateIssuersNextOperationSpec: coreHttp.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.CertificateBundle + bodyMapper: Mappers.CertificateIssuerListResult }, default: { bodyMapper: Mappers.KeyVaultError } }, + queryParameters: [Parameters.maxresults, Parameters.apiVersion], + urlParameters: [Parameters.vaultBaseUrl, Parameters.nextLink], serializer }; +const getCertificateVersionsNextOperationSpec: coreHttp.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CertificateListResult + }, + default: { + bodyMapper: Mappers.KeyVaultError + } + }, + queryParameters: [Parameters.maxresults, Parameters.apiVersion], + urlParameters: [ + Parameters.vaultBaseUrl, + Parameters.certificateName, + Parameters.nextLink + ], + serializer +}; +const getDeletedCertificatesNextOperationSpec: coreHttp.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DeletedCertificateListResult + }, + default: { + bodyMapper: Mappers.KeyVaultError + } + }, + queryParameters: [ + Parameters.maxresults, + Parameters.includePending, + Parameters.apiVersion + ], + urlParameters: [Parameters.vaultBaseUrl, Parameters.nextLink], + serializer +}; + +// Operation Specifications export { KeyVaultClient, diff --git a/sdk/keyvault/keyvault-certificates/src/generated/keyVaultClientContext.ts b/sdk/keyvault/keyvault-certificates/src/generated/keyVaultClientContext.ts index c89d198a0cc2..bd5f72c7687f 100644 --- a/sdk/keyvault/keyvault-certificates/src/generated/keyVaultClientContext.ts +++ b/sdk/keyvault/keyvault-certificates/src/generated/keyVaultClientContext.ts @@ -1,31 +1,26 @@ /* - * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ import * as coreHttp from "@azure/core-http"; +import { KeyVaultClientOptionalParams } from "./models"; const packageName = "@azure/keyvault-certificates"; -export const packageVersion = "4.1.0-preview.2"; +const packageVersion = "1.0.0"; export class KeyVaultClientContext extends coreHttp.ServiceClient { apiVersion: string; /** * Initializes a new instance of the KeyVaultClientContext class. - * @param apiVersion Client API version. - * @param [options] The parameter options + * @param options The parameter options */ - constructor(apiVersion: string, options?: coreHttp.ServiceClientOptions) { - if (apiVersion == undefined) { - throw new Error("'apiVersion' cannot be null."); - } - + constructor(options?: KeyVaultClientOptionalParams) { + // Initializing default values for options if (!options) { options = {}; } @@ -37,8 +32,11 @@ export class KeyVaultClientContext extends coreHttp.ServiceClient { super(undefined, options); - this.baseUri = "{vaultBaseUrl}"; this.requestContentType = "application/json; charset=utf-8"; - this.apiVersion = apiVersion; + + this.baseUri = options.endpoint || "{vaultBaseUrl}"; + + // Assigning values to Constant parameters + this.apiVersion = options.apiVersion || "7.2-preview"; } } diff --git a/sdk/keyvault/keyvault-certificates/src/generated/models/index.ts b/sdk/keyvault/keyvault-certificates/src/generated/models/index.ts index c0697e9572f7..3220a3133e2c 100644 --- a/sdk/keyvault/keyvault-certificates/src/generated/models/index.ts +++ b/sdk/keyvault/keyvault-certificates/src/generated/models/index.ts @@ -1,14 +1,49 @@ /* - * 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. */ - import * as coreHttp from "@azure/core-http"; +/** + * The certificate list result. + */ +export interface CertificateListResult { + /** + * A response message containing a list of certificates in the key vault along with a link to the next page of certificates. + */ + readonly value?: CertificateItem[]; + /** + * The URL to get the next set of certificates. + */ + readonly nextLink?: string; +} + +/** + * The certificate item containing certificate metadata. + */ +export interface CertificateItem { + /** + * Certificate identifier. + */ + id?: string; + /** + * The certificate management attributes. + */ + attributes?: CertificateAttributes; + /** + * Application specific metadata in the form of key-value pairs. + */ + tags?: { [propertyName: string]: string }; + /** + * Thumbprint of the certificate. + */ + x509Thumbprint?: Uint8Array; +} + /** * The object attributes managed by the KeyVault service. */ @@ -27,12 +62,10 @@ export interface Attributes { expires?: Date; /** * Creation time in UTC. - * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly created?: Date; /** * Last updated time in UTC. - * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly updated?: Date; } @@ -40,59 +73,119 @@ export interface Attributes { /** * The certificate management attributes. */ -export interface CertificateAttributes extends Attributes { +export type CertificateAttributes = Attributes & { /** - * softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, - * otherwise 0. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0. */ readonly recoverableDays?: number; /** - * Reflects the deletion recovery level currently in effect for certificates in the current - * vault. If it contains 'Purgeable', the certificate can be permanently deleted by a privileged - * user; otherwise, only the system can purge the certificate, at the end of the retention - * interval. Possible values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', - * 'Recoverable+ProtectedSubscription', 'CustomizedRecoverable+Purgeable', - * 'CustomizedRecoverable', 'CustomizedRecoverable+ProtectedSubscription' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Reflects the deletion recovery level currently in effect for certificates in the current vault. If it contains 'Purgeable', the certificate can be permanently deleted by a privileged user; otherwise, only the system can purge the certificate, at the end of the retention interval. */ readonly recoveryLevel?: DeletionRecoveryLevel; +}; + +/** + * The key vault error exception. + */ +export interface KeyVaultError { + /** + * The key vault server error. + */ + readonly error?: ErrorModel; } /** - * The certificate item containing certificate metadata. + * The key vault server error. */ -export interface CertificateItem { +export interface ErrorModel { /** - * Certificate identifier. + * The error code. */ - id?: string; + readonly code?: string; /** - * The certificate management attributes. + * The error message. */ - attributes?: CertificateAttributes; + readonly message?: string; /** - * Application specific metadata in the form of key-value pairs. + * The key vault server error. */ - tags?: { [propertyName: string]: string }; + readonly innerError?: ErrorModel; +} + +/** + * A certificate bundle consists of a certificate (X509) plus its attributes. + */ +export interface CertificateBundle { + /** + * The certificate id. + */ + readonly id?: string; + /** + * The key id. + */ + readonly kid?: string; + /** + * The secret id. + */ + readonly sid?: string; /** * Thumbprint of the certificate. */ - x509Thumbprint?: Uint8Array; + readonly x509Thumbprint?: Uint8Array; + /** + * The management policy. + */ + readonly policy?: CertificatePolicy; + /** + * CER contents of x509 certificate. + */ + cer?: Uint8Array; + /** + * The content type of the secret. + */ + contentType?: string; + /** + * The certificate attributes. + */ + attributes?: CertificateAttributes; + /** + * Application specific metadata in the form of key-value pairs + */ + tags?: { [propertyName: string]: string }; } /** - * The certificate issuer item containing certificate issuer metadata. + * Management policy for a certificate. */ -export interface CertificateIssuerItem { +export interface CertificatePolicy { /** - * Certificate Identifier. + * The certificate id. */ - id?: string; + readonly id?: string; /** - * The issuer provider. + * Properties of the key backing a certificate. */ - provider?: string; + keyProperties?: KeyProperties; + /** + * Properties of the secret backing a certificate. + */ + secretProperties?: SecretProperties; + /** + * Properties of the X509 component of a certificate. + */ + x509CertificateProperties?: X509CertificateProperties; + /** + * Actions that will be performed by Key Vault over the lifetime of a certificate. + */ + lifetimeActions?: LifetimeAction[]; + /** + * Parameters for the issuer of the X509 component of a certificate. + */ + issuerParameters?: IssuerParameters; + /** + * The certificate attributes. + */ + attributes?: CertificateAttributes; } /** @@ -104,8 +197,7 @@ export interface KeyProperties { */ exportable?: boolean; /** - * The type of key pair to be used for the certificate. Possible values include: 'EC', 'EC-HSM', - * 'RSA', 'RSA-HSM', 'oct' + * The type of key pair to be used for the certificate. */ keyType?: JsonWebKeyType; /** @@ -117,8 +209,7 @@ export interface KeyProperties { */ reuseKey?: boolean; /** - * Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: - * 'P-256', 'P-384', 'P-521', 'P-256K' + * Elliptic curve name. For valid values, see JsonWebKeyCurveName. */ curve?: JsonWebKeyCurveName; } @@ -133,24 +224,6 @@ export interface SecretProperties { contentType?: string; } -/** - * The subject alternate names of a X509 object. - */ -export interface SubjectAlternativeNames { - /** - * Email addresses. - */ - emails?: string[]; - /** - * Domain names. - */ - dnsNames?: string[]; - /** - * User principal names. - */ - upns?: string[]; -} - /** * Properties of the X509 component of a certificate. */ @@ -178,29 +251,21 @@ export interface X509CertificateProperties { } /** - * A condition to be satisfied for an action to be executed. + * The subject alternate names of a X509 object. */ -export interface Trigger { +export interface SubjectAlternativeNames { /** - * Percentage of lifetime at which to trigger. Value should be between 1 and 99. + * Email addresses. */ - lifetimePercentage?: number; + emails?: string[]; /** - * Days before expiry to attempt renewal. Value should be between 1 and validity_in_months - * multiplied by 27. If validity_in_months is 36, then value should be between 1 and 972 (36 * - * 27). + * Domain names. */ - daysBeforeExpiry?: number; -} - -/** - * The action that will be executed. - */ -export interface Action { + dnsNames?: string[]; /** - * The type of the action. Possible values include: 'EmailContacts', 'AutoRenew' + * User principal names. */ - actionType?: ActionType; + upns?: string[]; } /** @@ -217,6 +282,30 @@ export interface LifetimeAction { action?: Action; } +/** + * A condition to be satisfied for an action to be executed. + */ +export interface Trigger { + /** + * Percentage of lifetime at which to trigger. Value should be between 1 and 99. + */ + lifetimePercentage?: number; + /** + * Days before expiry to attempt renewal. Value should be between 1 and validity_in_months multiplied by 27. If validity_in_months is 36, then value should be between 1 and 972 (36 * 27). + */ + daysBeforeExpiry?: number; +} + +/** + * The action that will be executed. + */ +export interface Action { + /** + * The type of the action. + */ + actionType?: ActionType; +} + /** * Parameters for the issuer of the X509 component of a certificate. */ @@ -230,210 +319,137 @@ export interface IssuerParameters { */ certificateType?: string; /** - * Indicates if the certificates generated under this policy should be published to certificate - * transparency logs. + * Indicates if the certificates generated under this policy should be published to certificate transparency logs. */ certificateTransparency?: boolean; } /** - * Management policy for a certificate. + * A Deleted Certificate consisting of its previous id, attributes and its tags, as well as information on when it will be purged. */ -export interface CertificatePolicy { - /** - * The certificate id. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * Properties of the key backing a certificate. - */ - keyProperties?: KeyProperties; +export type DeletedCertificateBundle = CertificateBundle & { /** - * Properties of the secret backing a certificate. + * The url of the recovery object, used to identify and recover the deleted certificate. */ - secretProperties?: SecretProperties; + recoveryId?: string; /** - * Properties of the X509 component of a certificate. + * The time when the certificate is scheduled to be purged, in UTC */ - x509CertificateProperties?: X509CertificateProperties; + readonly scheduledPurgeDate?: Date; /** - * Actions that will be performed by Key Vault over the lifetime of a certificate. + * The time when the certificate was deleted, in UTC */ - lifetimeActions?: LifetimeAction[]; + readonly deletedDate?: Date; +}; + +/** + * The contacts for the vault certificates. + */ +export interface Contacts { /** - * Parameters for the issuer of the X509 component of a certificate. + * Identifier for the contacts collection. */ - issuerParameters?: IssuerParameters; + readonly id?: string; /** - * The certificate attributes. + * The contact list for the vault certificates. */ - attributes?: CertificateAttributes; + contactList?: Contact[]; } /** - * A certificate bundle consists of a certificate (X509) plus its attributes. + * The contact information for the vault certificates. */ -export interface CertificateBundle { +export interface Contact { /** - * The certificate id. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Email address. */ - readonly id?: string; + emailAddress?: string; /** - * The key id. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Name. */ - readonly kid?: string; + name?: string; /** - * The secret id. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Phone number. */ - readonly sid?: string; + phone?: string; +} + +/** + * The certificate issuer list result. + */ +export interface CertificateIssuerListResult { /** - * Thumbprint of the certificate. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * A response message containing a list of certificate issuers in the key vault along with a link to the next page of certificate issuers. */ - readonly x509Thumbprint?: Uint8Array; + readonly value?: CertificateIssuerItem[]; /** - * The management policy. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The URL to get the next set of certificate issuers. */ - readonly policy?: CertificatePolicy; - /** - * CER contents of x509 certificate. - */ - cer?: Uint8Array; - /** - * The content type of the secret. - */ - contentType?: string; - /** - * The certificate attributes. - */ - attributes?: CertificateAttributes; - /** - * Application specific metadata in the form of key-value pairs - */ - tags?: { [propertyName: string]: string }; + readonly nextLink?: string; } /** - * A Deleted Certificate consisting of its previous id, attributes and its tags, as well as - * information on when it will be purged. + * The certificate issuer item containing certificate issuer metadata. */ -export interface DeletedCertificateBundle extends CertificateBundle { - /** - * The url of the recovery object, used to identify and recover the deleted certificate. - */ - recoveryId?: string; +export interface CertificateIssuerItem { /** - * The time when the certificate is scheduled to be purged, in UTC - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Certificate Identifier. */ - readonly scheduledPurgeDate?: Date; + id?: string; /** - * The time when the certificate was deleted, in UTC - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The issuer provider. */ - readonly deletedDate?: Date; + provider?: string; } /** - * The deleted certificate item containing metadata about the deleted certificate. + * The certificate issuer set parameters. */ -export interface DeletedCertificateItem extends CertificateItem { - /** - * The url of the recovery object, used to identify and recover the deleted certificate. - */ - recoveryId?: string; - /** - * The time when the certificate is scheduled to be purged, in UTC - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly scheduledPurgeDate?: Date; +export interface CertificateIssuerSetParameters { /** - * The time when the certificate was deleted, in UTC - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The issuer provider. */ - readonly deletedDate?: Date; -} - -/** - * The key vault server error. - */ -export interface ErrorModel { + provider: string; /** - * The error code. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The credentials to be used for the issuer. */ - readonly code?: string; + credentials?: IssuerCredentials; /** - * The error message. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Details of the organization as provided to the issuer. */ - readonly message?: string; + organizationDetails?: OrganizationDetails; /** - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Attributes of the issuer object. */ - readonly innerError?: ErrorModel; + attributes?: IssuerAttributes; } /** - * A certificate operation is returned in case of asynchronous requests. + * The credentials to be used for the certificate issuer. */ -export interface CertificateOperation { - /** - * The certificate id. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * Parameters for the issuer of the X509 component of a certificate. - */ - issuerParameters?: IssuerParameters; - /** - * The certificate signing request (CSR) that is being used in the certificate operation. - */ - csr?: Uint8Array; - /** - * Indicates if cancellation was requested on the certificate operation. - */ - cancellationRequested?: boolean; - /** - * Status of the certificate operation. - */ - status?: string; - /** - * The status details of the certificate operation. - */ - statusDetails?: string; - /** - * Error encountered, if any, during the certificate operation. - */ - error?: ErrorModel; +export interface IssuerCredentials { /** - * Location which contains the result of the certificate operation. + * The user name/account name/account id. */ - target?: string; + accountId?: string; /** - * Identifier for the certificate operation. + * The password/secret/account key. */ - requestId?: string; + password?: string; } /** - * The credentials to be used for the certificate issuer. + * Details of the organization of the certificate issuer. */ -export interface IssuerCredentials { +export interface OrganizationDetails { /** - * The user name/account name/account id. + * Id of the organization. */ - accountId?: string; + id?: string; /** - * The password/secret/account key. + * Details of the organization administrator. */ - password?: string; + adminDetails?: AdministratorDetails[]; } /** @@ -458,20 +474,6 @@ export interface AdministratorDetails { phone?: string; } -/** - * Details of the organization of the certificate issuer. - */ -export interface OrganizationDetails { - /** - * Id of the organization. - */ - id?: string; - /** - * Details of the organization administrator. - */ - adminDetails?: AdministratorDetails[]; -} - /** * The attributes of an issuer managed by the Key Vault service. */ @@ -482,12 +484,10 @@ export interface IssuerAttributes { enabled?: boolean; /** * Creation time in UTC. - * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly created?: Date; /** * Last updated time in UTC. - * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly updated?: Date; } @@ -498,318 +498,12 @@ export interface IssuerAttributes { export interface IssuerBundle { /** * Identifier for the issuer object. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * The issuer provider. - */ - provider?: string; - /** - * The credentials to be used for the issuer. - */ - credentials?: IssuerCredentials; - /** - * Details of the organization as provided to the issuer. - */ - organizationDetails?: OrganizationDetails; - /** - * Attributes of the issuer object. - */ - attributes?: IssuerAttributes; -} - -/** - * The contact information for the vault certificates. - */ -export interface Contact { - /** - * Email address. - */ - emailAddress?: string; - /** - * Name. - */ - name?: string; - /** - * Phone number. - */ - phone?: string; -} - -/** - * The contacts for the vault certificates. - */ -export interface Contacts { - /** - * Identifier for the contacts collection. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * The contact list for the vault certificates. - */ - contactList?: Contact[]; -} - -/** - * The certificate create parameters. - */ -export interface CertificateCreateParameters { - /** - * The management policy for the certificate. - */ - certificatePolicy?: CertificatePolicy; - /** - * The attributes of the certificate (optional). - */ - certificateAttributes?: CertificateAttributes; - /** - * Application specific metadata in the form of key-value pairs. - */ - tags?: { [propertyName: string]: string }; -} - -/** - * The certificate import parameters. - */ -export interface CertificateImportParameters { - /** - * Base64 encoded representation of the certificate object to import. This certificate needs to - * contain the private key. - */ - base64EncodedCertificate: string; - /** - * If the private key in base64EncodedCertificate is encrypted, the password used for encryption. - */ - password?: string; - /** - * The management policy for the certificate. - */ - certificatePolicy?: CertificatePolicy; - /** - * The attributes of the certificate (optional). - */ - certificateAttributes?: CertificateAttributes; - /** - * Application specific metadata in the form of key-value pairs. - */ - tags?: { [propertyName: string]: string }; -} - -/** - * The certificate update parameters. - */ -export interface CertificateUpdateParameters { - /** - * The management policy for the certificate. - */ - certificatePolicy?: CertificatePolicy; - /** - * The attributes of the certificate (optional). - */ - certificateAttributes?: CertificateAttributes; - /** - * Application specific metadata in the form of key-value pairs. - */ - tags?: { [propertyName: string]: string }; -} - -/** - * The certificate merge parameters - */ -export interface CertificateMergeParameters { - /** - * The certificate or the certificate chain to merge. - */ - x509Certificates: Uint8Array[]; - /** - * The attributes of the certificate (optional). - */ - certificateAttributes?: CertificateAttributes; - /** - * Application specific metadata in the form of key-value pairs. - */ - tags?: { [propertyName: string]: string }; -} - -/** - * The certificate issuer set parameters. - */ -export interface CertificateIssuerSetParameters { - /** - * The issuer provider. - */ - provider: string; - /** - * The credentials to be used for the issuer. - */ - credentials?: IssuerCredentials; - /** - * Details of the organization as provided to the issuer. - */ - organizationDetails?: OrganizationDetails; - /** - * Attributes of the issuer object. - */ - attributes?: IssuerAttributes; -} - -/** - * The certificate issuer update parameters. - */ -export interface CertificateIssuerUpdateParameters { - /** - * The issuer provider. - */ - provider?: string; - /** - * The credentials to be used for the issuer. - */ - credentials?: IssuerCredentials; - /** - * Details of the organization as provided to the issuer. - */ - organizationDetails?: OrganizationDetails; - /** - * Attributes of the issuer object. - */ - attributes?: IssuerAttributes; -} - -/** - * The certificate operation update parameters. - */ -export interface CertificateOperationUpdateParameter { - /** - * Indicates if cancellation was requested on the certificate operation. - */ - cancellationRequested: boolean; -} - -/** - * The certificate list result. - */ -export interface CertificateListResult { - /** - * A response message containing a list of certificates in the key vault along with a link to the - * next page of certificates. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly value?: CertificateItem[]; - /** - * The URL to get the next set of certificates. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} - -/** - * A list of certificates that have been deleted in this vault. - */ -export interface DeletedCertificateListResult { - /** - * A response message containing a list of deleted certificates in the vault along with a link to - * the next page of deleted certificates - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly value?: DeletedCertificateItem[]; - /** - * The URL to get the next set of deleted certificates. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} - -/** - * The certificate issuer list result. - */ -export interface CertificateIssuerListResult { - /** - * A response message containing a list of certificate issuers in the key vault along with a link - * to the next page of certificate issuers. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly value?: CertificateIssuerItem[]; - /** - * The URL to get the next set of certificate issuers. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nextLink?: string; -} - -/** - * The pending certificate signing request result. - */ -export interface PendingCertificateSigningRequestResult { - /** - * The pending certificate signing request as Base64 encoded string. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly value?: string; -} - -/** - * The certificate restore parameters. - */ -export interface CertificateRestoreParameters { - /** - * The backup blob associated with a certificate bundle. - */ - certificateBundleBackup: Uint8Array; -} - -/** - * The backup certificate result, containing the backup blob. - */ -export interface BackupCertificateResult { - /** - * The backup blob containing the backed up certificate. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly value?: Uint8Array; -} - -/** - * The key vault error exception. - */ -export interface KeyVaultError { - /** - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly error?: ErrorModel; -} - -/** - * Optional Parameters. - */ -export interface KeyVaultClientGetCertificatesOptionalParams extends coreHttp.RequestOptionsBase { - /** - * Maximum number of results to return in a page. If not specified the service will return up to - * 25 results. - */ - maxresults?: number; - /** - * Specifies whether to include certificates which are not completely provisioned. - */ - includePending?: boolean; -} - -/** - * Optional Parameters. - */ -export interface KeyVaultClientGetCertificateIssuersOptionalParams extends coreHttp.RequestOptionsBase { + */ + readonly id?: string; /** - * Maximum number of results to return in a page. If not specified the service will return up to - * 25 results. + * The issuer provider. */ - maxresults?: number; -} - -/** - * Optional Parameters. - */ -export interface KeyVaultClientSetCertificateIssuerOptionalParams extends coreHttp.RequestOptionsBase { + provider?: string; /** * The credentials to be used for the issuer. */ @@ -825,9 +519,9 @@ export interface KeyVaultClientSetCertificateIssuerOptionalParams extends coreHt } /** - * Optional Parameters. + * The certificate issuer update parameters. */ -export interface KeyVaultClientUpdateCertificateIssuerOptionalParams extends coreHttp.RequestOptionsBase { +export interface CertificateIssuerUpdateParameters { /** * The issuer provider. */ @@ -847,9 +541,9 @@ export interface KeyVaultClientUpdateCertificateIssuerOptionalParams extends cor } /** - * Optional Parameters. + * The certificate create parameters. */ -export interface KeyVaultClientCreateCertificateOptionalParams extends coreHttp.RequestOptionsBase { +export interface CertificateCreateParameters { /** * The management policy for the certificate. */ @@ -865,9 +559,55 @@ export interface KeyVaultClientCreateCertificateOptionalParams extends coreHttp. } /** - * Optional Parameters. + * A certificate operation is returned in case of asynchronous requests. + */ +export interface CertificateOperation { + /** + * The certificate id. + */ + readonly id?: string; + /** + * Parameters for the issuer of the X509 component of a certificate. + */ + issuerParameters?: IssuerParameters; + /** + * The certificate signing request (CSR) that is being used in the certificate operation. + */ + csr?: Uint8Array; + /** + * Indicates if cancellation was requested on the certificate operation. + */ + cancellationRequested?: boolean; + /** + * Status of the certificate operation. + */ + status?: string; + /** + * The status details of the certificate operation. + */ + statusDetails?: string; + /** + * Error encountered, if any, during the certificate operation. + */ + error?: ErrorModel; + /** + * Location which contains the result of the certificate operation. + */ + target?: string; + /** + * Identifier for the certificate operation. + */ + requestId?: string; +} + +/** + * The certificate import parameters. */ -export interface KeyVaultClientImportCertificateOptionalParams extends coreHttp.RequestOptionsBase { +export interface CertificateImportParameters { + /** + * Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key. + */ + base64EncodedCertificate: string; /** * If the private key in base64EncodedCertificate is encrypted, the password used for encryption. */ @@ -887,20 +627,9 @@ export interface KeyVaultClientImportCertificateOptionalParams extends coreHttp. } /** - * Optional Parameters. - */ -export interface KeyVaultClientGetCertificateVersionsOptionalParams extends coreHttp.RequestOptionsBase { - /** - * Maximum number of results to return in a page. If not specified the service will return up to - * 25 results. - */ - maxresults?: number; -} - -/** - * Optional Parameters. + * The certificate update parameters. */ -export interface KeyVaultClientUpdateCertificateOptionalParams extends coreHttp.RequestOptionsBase { +export interface CertificateUpdateParameters { /** * The management policy for the certificate. */ @@ -916,9 +645,23 @@ export interface KeyVaultClientUpdateCertificateOptionalParams extends coreHttp. } /** - * Optional Parameters. + * The certificate operation update parameters. + */ +export interface CertificateOperationUpdateParameter { + /** + * Indicates if cancellation was requested on the certificate operation. + */ + cancellationRequested: boolean; +} + +/** + * The certificate merge parameters */ -export interface KeyVaultClientMergeCertificateOptionalParams extends coreHttp.RequestOptionsBase { +export interface CertificateMergeParameters { + /** + * The certificate or the certificate chain to merge. + */ + x509Certificates: Uint8Array[]; /** * The attributes of the certificate (optional). */ @@ -930,579 +673,825 @@ export interface KeyVaultClientMergeCertificateOptionalParams extends coreHttp.R } /** - * Optional Parameters. + * The backup certificate result, containing the backup blob. */ -export interface KeyVaultClientGetDeletedCertificatesOptionalParams extends coreHttp.RequestOptionsBase { +export interface BackupCertificateResult { /** - * Maximum number of results to return in a page. If not specified the service will return up to - * 25 results. + * The backup blob containing the backed up certificate. */ - maxresults?: number; + readonly value?: Uint8Array; +} + +/** + * The certificate restore parameters. + */ +export interface CertificateRestoreParameters { /** - * Specifies whether to include certificates which are not completely provisioned. + * The backup blob associated with a certificate bundle. */ - includePending?: boolean; + certificateBundleBackup: Uint8Array; } /** - * Defines values for DeletionRecoveryLevel. - * Possible values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', - * 'Recoverable+ProtectedSubscription', 'CustomizedRecoverable+Purgeable', 'CustomizedRecoverable', - * 'CustomizedRecoverable+ProtectedSubscription' - * @readonly - * @enum {string} + * A list of certificates that have been deleted in this vault. */ -export type DeletionRecoveryLevel = 'Purgeable' | 'Recoverable+Purgeable' | 'Recoverable' | 'Recoverable+ProtectedSubscription' | 'CustomizedRecoverable+Purgeable' | 'CustomizedRecoverable' | 'CustomizedRecoverable+ProtectedSubscription'; +export interface DeletedCertificateListResult { + /** + * A response message containing a list of deleted certificates in the vault along with a link to the next page of deleted certificates + */ + readonly value?: DeletedCertificateItem[]; + /** + * The URL to get the next set of deleted certificates. + */ + readonly nextLink?: string; +} /** - * Defines values for JsonWebKeyType. - * Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' - * @readonly - * @enum {string} + * The deleted certificate item containing metadata about the deleted certificate. */ -export type JsonWebKeyType = 'EC' | 'EC-HSM' | 'RSA' | 'RSA-HSM' | 'oct'; +export type DeletedCertificateItem = CertificateItem & { + /** + * The url of the recovery object, used to identify and recover the deleted certificate. + */ + recoveryId?: string; + /** + * The time when the certificate is scheduled to be purged, in UTC + */ + readonly scheduledPurgeDate?: Date; + /** + * The time when the certificate was deleted, in UTC + */ + readonly deletedDate?: Date; +}; /** - * Defines values for JsonWebKeyCurveName. - * Possible values include: 'P-256', 'P-384', 'P-521', 'P-256K' - * @readonly - * @enum {string} + * The pending certificate signing request result. */ -export type JsonWebKeyCurveName = 'P-256' | 'P-384' | 'P-521' | 'P-256K'; +export interface PendingCertificateSigningRequestResult { + /** + * The pending certificate signing request as Base64 encoded string. + */ + readonly value?: string; +} +/** + * Defines values for DeletionRecoveryLevel. + */ +export type DeletionRecoveryLevel = + | "Purgeable" + | "Recoverable+Purgeable" + | "Recoverable" + | "Recoverable+ProtectedSubscription" + | "CustomizedRecoverable+Purgeable" + | "CustomizedRecoverable" + | "CustomizedRecoverable+ProtectedSubscription"; +/** + * Defines values for JsonWebKeyType. + */ +export type JsonWebKeyType = + | "EC" + | "EC-HSM" + | "RSA" + | "RSA-HSM" + | "oct" + | "oct-HSM"; +/** + * Defines values for JsonWebKeyCurveName. + */ +export type JsonWebKeyCurveName = "P-256" | "P-384" | "P-521" | "P-256K"; /** * Defines values for KeyUsageType. - * Possible values include: 'digitalSignature', 'nonRepudiation', 'keyEncipherment', - * 'dataEncipherment', 'keyAgreement', 'keyCertSign', 'cRLSign', 'encipherOnly', 'decipherOnly' - * @readonly - * @enum {string} */ -export type KeyUsageType = 'digitalSignature' | 'nonRepudiation' | 'keyEncipherment' | 'dataEncipherment' | 'keyAgreement' | 'keyCertSign' | 'cRLSign' | 'encipherOnly' | 'decipherOnly'; - +export type KeyUsageType = + | "digitalSignature" + | "nonRepudiation" + | "keyEncipherment" + | "dataEncipherment" + | "keyAgreement" + | "keyCertSign" + | "cRLSign" + | "encipherOnly" + | "decipherOnly"; /** * Defines values for ActionType. - * Possible values include: 'EmailContacts', 'AutoRenew' - * @readonly - * @enum {string} */ -export type ActionType = 'EmailContacts' | 'AutoRenew'; +export type ActionType = "EmailContacts" | "AutoRenew"; + +/** + * Optional parameters. + */ +export interface KeyVaultClientGetCertificatesOptionalParams + extends coreHttp.OperationOptions { + /** + * Maximum number of results to return in a page. If not specified the service will return up to 25 results. + */ + maxresults?: number; + /** + * Specifies whether to include certificates which are not completely provisioned. + */ + includePending?: boolean; +} /** * Contains response data for the getCertificates operation. */ -export type GetCertificatesResponse = CertificateListResult & { +export type KeyVaultClientGetCertificatesResponse = CertificateListResult & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificateListResult; + }; }; /** * Contains response data for the deleteCertificate operation. */ -export type DeleteCertificateResponse = DeletedCertificateBundle & { +export type KeyVaultClientDeleteCertificateResponse = DeletedCertificateBundle & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DeletedCertificateBundle; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DeletedCertificateBundle; + }; }; /** * Contains response data for the setCertificateContacts operation. */ -export type SetCertificateContactsResponse = Contacts & { +export type KeyVaultClientSetCertificateContactsResponse = Contacts & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Contacts; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Contacts; + }; }; /** * Contains response data for the getCertificateContacts operation. */ -export type GetCertificateContactsResponse = Contacts & { +export type KeyVaultClientGetCertificateContactsResponse = Contacts & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Contacts; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Contacts; + }; }; /** * Contains response data for the deleteCertificateContacts operation. */ -export type DeleteCertificateContactsResponse = Contacts & { +export type KeyVaultClientDeleteCertificateContactsResponse = Contacts & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Contacts; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Contacts; + }; }; +/** + * Optional parameters. + */ +export interface KeyVaultClientGetCertificateIssuersOptionalParams + extends coreHttp.OperationOptions { + /** + * Maximum number of results to return in a page. If not specified the service will return up to 25 results. + */ + maxresults?: number; +} + /** * Contains response data for the getCertificateIssuers operation. */ -export type GetCertificateIssuersResponse = CertificateIssuerListResult & { +export type KeyVaultClientGetCertificateIssuersResponse = CertificateIssuerListResult & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateIssuerListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificateIssuerListResult; + }; }; /** * Contains response data for the setCertificateIssuer operation. */ -export type SetCertificateIssuerResponse = IssuerBundle & { +export type KeyVaultClientSetCertificateIssuerResponse = IssuerBundle & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: IssuerBundle; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: IssuerBundle; + }; }; /** * Contains response data for the updateCertificateIssuer operation. */ -export type UpdateCertificateIssuerResponse = IssuerBundle & { +export type KeyVaultClientUpdateCertificateIssuerResponse = IssuerBundle & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: IssuerBundle; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: IssuerBundle; + }; }; /** * Contains response data for the getCertificateIssuer operation. */ -export type GetCertificateIssuerResponse = IssuerBundle & { +export type KeyVaultClientGetCertificateIssuerResponse = IssuerBundle & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: IssuerBundle; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: IssuerBundle; + }; }; /** * Contains response data for the deleteCertificateIssuer operation. */ -export type DeleteCertificateIssuerResponse = IssuerBundle & { +export type KeyVaultClientDeleteCertificateIssuerResponse = IssuerBundle & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: IssuerBundle; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: IssuerBundle; + }; }; /** * Contains response data for the createCertificate operation. */ -export type CreateCertificateResponse = CertificateOperation & { +export type KeyVaultClientCreateCertificateResponse = CertificateOperation & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateOperation; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificateOperation; + }; }; /** * Contains response data for the importCertificate operation. */ -export type ImportCertificateResponse = CertificateBundle & { +export type KeyVaultClientImportCertificateResponse = CertificateBundle & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateBundle; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificateBundle; + }; }; +/** + * Optional parameters. + */ +export interface KeyVaultClientGetCertificateVersionsOptionalParams + extends coreHttp.OperationOptions { + /** + * Maximum number of results to return in a page. If not specified the service will return up to 25 results. + */ + maxresults?: number; +} + /** * Contains response data for the getCertificateVersions operation. */ -export type GetCertificateVersionsResponse = CertificateListResult & { +export type KeyVaultClientGetCertificateVersionsResponse = CertificateListResult & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificateListResult; + }; }; /** * Contains response data for the getCertificatePolicy operation. */ -export type GetCertificatePolicyResponse = CertificatePolicy & { +export type KeyVaultClientGetCertificatePolicyResponse = CertificatePolicy & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificatePolicy; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificatePolicy; + }; }; /** * Contains response data for the updateCertificatePolicy operation. */ -export type UpdateCertificatePolicyResponse = CertificatePolicy & { +export type KeyVaultClientUpdateCertificatePolicyResponse = CertificatePolicy & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificatePolicy; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificatePolicy; + }; }; /** * Contains response data for the updateCertificate operation. */ -export type UpdateCertificateResponse = CertificateBundle & { +export type KeyVaultClientUpdateCertificateResponse = CertificateBundle & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateBundle; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificateBundle; + }; }; /** * Contains response data for the getCertificate operation. */ -export type GetCertificateResponse = CertificateBundle & { +export type KeyVaultClientGetCertificateResponse = CertificateBundle & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateBundle; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificateBundle; + }; }; /** * Contains response data for the updateCertificateOperation operation. */ -export type UpdateCertificateOperationResponse = CertificateOperation & { +export type KeyVaultClientUpdateCertificateOperationResponse = CertificateOperation & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateOperation; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificateOperation; + }; }; /** * Contains response data for the getCertificateOperation operation. */ -export type GetCertificateOperationResponse = CertificateOperation & { +export type KeyVaultClientGetCertificateOperationResponse = CertificateOperation & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateOperation; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificateOperation; + }; }; /** * Contains response data for the deleteCertificateOperation operation. */ -export type DeleteCertificateOperationResponse = CertificateOperation & { +export type KeyVaultClientDeleteCertificateOperationResponse = CertificateOperation & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateOperation; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificateOperation; + }; }; /** * Contains response data for the mergeCertificate operation. */ -export type MergeCertificateResponse = CertificateBundle & { +export type KeyVaultClientMergeCertificateResponse = CertificateBundle & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateBundle; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificateBundle; + }; }; /** * Contains response data for the backupCertificate operation. */ -export type BackupCertificateResponse = BackupCertificateResult & { +export type KeyVaultClientBackupCertificateResponse = BackupCertificateResult & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: BackupCertificateResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: BackupCertificateResult; + }; }; /** * Contains response data for the restoreCertificate operation. */ -export type RestoreCertificateResponse = CertificateBundle & { +export type KeyVaultClientRestoreCertificateResponse = CertificateBundle & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateBundle; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificateBundle; + }; }; +/** + * Optional parameters. + */ +export interface KeyVaultClientGetDeletedCertificatesOptionalParams + extends coreHttp.OperationOptions { + /** + * Maximum number of results to return in a page. If not specified the service will return up to 25 results. + */ + maxresults?: number; + /** + * Specifies whether to include certificates which are not completely provisioned. + */ + includePending?: boolean; +} + /** * Contains response data for the getDeletedCertificates operation. */ -export type GetDeletedCertificatesResponse = DeletedCertificateListResult & { +export type KeyVaultClientGetDeletedCertificatesResponse = DeletedCertificateListResult & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DeletedCertificateListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DeletedCertificateListResult; + }; }; /** * Contains response data for the getDeletedCertificate operation. */ -export type GetDeletedCertificateResponse = DeletedCertificateBundle & { +export type KeyVaultClientGetDeletedCertificateResponse = DeletedCertificateBundle & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DeletedCertificateBundle; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DeletedCertificateBundle; + }; }; /** * Contains response data for the recoverDeletedCertificate operation. */ -export type RecoverDeletedCertificateResponse = CertificateBundle & { +export type KeyVaultClientRecoverDeletedCertificateResponse = CertificateBundle & { + /** + * The underlying HTTP response. + */ + _response: coreHttp.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificateBundle; + }; +}; + +/** + * Optional parameters. + */ +export interface KeyVaultClientGetCertificatesNextOptionalParams + extends coreHttp.OperationOptions { + /** + * Maximum number of results to return in a page. If not specified the service will return up to 25 results. + */ + maxresults?: number; + /** + * Specifies whether to include certificates which are not completely provisioned. + */ + includePending?: boolean; +} + +/** + * Contains response data for the getCertificatesNext operation. + */ +export type KeyVaultClientGetCertificatesNextResponse = CertificateListResult & { + /** + * The underlying HTTP response. + */ + _response: coreHttp.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificateListResult; + }; +}; + +/** + * Optional parameters. + */ +export interface KeyVaultClientGetCertificateIssuersNextOptionalParams + extends coreHttp.OperationOptions { + /** + * Maximum number of results to return in a page. If not specified the service will return up to 25 results. + */ + maxresults?: number; +} + +/** + * Contains response data for the getCertificateIssuersNext operation. + */ +export type KeyVaultClientGetCertificateIssuersNextResponse = CertificateIssuerListResult & { + /** + * The underlying HTTP response. + */ + _response: coreHttp.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificateIssuerListResult; + }; +}; + +/** + * Optional parameters. + */ +export interface KeyVaultClientGetCertificateVersionsNextOptionalParams + extends coreHttp.OperationOptions { + /** + * Maximum number of results to return in a page. If not specified the service will return up to 25 results. + */ + maxresults?: number; +} + +/** + * Contains response data for the getCertificateVersionsNext operation. + */ +export type KeyVaultClientGetCertificateVersionsNextResponse = CertificateListResult & { + /** + * The underlying HTTP response. + */ + _response: coreHttp.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CertificateListResult; + }; +}; + +/** + * Optional parameters. + */ +export interface KeyVaultClientGetDeletedCertificatesNextOptionalParams + extends coreHttp.OperationOptions { + /** + * Maximum number of results to return in a page. If not specified the service will return up to 25 results. + */ + maxresults?: number; + /** + * Specifies whether to include certificates which are not completely provisioned. + */ + includePending?: boolean; +} + +/** + * Contains response data for the getDeletedCertificatesNext operation. + */ +export type KeyVaultClientGetDeletedCertificatesNextResponse = DeletedCertificateListResult & { /** * The underlying HTTP response. */ _response: coreHttp.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CertificateBundle; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DeletedCertificateListResult; + }; }; + +/** + * Optional parameters. + */ +export interface KeyVaultClientOptionalParams + extends coreHttp.ServiceClientOptions { + /** + * Api Version + */ + apiVersion?: string; + /** + * Overrides client endpoint. + */ + endpoint?: string; +} diff --git a/sdk/keyvault/keyvault-certificates/src/generated/models/mappers.ts b/sdk/keyvault/keyvault-certificates/src/generated/models/mappers.ts index a628f39d201b..0eef4cf23d80 100644 --- a/sdk/keyvault/keyvault-certificates/src/generated/models/mappers.ts +++ b/sdk/keyvault/keyvault-certificates/src/generated/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. @@ -8,9 +8,66 @@ import * as coreHttp from "@azure/core-http"; +export const CertificateListResult: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "CertificateListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { type: { name: "Composite", className: "CertificateItem" } } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const CertificateItem: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "CertificateItem", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + attributes: { + serializedName: "attributes", + type: { + name: "Composite", + className: "CertificateAttributes" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + x509Thumbprint: { + serializedName: "x5t", + type: { + name: "Base64Url" + } + } + } + } +}; export const Attributes: coreHttp.CompositeMapper = { - serializedName: "Attributes", type: { name: "Composite", className: "Attributes", @@ -34,15 +91,15 @@ export const Attributes: coreHttp.CompositeMapper = { } }, created: { - readOnly: true, serializedName: "created", + readOnly: true, type: { name: "UnixTime" } }, updated: { - readOnly: true, serializedName: "updated", + readOnly: true, type: { name: "UnixTime" } @@ -52,23 +109,21 @@ export const Attributes: coreHttp.CompositeMapper = { }; export const CertificateAttributes: coreHttp.CompositeMapper = { - serializedName: "CertificateAttributes", type: { name: "Composite", className: "CertificateAttributes", modelProperties: { ...Attributes.type.modelProperties, recoverableDays: { - readOnly: true, serializedName: "recoverableDays", + readOnly: true, type: { name: "Number" } }, recoveryLevel: { - nullable: false, - readOnly: true, serializedName: "recoveryLevel", + readOnly: true, type: { name: "String" } @@ -77,14 +132,100 @@ export const CertificateAttributes: coreHttp.CompositeMapper = { } }; -export const CertificateItem: coreHttp.CompositeMapper = { - serializedName: "CertificateItem", +export const KeyVaultError: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "CertificateItem", + className: "KeyVaultError", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorModel" + } + } + } + } +}; + +export const ErrorModel: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorModel", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + innerError: { + serializedName: "innererror", + type: { + name: "Composite", + className: "ErrorModel" + } + } + } + } +}; + +export const CertificateBundle: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "CertificateBundle", modelProperties: { id: { serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + kid: { + serializedName: "kid", + readOnly: true, + type: { + name: "String" + } + }, + sid: { + serializedName: "sid", + readOnly: true, + type: { + name: "String" + } + }, + x509Thumbprint: { + serializedName: "x5t", + readOnly: true, + type: { + name: "Base64Url" + } + }, + policy: { + serializedName: "policy", + type: { + name: "Composite", + className: "CertificatePolicy" + } + }, + cer: { + serializedName: "cer", + type: { + name: "ByteArray" + } + }, + contentType: { + serializedName: "contentType", type: { name: "String" } @@ -100,39 +241,65 @@ export const CertificateItem: coreHttp.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } - } - }, - x509Thumbprint: { - serializedName: "x5t", - type: { - name: "Base64Url" + value: { type: { name: "String" } } } } } } }; -export const CertificateIssuerItem: coreHttp.CompositeMapper = { - serializedName: "CertificateIssuerItem", +export const CertificatePolicy: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "CertificateIssuerItem", + className: "CertificatePolicy", modelProperties: { id: { serializedName: "id", + readOnly: true, type: { name: "String" } }, - provider: { - serializedName: "provider", + keyProperties: { + serializedName: "key_props", type: { - name: "String" + name: "Composite", + className: "KeyProperties" + } + }, + secretProperties: { + serializedName: "secret_props", + type: { + name: "Composite", + className: "SecretProperties" + } + }, + x509CertificateProperties: { + serializedName: "x509_props", + type: { + name: "Composite", + className: "X509CertificateProperties" + } + }, + lifetimeActions: { + serializedName: "lifetime_actions", + type: { + name: "Sequence", + element: { type: { name: "Composite", className: "LifetimeAction" } } + } + }, + issuerParameters: { + serializedName: "issuer", + type: { + name: "Composite", + className: "IssuerParameters" + } + }, + attributes: { + serializedName: "attributes", + type: { + name: "Composite", + className: "CertificateAttributes" } } } @@ -140,7 +307,6 @@ export const CertificateIssuerItem: coreHttp.CompositeMapper = { }; export const KeyProperties: coreHttp.CompositeMapper = { - serializedName: "KeyProperties", type: { name: "Composite", className: "KeyProperties", @@ -180,7 +346,6 @@ export const KeyProperties: coreHttp.CompositeMapper = { }; export const SecretProperties: coreHttp.CompositeMapper = { - serializedName: "SecretProperties", type: { name: "Composite", className: "SecretProperties", @@ -195,51 +360,7 @@ export const SecretProperties: coreHttp.CompositeMapper = { } }; -export const SubjectAlternativeNames: coreHttp.CompositeMapper = { - serializedName: "SubjectAlternativeNames", - type: { - name: "Composite", - className: "SubjectAlternativeNames", - modelProperties: { - emails: { - serializedName: "emails", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - dnsNames: { - serializedName: "dns_names", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - }, - upns: { - serializedName: "upns", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } -}; - export const X509CertificateProperties: coreHttp.CompositeMapper = { - serializedName: "X509CertificateProperties", type: { name: "Composite", className: "X509CertificateProperties", @@ -254,11 +375,7 @@ export const X509CertificateProperties: coreHttp.CompositeMapper = { serializedName: "ekus", type: { name: "Sequence", - element: { - type: { - name: "String" - } - } + element: { type: { name: "String" } } } }, subjectAlternativeNames: { @@ -272,18 +389,12 @@ export const X509CertificateProperties: coreHttp.CompositeMapper = { serializedName: "key_usage", type: { name: "Sequence", - element: { - type: { - name: "String" - } - } + element: { type: { name: "String" } } } }, validityInMonths: { + constraints: {}, serializedName: "validity_months", - constraints: { - InclusiveMinimum: 0 - }, type: { name: "Number" } @@ -292,46 +403,30 @@ export const X509CertificateProperties: coreHttp.CompositeMapper = { } }; -export const Trigger: coreHttp.CompositeMapper = { - serializedName: "Trigger", +export const SubjectAlternativeNames: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "Trigger", + className: "SubjectAlternativeNames", modelProperties: { - lifetimePercentage: { - serializedName: "lifetime_percentage", - constraints: { - InclusiveMaximum: 99, - InclusiveMinimum: 1 - }, + emails: { + serializedName: "emails", type: { - name: "Number" + name: "Sequence", + element: { type: { name: "String" } } } }, - daysBeforeExpiry: { - serializedName: "days_before_expiry", + dnsNames: { + serializedName: "dns_names", type: { - name: "Number" + name: "Sequence", + element: { type: { name: "String" } } } - } - } - } -}; - -export const Action: coreHttp.CompositeMapper = { - serializedName: "Action", - type: { - name: "Composite", - className: "Action", - modelProperties: { - actionType: { - serializedName: "action_type", + }, + upns: { + serializedName: "upns", type: { - name: "Enum", - allowedValues: [ - "EmailContacts", - "AutoRenew" - ] + name: "Sequence", + element: { type: { name: "String" } } } } } @@ -339,7 +434,6 @@ export const Action: coreHttp.CompositeMapper = { }; export const LifetimeAction: coreHttp.CompositeMapper = { - serializedName: "LifetimeAction", type: { name: "Composite", className: "LifetimeAction", @@ -362,168 +456,68 @@ export const LifetimeAction: coreHttp.CompositeMapper = { } }; -export const IssuerParameters: coreHttp.CompositeMapper = { - serializedName: "IssuerParameters", +export const Trigger: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "IssuerParameters", + className: "Trigger", modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - certificateType: { - serializedName: "cty", + lifetimePercentage: { + constraints: { + InclusiveMaximum: 99, + InclusiveMinimum: 1 + }, + serializedName: "lifetime_percentage", type: { - name: "String" + name: "Number" } }, - certificateTransparency: { - serializedName: "cert_transparency", + daysBeforeExpiry: { + serializedName: "days_before_expiry", type: { - name: "Boolean" + name: "Number" } } } } }; -export const CertificatePolicy: coreHttp.CompositeMapper = { - serializedName: "CertificatePolicy", +export const Action: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "CertificatePolicy", + className: "Action", modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - keyProperties: { - serializedName: "key_props", - type: { - name: "Composite", - className: "KeyProperties" - } - }, - secretProperties: { - serializedName: "secret_props", - type: { - name: "Composite", - className: "SecretProperties" - } - }, - x509CertificateProperties: { - serializedName: "x509_props", - type: { - name: "Composite", - className: "X509CertificateProperties" - } - }, - lifetimeActions: { - serializedName: "lifetime_actions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "LifetimeAction" - } - } - } - }, - issuerParameters: { - serializedName: "issuer", - type: { - name: "Composite", - className: "IssuerParameters" - } - }, - attributes: { - serializedName: "attributes", + actionType: { + serializedName: "action_type", type: { - name: "Composite", - className: "CertificateAttributes" + name: "Enum", + allowedValues: ["EmailContacts", "AutoRenew"] } } } } }; -export const CertificateBundle: coreHttp.CompositeMapper = { - serializedName: "CertificateBundle", +export const IssuerParameters: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "CertificateBundle", + className: "IssuerParameters", modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - kid: { - readOnly: true, - serializedName: "kid", - type: { - name: "String" - } - }, - sid: { - readOnly: true, - serializedName: "sid", + name: { + serializedName: "name", type: { name: "String" } }, - x509Thumbprint: { - readOnly: true, - serializedName: "x5t", - type: { - name: "Base64Url" - } - }, - policy: { - readOnly: true, - serializedName: "policy", - type: { - name: "Composite", - className: "CertificatePolicy" - } - }, - cer: { - serializedName: "cer", - type: { - name: "ByteArray" - } - }, - contentType: { - serializedName: "contentType", + certificateType: { + serializedName: "cty", type: { name: "String" } }, - attributes: { - serializedName: "attributes", - type: { - name: "Composite", - className: "CertificateAttributes" - } - }, - tags: { - serializedName: "tags", + certificateTransparency: { + serializedName: "cert_transparency", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "Boolean" } } } @@ -531,7 +525,6 @@ export const CertificateBundle: coreHttp.CompositeMapper = { }; export const DeletedCertificateBundle: coreHttp.CompositeMapper = { - serializedName: "DeletedCertificateBundle", type: { name: "Composite", className: "DeletedCertificateBundle", @@ -544,15 +537,15 @@ export const DeletedCertificateBundle: coreHttp.CompositeMapper = { } }, scheduledPurgeDate: { - readOnly: true, serializedName: "scheduledPurgeDate", + readOnly: true, type: { name: "UnixTime" } }, deletedDate: { - readOnly: true, serializedName: "deletedDate", + readOnly: true, type: { name: "UnixTime" } @@ -561,130 +554,134 @@ export const DeletedCertificateBundle: coreHttp.CompositeMapper = { } }; -export const DeletedCertificateItem: coreHttp.CompositeMapper = { - serializedName: "DeletedCertificateItem", +export const Contacts: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "DeletedCertificateItem", + className: "Contacts", modelProperties: { - ...CertificateItem.type.modelProperties, - recoveryId: { - serializedName: "recoveryId", - type: { - name: "String" - } - }, - scheduledPurgeDate: { + id: { + serializedName: "id", readOnly: true, - serializedName: "scheduledPurgeDate", type: { - name: "UnixTime" + name: "String" } }, - deletedDate: { - readOnly: true, - serializedName: "deletedDate", + contactList: { + serializedName: "contacts", type: { - name: "UnixTime" + name: "Sequence", + element: { type: { name: "Composite", className: "Contact" } } } } } } }; -export const ErrorModel: coreHttp.CompositeMapper = { - serializedName: "Error", +export const Contact: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "ErrorModel", + className: "Contact", modelProperties: { - code: { - readOnly: true, - serializedName: "code", + emailAddress: { + serializedName: "email", type: { name: "String" } }, - message: { - readOnly: true, - serializedName: "message", + name: { + serializedName: "name", type: { name: "String" } }, - innerError: { - readOnly: true, - serializedName: "innererror", + phone: { + serializedName: "phone", type: { - name: "Composite", - className: "ErrorModel" + name: "String" } } } } }; -export const CertificateOperation: coreHttp.CompositeMapper = { - serializedName: "CertificateOperation", +export const CertificateIssuerListResult: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "CertificateOperation", + className: "CertificateIssuerListResult", modelProperties: { - id: { + value: { + serializedName: "value", readOnly: true, - serializedName: "id", type: { - name: "String" - } - }, - issuerParameters: { - serializedName: "issuer", - type: { - name: "Composite", - className: "IssuerParameters" + name: "Sequence", + element: { + type: { name: "Composite", className: "CertificateIssuerItem" } + } } }, - csr: { - serializedName: "csr", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { - name: "ByteArray" + name: "String" } - }, - cancellationRequested: { - serializedName: "cancellation_requested", + } + } + } +}; + +export const CertificateIssuerItem: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "CertificateIssuerItem", + modelProperties: { + id: { + serializedName: "id", type: { - name: "Boolean" + name: "String" } }, - status: { - serializedName: "status", + provider: { + serializedName: "provider", type: { name: "String" } - }, - statusDetails: { - serializedName: "status_details", + } + } + } +}; + +export const CertificateIssuerSetParameters: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "CertificateIssuerSetParameters", + modelProperties: { + provider: { + serializedName: "provider", + required: true, type: { name: "String" } }, - error: { - serializedName: "error", + credentials: { + serializedName: "credentials", type: { name: "Composite", - className: "ErrorModel" + className: "IssuerCredentials" } }, - target: { - serializedName: "target", + organizationDetails: { + serializedName: "org_details", type: { - name: "String" + name: "Composite", + className: "OrganizationDetails" } }, - requestId: { - serializedName: "request_id", + attributes: { + serializedName: "attributes", type: { - name: "String" + name: "Composite", + className: "IssuerAttributes" } } } @@ -692,7 +689,6 @@ export const CertificateOperation: coreHttp.CompositeMapper = { }; export const IssuerCredentials: coreHttp.CompositeMapper = { - serializedName: "IssuerCredentials", type: { name: "Composite", className: "IssuerCredentials", @@ -713,8 +709,31 @@ export const IssuerCredentials: coreHttp.CompositeMapper = { } }; +export const OrganizationDetails: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "OrganizationDetails", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + adminDetails: { + serializedName: "admin_details", + type: { + name: "Sequence", + element: { + type: { name: "Composite", className: "AdministratorDetails" } + } + } + } + } + } +}; + export const AdministratorDetails: coreHttp.CompositeMapper = { - serializedName: "AdministratorDetails", type: { name: "Composite", className: "AdministratorDetails", @@ -747,36 +766,7 @@ export const AdministratorDetails: coreHttp.CompositeMapper = { } }; -export const OrganizationDetails: coreHttp.CompositeMapper = { - serializedName: "OrganizationDetails", - type: { - name: "Composite", - className: "OrganizationDetails", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String" - } - }, - adminDetails: { - serializedName: "admin_details", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AdministratorDetails" - } - } - } - } - } - } -}; - export const IssuerAttributes: coreHttp.CompositeMapper = { - serializedName: "IssuerAttributes", type: { name: "Composite", className: "IssuerAttributes", @@ -788,15 +778,15 @@ export const IssuerAttributes: coreHttp.CompositeMapper = { } }, created: { - readOnly: true, serializedName: "created", + readOnly: true, type: { name: "UnixTime" } }, updated: { - readOnly: true, serializedName: "updated", + readOnly: true, type: { name: "UnixTime" } @@ -806,14 +796,13 @@ export const IssuerAttributes: coreHttp.CompositeMapper = { }; export const IssuerBundle: coreHttp.CompositeMapper = { - serializedName: "IssuerBundle", type: { name: "Composite", className: "IssuerBundle", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } @@ -849,92 +838,132 @@ export const IssuerBundle: coreHttp.CompositeMapper = { } }; -export const Contact: coreHttp.CompositeMapper = { - serializedName: "Contact", +export const CertificateIssuerUpdateParameters: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "Contact", + className: "CertificateIssuerUpdateParameters", modelProperties: { - emailAddress: { - serializedName: "email", + provider: { + serializedName: "provider", type: { name: "String" } }, - name: { - serializedName: "name", + credentials: { + serializedName: "credentials", type: { - name: "String" + name: "Composite", + className: "IssuerCredentials" } }, - phone: { - serializedName: "phone", + organizationDetails: { + serializedName: "org_details", type: { - name: "String" + name: "Composite", + className: "OrganizationDetails" + } + }, + attributes: { + serializedName: "attributes", + type: { + name: "Composite", + className: "IssuerAttributes" } } } } }; -export const Contacts: coreHttp.CompositeMapper = { - serializedName: "Contacts", +export const CertificateCreateParameters: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "Contacts", + className: "CertificateCreateParameters", + modelProperties: { + certificatePolicy: { + serializedName: "policy", + type: { + name: "Composite", + className: "CertificatePolicy" + } + }, + certificateAttributes: { + serializedName: "attributes", + type: { + name: "Composite", + className: "CertificateAttributes" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const CertificateOperation: coreHttp.CompositeMapper = { + type: { + name: "Composite", + className: "CertificateOperation", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + issuerParameters: { + serializedName: "issuer", + type: { + name: "Composite", + className: "IssuerParameters" + } + }, + csr: { + serializedName: "csr", + type: { + name: "ByteArray" + } + }, + cancellationRequested: { + serializedName: "cancellation_requested", + type: { + name: "Boolean" + } + }, + status: { + serializedName: "status", type: { name: "String" } }, - contactList: { - serializedName: "contacts", + statusDetails: { + serializedName: "status_details", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Contact" - } - } + name: "String" } - } - } - } -}; - -export const CertificateCreateParameters: coreHttp.CompositeMapper = { - serializedName: "CertificateCreateParameters", - type: { - name: "Composite", - className: "CertificateCreateParameters", - modelProperties: { - certificatePolicy: { - serializedName: "policy", + }, + error: { + serializedName: "error", type: { name: "Composite", - className: "CertificatePolicy" + className: "ErrorModel" } }, - certificateAttributes: { - serializedName: "attributes", + target: { + serializedName: "target", type: { - name: "Composite", - className: "CertificateAttributes" + name: "String" } }, - tags: { - serializedName: "tags", + requestId: { + serializedName: "request_id", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "String" } } } @@ -942,14 +971,13 @@ export const CertificateCreateParameters: coreHttp.CompositeMapper = { }; export const CertificateImportParameters: coreHttp.CompositeMapper = { - serializedName: "CertificateImportParameters", type: { name: "Composite", className: "CertificateImportParameters", modelProperties: { base64EncodedCertificate: { - required: true, serializedName: "value", + required: true, type: { name: "String" } @@ -978,11 +1006,7 @@ export const CertificateImportParameters: coreHttp.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } } } } @@ -990,7 +1014,6 @@ export const CertificateImportParameters: coreHttp.CompositeMapper = { }; export const CertificateUpdateParameters: coreHttp.CompositeMapper = { - serializedName: "CertificateUpdateParameters", type: { name: "Composite", className: "CertificateUpdateParameters", @@ -1013,173 +1036,86 @@ export const CertificateUpdateParameters: coreHttp.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } } } } } }; -export const CertificateMergeParameters: coreHttp.CompositeMapper = { - serializedName: "CertificateMergeParameters", +export const CertificateOperationUpdateParameter: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "CertificateMergeParameters", + className: "CertificateOperationUpdateParameter", modelProperties: { - x509Certificates: { + cancellationRequested: { + serializedName: "cancellation_requested", required: true, - serializedName: "x5c", - type: { - name: "Sequence", - element: { - type: { - name: "ByteArray" - } - } - } - }, - certificateAttributes: { - serializedName: "attributes", - type: { - name: "Composite", - className: "CertificateAttributes" - } - }, - tags: { - serializedName: "tags", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "Boolean" } } } } }; -export const CertificateIssuerSetParameters: coreHttp.CompositeMapper = { - serializedName: "CertificateIssuerSetParameters", +export const CertificateMergeParameters: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "CertificateIssuerSetParameters", + className: "CertificateMergeParameters", modelProperties: { - provider: { + x509Certificates: { + serializedName: "x5c", required: true, - serializedName: "provider", - type: { - name: "String" - } - }, - credentials: { - serializedName: "credentials", - type: { - name: "Composite", - className: "IssuerCredentials" - } - }, - organizationDetails: { - serializedName: "org_details", type: { - name: "Composite", - className: "OrganizationDetails" + name: "Sequence", + element: { type: { name: "ByteArray" } } } }, - attributes: { + certificateAttributes: { serializedName: "attributes", type: { name: "Composite", - className: "IssuerAttributes" - } - } - } - } -}; - -export const CertificateIssuerUpdateParameters: coreHttp.CompositeMapper = { - serializedName: "CertificateIssuerUpdateParameters", - type: { - name: "Composite", - className: "CertificateIssuerUpdateParameters", - modelProperties: { - provider: { - serializedName: "provider", - type: { - name: "String" - } - }, - credentials: { - serializedName: "credentials", - type: { - name: "Composite", - className: "IssuerCredentials" - } - }, - organizationDetails: { - serializedName: "org_details", - type: { - name: "Composite", - className: "OrganizationDetails" + className: "CertificateAttributes" } }, - attributes: { - serializedName: "attributes", + tags: { + serializedName: "tags", type: { - name: "Composite", - className: "IssuerAttributes" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; -export const CertificateOperationUpdateParameter: coreHttp.CompositeMapper = { - serializedName: "CertificateOperationUpdateParameter", +export const BackupCertificateResult: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "CertificateOperationUpdateParameter", + className: "BackupCertificateResult", modelProperties: { - cancellationRequested: { - required: true, - serializedName: "cancellation_requested", + value: { + serializedName: "value", + readOnly: true, type: { - name: "Boolean" + name: "Base64Url" } } } } }; -export const CertificateListResult: coreHttp.CompositeMapper = { - serializedName: "CertificateListResult", +export const CertificateRestoreParameters: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "CertificateListResult", + className: "CertificateRestoreParameters", modelProperties: { - value: { - readOnly: true, + certificateBundleBackup: { serializedName: "value", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CertificateItem" - } - } - } - }, - nextLink: { - readOnly: true, - serializedName: "nextLink", - type: { - name: "String" + name: "Base64Url" } } } @@ -1187,27 +1123,23 @@ export const CertificateListResult: coreHttp.CompositeMapper = { }; export const DeletedCertificateListResult: coreHttp.CompositeMapper = { - serializedName: "DeletedCertificateListResult", type: { name: "Composite", className: "DeletedCertificateListResult", modelProperties: { value: { - readOnly: true, serializedName: "value", + readOnly: true, type: { name: "Sequence", element: { - type: { - name: "Composite", - className: "DeletedCertificateItem" - } + type: { name: "Composite", className: "DeletedCertificateItem" } } } }, nextLink: { - readOnly: true, serializedName: "nextLink", + readOnly: true, type: { name: "String" } @@ -1216,99 +1148,46 @@ export const DeletedCertificateListResult: coreHttp.CompositeMapper = { } }; -export const CertificateIssuerListResult: coreHttp.CompositeMapper = { - serializedName: "CertificateIssuerListResult", +export const DeletedCertificateItem: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "CertificateIssuerListResult", + className: "DeletedCertificateItem", modelProperties: { - value: { - readOnly: true, - serializedName: "value", + ...CertificateItem.type.modelProperties, + recoveryId: { + serializedName: "recoveryId", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CertificateIssuerItem" - } - } + name: "String" } }, - nextLink: { + scheduledPurgeDate: { + serializedName: "scheduledPurgeDate", readOnly: true, - serializedName: "nextLink", type: { - name: "String" + name: "UnixTime" } - } - } - } -}; - -export const PendingCertificateSigningRequestResult: coreHttp.CompositeMapper = { - serializedName: "PendingCertificateSigningRequestResult", - type: { - name: "Composite", - className: "PendingCertificateSigningRequestResult", - modelProperties: { - value: { + }, + deletedDate: { + serializedName: "deletedDate", readOnly: true, - serializedName: "value", - type: { - name: "String" - } - } - } - } -}; - -export const CertificateRestoreParameters: coreHttp.CompositeMapper = { - serializedName: "CertificateRestoreParameters", - type: { - name: "Composite", - className: "CertificateRestoreParameters", - modelProperties: { - certificateBundleBackup: { - required: true, - serializedName: "value", type: { - name: "Base64Url" + name: "UnixTime" } } } } }; -export const BackupCertificateResult: coreHttp.CompositeMapper = { - serializedName: "BackupCertificateResult", +export const PendingCertificateSigningRequestResult: coreHttp.CompositeMapper = { type: { name: "Composite", - className: "BackupCertificateResult", + className: "PendingCertificateSigningRequestResult", modelProperties: { value: { - readOnly: true, serializedName: "value", - type: { - name: "Base64Url" - } - } - } - } -}; - -export const KeyVaultError: coreHttp.CompositeMapper = { - serializedName: "KeyVaultError", - type: { - name: "Composite", - className: "KeyVaultError", - modelProperties: { - error: { readOnly: true, - serializedName: "error", type: { - name: "Composite", - className: "ErrorModel" + name: "String" } } } diff --git a/sdk/keyvault/keyvault-certificates/src/generated/models/parameters.ts b/sdk/keyvault/keyvault-certificates/src/generated/models/parameters.ts index 19885bf83864..fdc073fd6db4 100644 --- a/sdk/keyvault/keyvault-certificates/src/generated/models/parameters.ts +++ b/sdk/keyvault/keyvault-certificates/src/generated/models/parameters.ts @@ -1,102 +1,191 @@ /* - * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreHttp from "@azure/core-http"; +import { + OperationURLParameter, + OperationQueryParameter, + OperationParameter +} from "@azure/core-http"; +import { + Contacts as ContactsMapper, + CertificateIssuerSetParameters as CertificateIssuerSetParametersMapper, + CertificateIssuerUpdateParameters as CertificateIssuerUpdateParametersMapper, + CertificateCreateParameters as CertificateCreateParametersMapper, + CertificateImportParameters as CertificateImportParametersMapper, + CertificatePolicy as CertificatePolicyMapper, + CertificateUpdateParameters as CertificateUpdateParametersMapper, + CertificateOperationUpdateParameter as CertificateOperationUpdateParameterMapper, + CertificateMergeParameters as CertificateMergeParametersMapper, + CertificateRestoreParameters as CertificateRestoreParametersMapper +} from "../models/mappers"; -export const apiVersion: coreHttp.OperationQueryParameter = { - parameterPath: "apiVersion", +export const vaultBaseUrl: OperationURLParameter = { + parameterPath: "vaultBaseUrl", mapper: { + serializedName: "vaultBaseUrl", required: true, - serializedName: "api-version", type: { name: "String" } + }, + skipEncoding: true +}; + +export const maxresults: OperationQueryParameter = { + parameterPath: ["options", "maxresults"], + mapper: { + constraints: { + InclusiveMaximum: 25, + InclusiveMinimum: 1 + }, + serializedName: "maxresults", + type: { + name: "Number" + } } }; -export const certificateName0: coreHttp.OperationURLParameter = { - parameterPath: "certificateName", + +export const includePending: OperationQueryParameter = { + parameterPath: ["options", "includePending"], mapper: { - required: true, - serializedName: "certificate-name", + serializedName: "includePending", type: { - name: "String" + name: "Boolean" } } }; -export const certificateName1: coreHttp.OperationURLParameter = { - parameterPath: "certificateName", + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - required: true, - serializedName: "certificate-name", - constraints: { - Pattern: /^[0-9a-zA-Z-]+$/ - }, + defaultValue: "7.2-preview", + isConstant: true, + serializedName: "api-version", type: { name: "String" } } }; -export const certificateVersion: coreHttp.OperationURLParameter = { - parameterPath: "certificateVersion", + +export const certificateName: OperationURLParameter = { + parameterPath: "certificateName", mapper: { + serializedName: "certificate-name", required: true, - serializedName: "certificate-version", type: { name: "String" } } }; -export const includePending: coreHttp.OperationQueryParameter = { - parameterPath: [ - "options", - "includePending" - ], + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - serializedName: "includePending", + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { - name: "Boolean" + name: "String" } } }; -export const issuerName: coreHttp.OperationURLParameter = { + +export const contacts: OperationParameter = { + parameterPath: "contacts", + mapper: ContactsMapper +}; + +export const parameter: OperationParameter = { + parameterPath: "parameter", + mapper: CertificateIssuerSetParametersMapper +}; + +export const issuerName: OperationURLParameter = { parameterPath: "issuerName", mapper: { - required: true, serializedName: "issuer-name", + required: true, type: { name: "String" } } }; -export const maxresults: coreHttp.OperationQueryParameter = { - parameterPath: [ - "options", - "maxresults" - ], + +export const parameter1: OperationParameter = { + parameterPath: "parameter", + mapper: CertificateIssuerUpdateParametersMapper +}; + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: CertificateCreateParametersMapper +}; + +export const certificateName1: OperationURLParameter = { + parameterPath: "certificateName", mapper: { - serializedName: "maxresults", constraints: { - InclusiveMaximum: 25, - InclusiveMinimum: 1 + Pattern: new RegExp("^[0-9a-zA-Z-]+$") }, + serializedName: "certificate-name", + required: true, type: { - name: "Number" + name: "String" } } }; -export const vaultBaseUrl: coreHttp.OperationURLParameter = { - parameterPath: "vaultBaseUrl", + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: CertificateImportParametersMapper +}; + +export const certificatePolicy: OperationParameter = { + parameterPath: "certificatePolicy", + mapper: CertificatePolicyMapper +}; + +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: CertificateUpdateParametersMapper +}; + +export const certificateVersion: OperationURLParameter = { + parameterPath: "certificateVersion", mapper: { + serializedName: "certificate-version", + required: true, + type: { + name: "String" + } + } +}; + +export const certificateOperation: OperationParameter = { + parameterPath: "certificateOperation", + mapper: CertificateOperationUpdateParameterMapper +}; + +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: CertificateMergeParametersMapper +}; + +export const parameters4: OperationParameter = { + parameterPath: "parameters", + mapper: CertificateRestoreParametersMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", required: true, - serializedName: "vaultBaseUrl", - defaultValue: '', type: { name: "String" } From f9bc48b510532314d2faac01c4f24c8dd9183738 Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Fri, 26 Jun 2020 14:04:38 +0000 Subject: [PATCH 4/5] it builds --- .../review/keyvault-certificates.api.md | 6 +- .../src/generated/keyVaultClientContext.ts | 2 +- .../keyvault-certificates/src/index.ts | 159 +++++++++--------- 3 files changed, 84 insertions(+), 83 deletions(-) diff --git a/sdk/keyvault/keyvault-certificates/review/keyvault-certificates.api.md b/sdk/keyvault/keyvault-certificates/review/keyvault-certificates.api.md index 4b346221025b..cba774d1fda5 100644 --- a/sdk/keyvault/keyvault-certificates/review/keyvault-certificates.api.md +++ b/sdk/keyvault/keyvault-certificates/review/keyvault-certificates.api.md @@ -12,7 +12,7 @@ import { PollOperationState } from '@azure/core-lro'; import { TokenCredential } from '@azure/core-http'; // @public -export type ActionType = 'EmailContacts' | 'AutoRenew'; +export type ActionType = "EmailContacts" | "AutoRenew"; // @public export interface AdministratorContact { @@ -246,7 +246,7 @@ export interface DeletedCertificate extends KeyVaultCertificateWithPolicy { export type DeleteIssuerOptions = coreHttp.OperationOptions; // @public -export type DeletionRecoveryLevel = 'Purgeable' | 'Recoverable+Purgeable' | 'Recoverable' | 'Recoverable+ProtectedSubscription' | 'CustomizedRecoverable+Purgeable' | 'CustomizedRecoverable' | 'CustomizedRecoverable+ProtectedSubscription'; +export type DeletionRecoveryLevel = "Purgeable" | "Recoverable+Purgeable" | "Recoverable" | "Recoverable+ProtectedSubscription" | "CustomizedRecoverable+Purgeable" | "CustomizedRecoverable" | "CustomizedRecoverable+ProtectedSubscription"; // @public export interface ErrorModel { @@ -315,7 +315,7 @@ export interface IssuerProperties { } // @public -export type KeyUsageType = 'digitalSignature' | 'nonRepudiation' | 'keyEncipherment' | 'dataEncipherment' | 'keyAgreement' | 'keyCertSign' | 'cRLSign' | 'encipherOnly' | 'decipherOnly'; +export type KeyUsageType = "digitalSignature" | "nonRepudiation" | "keyEncipherment" | "dataEncipherment" | "keyAgreement" | "keyCertSign" | "cRLSign" | "encipherOnly" | "decipherOnly"; // @public export interface KeyVaultCertificate { diff --git a/sdk/keyvault/keyvault-certificates/src/generated/keyVaultClientContext.ts b/sdk/keyvault/keyvault-certificates/src/generated/keyVaultClientContext.ts index bd5f72c7687f..3261689f7417 100644 --- a/sdk/keyvault/keyvault-certificates/src/generated/keyVaultClientContext.ts +++ b/sdk/keyvault/keyvault-certificates/src/generated/keyVaultClientContext.ts @@ -10,7 +10,7 @@ import * as coreHttp from "@azure/core-http"; import { KeyVaultClientOptionalParams } from "./models"; const packageName = "@azure/keyvault-certificates"; -const packageVersion = "1.0.0"; +export const packageVersion = "4.1.0-preview.2"; export class KeyVaultClientContext extends coreHttp.ServiceClient { apiVersion: string; diff --git a/sdk/keyvault/keyvault-certificates/src/index.ts b/sdk/keyvault/keyvault-certificates/src/index.ts index fa99fce5b05a..6837a7792c1e 100644 --- a/sdk/keyvault/keyvault-certificates/src/index.ts +++ b/sdk/keyvault/keyvault-certificates/src/index.ts @@ -94,7 +94,6 @@ import { KeyVaultClientGetCertificatesOptionalParams, KeyVaultClientGetCertificateIssuersOptionalParams, KeyVaultClientGetCertificateVersionsOptionalParams, - KeyVaultClientSetCertificateIssuerOptionalParams, CertificateOperation as CoreCertificateOperation, CertificateAttributes as CoreCertificateAttributes, CertificatePolicy as CoreCertificatePolicy, @@ -108,34 +107,35 @@ import { IssuerAttributes, KeyUsageType, X509CertificateProperties, - DeleteCertificateResponse, - DeleteCertificateContactsResponse, - SetCertificateContactsResponse, - GetCertificateContactsResponse, - SetCertificateIssuerResponse, - UpdateCertificateIssuerResponse, - GetCertificateIssuerResponse, - DeleteCertificateIssuerResponse, - CreateCertificateResponse, - GetCertificateResponse, - ImportCertificateResponse, - GetCertificatePolicyResponse, - UpdateCertificatePolicyResponse, - UpdateCertificateResponse, - UpdateCertificateOperationResponse, - GetCertificateOperationResponse, - DeleteCertificateOperationResponse, - MergeCertificateResponse, - BackupCertificateResponse, - RestoreCertificateResponse, - GetDeletedCertificateResponse, - RecoverDeletedCertificateResponse, + KeyVaultClientDeleteCertificateResponse, + KeyVaultClientDeleteCertificateContactsResponse, + KeyVaultClientSetCertificateContactsResponse, + KeyVaultClientGetCertificateContactsResponse, + KeyVaultClientSetCertificateIssuerResponse, + KeyVaultClientUpdateCertificateIssuerResponse, + KeyVaultClientGetCertificateIssuerResponse, + KeyVaultClientDeleteCertificateIssuerResponse, + KeyVaultClientCreateCertificateResponse, + KeyVaultClientGetCertificateResponse, + KeyVaultClientImportCertificateResponse, + KeyVaultClientGetCertificatePolicyResponse, + KeyVaultClientUpdateCertificatePolicyResponse, + KeyVaultClientUpdateCertificateResponse, + KeyVaultClientUpdateCertificateOperationResponse, + KeyVaultClientDeleteCertificateOperationResponse, + KeyVaultClientMergeCertificateResponse, + KeyVaultClientBackupCertificateResponse, + KeyVaultClientRestoreCertificateResponse, + KeyVaultClientGetDeletedCertificateResponse, + KeyVaultClientRecoverDeletedCertificateResponse, SubjectAlternativeNames as CoreSubjectAlternativeNames, ActionType, DeletionRecoveryLevel, CertificateAttributes, Contacts as CoreContacts, - IssuerBundle + IssuerBundle, + KeyVaultClientOptionalParams, + CertificateIssuerSetParameters } from "./generated/models"; import { KeyVaultClient } from "./generated/keyVaultClient"; import { SDK_VERSION } from "./generated/utils/constants"; @@ -471,10 +471,11 @@ export class CertificateClient { }; const pipeline = createPipelineFromOptions(internalPipelineOptions, authPolicy); - this.client = new KeyVaultClient( - pipelineOptions.apiVersion || LATEST_API_VERSION, - pipeline - ); + const optionalParams: KeyVaultClientOptionalParams = { + ...pipeline, + apiVersion: pipelineOptions.apiVersion || LATEST_API_VERSION + } + this.client = new KeyVaultClient(optionalParams); } private async *listPropertiesOfCertificatesPage( @@ -727,7 +728,7 @@ export class CertificateClient { const span = this.createSpan("deleteContacts", requestOptions); - let result: DeleteCertificateContactsResponse; + let result: KeyVaultClientDeleteCertificateContactsResponse; try { result = await this.client.deleteCertificateContacts( @@ -770,7 +771,7 @@ export class CertificateClient { const span = this.createSpan("setCertificateContacts", requestOptions); - let result: SetCertificateContactsResponse; + let result: KeyVaultClientSetCertificateContactsResponse; try { result = await this.client.setCertificateContacts( @@ -807,7 +808,7 @@ export class CertificateClient { const requestOptions = operationOptionsToRequestOptionsBase(options); const span = this.createSpan("getCertificateContacts", requestOptions); - let result: GetCertificateContactsResponse; + let result: KeyVaultClientGetCertificateContactsResponse; try { result = await this.client.getCertificateContacts( this.vaultUrl, @@ -928,24 +929,18 @@ export class CertificateClient { provider: string, options: CreateIssuerOptions = {} ): Promise { - // Unflatten issuer credentials - const unflattenedOptions = { - ...options, - credentials: { accountId: options.accountId, password: options.password } - }; - - const requestOptions = operationOptionsToRequestOptionsBase(unflattenedOptions); + const requestOptions = operationOptionsToRequestOptionsBase(options); const span = this.createSpan("createIssuer", requestOptions); - const properties: IssuerProperties = requestOptions.properties || {}; const credentials: IssuerCredentials = requestOptions.credentials || {}; - const generatedOptions: KeyVaultClientSetCertificateIssuerOptionalParams = { - ...requestOptions, - id: properties.id || requestOptions.id, - provider: properties.provider || requestOptions.provider + const setIssuerOptions: CertificateIssuerSetParameters = { + provider, + attributes: { + enabled: options.enabled + } }; - generatedOptions.credentials = { + setIssuerOptions.credentials = { accountId: credentials.accountId || requestOptions.accountId, password: credentials.password || requestOptions.password }; @@ -954,7 +949,7 @@ export class CertificateClient { options.organizationId || (options.administratorContacts && options.administratorContacts.length) ) { - generatedOptions.organizationDetails = { + setIssuerOptions.organizationDetails = { id: options.organizationId, adminDetails: options.administratorContacts ? options.administratorContacts.map((x) => ({ @@ -968,19 +963,19 @@ export class CertificateClient { } if (options.enabled !== undefined) { - generatedOptions.attributes = { + setIssuerOptions.attributes = { enabled: options.enabled }; } - let result: SetCertificateIssuerResponse; + let result: KeyVaultClientSetCertificateIssuerResponse; try { result = await this.client.setCertificateIssuer( this.vaultUrl, issuerName, - provider, - this.setParentSpan(span, generatedOptions) + setIssuerOptions, + this.setParentSpan(span, requestOptions) ); } finally { span.end(); @@ -1013,13 +1008,14 @@ export class CertificateClient { const properties: IssuerProperties = requestOptions.properties || {}; const credentials: IssuerCredentials = requestOptions.credentials || {}; - const generatedOptions: KeyVaultClientSetCertificateIssuerOptionalParams = { - ...requestOptions, - id: properties.id || requestOptions.id, - provider: properties.provider || requestOptions.provider + const setIssuerOptions: CertificateIssuerSetParameters = { + provider: properties.provider || requestOptions.provider, + attributes: { + enabled: options.enabled + } }; - generatedOptions.credentials = { + setIssuerOptions.credentials = { accountId: credentials.accountId || requestOptions.accountId, password: credentials.password || requestOptions.password }; @@ -1028,7 +1024,7 @@ export class CertificateClient { options.organizationId || (options.administratorContacts && options.administratorContacts.length) ) { - generatedOptions.organizationDetails = { + setIssuerOptions.organizationDetails = { id: options.organizationId, adminDetails: options.administratorContacts ? options.administratorContacts.map((x) => ({ @@ -1042,17 +1038,18 @@ export class CertificateClient { } if (options.enabled) { - generatedOptions.attributes = { + setIssuerOptions.attributes = { enabled: options.enabled }; } - let result: UpdateCertificateIssuerResponse; + let result: KeyVaultClientUpdateCertificateIssuerResponse; try { result = await this.client.updateCertificateIssuer( this.vaultUrl, issuerName, + setIssuerOptions, this.setParentSpan(span, requestOptions) ); } finally { @@ -1085,7 +1082,7 @@ export class CertificateClient { const requestOptions = operationOptionsToRequestOptionsBase(options); const span = this.createSpan("getCertificateIssuer", requestOptions); - let result: GetCertificateIssuerResponse; + let result: KeyVaultClientGetCertificateIssuerResponse; try { result = await this.client.getCertificateIssuer( @@ -1120,7 +1117,7 @@ export class CertificateClient { const requestOptions = operationOptionsToRequestOptionsBase(options); const span = this.createSpan("deleteCertificateIssuer", requestOptions); - let result: DeleteCertificateIssuerResponse; + let result: KeyVaultClientDeleteCertificateIssuerResponse; try { result = await this.client.deleteCertificateIssuer( @@ -1215,7 +1212,7 @@ export class CertificateClient { const requestOptions = operationOptionsToRequestOptionsBase(options); const span = this.createSpan("getCertificate", requestOptions); - let result: GetCertificateResponse; + let result: KeyVaultClientGetCertificateResponse; try { result = await this.client.getCertificate( @@ -1263,7 +1260,7 @@ export class CertificateClient { const span = this.createSpan("getCertificateVersion", requestOptions); - let result: GetCertificateResponse; + let result: KeyVaultClientGetCertificateResponse; try { result = await this.client.getCertificate( @@ -1318,13 +1315,15 @@ export class CertificateClient { options.policy?.contentType ); - let result: ImportCertificateResponse; + let result: KeyVaultClientImportCertificateResponse; try { result = await this.client.importCertificate( this.vaultUrl, certificateName, - base64EncodedCertificate, + { + base64EncodedCertificate + }, this.setParentSpan(span, requestOptions) ); } finally { @@ -1358,7 +1357,7 @@ export class CertificateClient { const requestOptions = operationOptionsToRequestOptionsBase(options); const span = this.createSpan("getCertificatePolicy", requestOptions); - let result: GetCertificatePolicyResponse; + let result: KeyVaultClientGetCertificatePolicyResponse; try { result = await this.client.getCertificatePolicy( @@ -1390,7 +1389,7 @@ export class CertificateClient { const corePolicy = toCorePolicy(undefined, policy); - let result: UpdateCertificatePolicyResponse; + let result: KeyVaultClientUpdateCertificatePolicyResponse; try { result = await this.client.updateCertificatePolicy( this.vaultUrl, @@ -1434,7 +1433,7 @@ export class CertificateClient { const requestOptions = operationOptionsToRequestOptionsBase(options); const span = this.createSpan("updateCertificateProperties", requestOptions); - let result: UpdateCertificateResponse; + let result: KeyVaultClientUpdateCertificateResponse; try { result = await this.client.updateCertificate( @@ -1470,12 +1469,14 @@ export class CertificateClient { const requestOptions = operationOptionsToRequestOptionsBase(options); const span = this.createSpan("cancelCertificateOperation", requestOptions); - let result: UpdateCertificateOperationResponse; + let result: KeyVaultClientUpdateCertificateOperationResponse; try { result = await this.client.updateCertificateOperation( this.vaultUrl, certificateName, - true, + { + cancellationRequested: true + }, this.setParentSpan(span, requestOptions) ); } finally { @@ -1553,7 +1554,7 @@ export class CertificateClient { const requestOptions = operationOptionsToRequestOptionsBase(options); const span = this.createSpan("deleteCertificateOperation", requestOptions); - let result: DeleteCertificateOperationResponse; + let result: KeyVaultClientDeleteCertificateOperationResponse; try { result = await this.client.deleteCertificateOperation( @@ -1614,12 +1615,12 @@ export class CertificateClient { const requestOptions = operationOptionsToRequestOptionsBase(options); const span = this.createSpan("mergeCertificate", requestOptions); - let result: MergeCertificateResponse; + let result: KeyVaultClientMergeCertificateResponse; try { result = await this.client.mergeCertificate( this.vaultUrl, certificateName, - x509Certificates, + { x509Certificates }, this.setParentSpan(span, requestOptions) ); } finally { @@ -1652,7 +1653,7 @@ export class CertificateClient { const requestOptions = operationOptionsToRequestOptionsBase(options); const span = this.createSpan("backupCertificate", requestOptions); - let result: BackupCertificateResponse; + let result: KeyVaultClientBackupCertificateResponse; try { result = await this.client.backupCertificate( this.vaultUrl, @@ -1693,12 +1694,12 @@ export class CertificateClient { const requestOptions = operationOptionsToRequestOptionsBase(options); const span = this.createSpan("restoreCertificate", requestOptions); - let result: RestoreCertificateResponse; + let result: KeyVaultClientRestoreCertificateResponse; try { result = await this.client.restoreCertificate( this.vaultUrl, - backup, + { certificateBundleBackup: backup }, this.setParentSpan(span, requestOptions) ); } finally { @@ -1816,7 +1817,7 @@ export class CertificateClient { const requestOptions = operationOptionsToRequestOptionsBase(options); const span = this.createSpan("getDeletedCertificate", requestOptions); - let result: GetDeletedCertificateResponse; + let result: KeyVaultClientGetDeletedCertificateResponse; try { result = await this.client.getDeletedCertificate( this.vaultUrl, @@ -1938,7 +1939,7 @@ export class CertificateClient { certificateAttributes }; - let result: CreateCertificateResponse; + let result: KeyVaultClientCreateCertificateResponse; try { result = await this.client.createCertificate(this.vaultUrl, certificateName, updatedOptions); @@ -1966,7 +1967,7 @@ export class CertificateClient { const span = this.createSpan("deleteCertificate", requestOptions); - let response: DeleteCertificateResponse; + let response: KeyVaultClientDeleteCertificateResponse; try { response = await this.client.deleteCertificate( this.vaultUrl, @@ -1996,7 +1997,7 @@ export class CertificateClient { const requestOptions = operationOptionsToRequestOptionsBase(options); const span = this.createSpan("recoverDeletedCertificate", requestOptions); - let result: RecoverDeletedCertificateResponse; + let result: KeyVaultClientRecoverDeletedCertificateResponse; try { result = await this.client.recoverDeletedCertificate( @@ -2050,7 +2051,7 @@ export class CertificateClient { ): Promise { const span = this.createSpan("getPlainCertificateOperation", options); - let result: GetCertificateOperationResponse; + let result: KeyVaultClientUpdateCertificateOperationResponse; try { result = await this.client.getCertificateOperation( From 024cfb6ea5d210497a08c43444b9fffd8e01f3da Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Fri, 26 Jun 2020 14:05:02 +0000 Subject: [PATCH 5/5] formatting --- sdk/keyvault/keyvault-certificates/src/index.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sdk/keyvault/keyvault-certificates/src/index.ts b/sdk/keyvault/keyvault-certificates/src/index.ts index 6837a7792c1e..bb715c54f31f 100644 --- a/sdk/keyvault/keyvault-certificates/src/index.ts +++ b/sdk/keyvault/keyvault-certificates/src/index.ts @@ -474,7 +474,7 @@ export class CertificateClient { const optionalParams: KeyVaultClientOptionalParams = { ...pipeline, apiVersion: pipelineOptions.apiVersion || LATEST_API_VERSION - } + }; this.client = new KeyVaultClient(optionalParams); } @@ -1436,15 +1436,10 @@ export class CertificateClient { let result: KeyVaultClientUpdateCertificateResponse; try { - result = await this.client.updateCertificate( - this.vaultUrl, - certificateName, - version, - { - ...this.setParentSpan(span, requestOptions), - certificateAttributes: toCoreAttributes(options) - } - ); + result = await this.client.updateCertificate(this.vaultUrl, certificateName, version, { + ...this.setParentSpan(span, requestOptions), + certificateAttributes: toCoreAttributes(options) + }); } finally { span.end(); }