diff --git a/lib/services/keyvault/lib/keyVaultClient.d.ts b/lib/services/keyvault/lib/keyVaultClient.d.ts index 2083732d8f..23a310181a 100644 --- a/lib/services/keyvault/lib/keyVaultClient.d.ts +++ b/lib/services/keyvault/lib/keyVaultClient.d.ts @@ -29,11 +29,11 @@ export default class KeyVaultClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, options?: AzureServiceClientOptions); @@ -89,7 +89,7 @@ export default class KeyVaultClient extends AzureServiceClient { * * @param {string} [options.curve] Elliptic curve name. For valid values, see * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', - * 'SECP256K1' + * 'P-256K' * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -141,7 +141,7 @@ export default class KeyVaultClient extends AzureServiceClient { * * @param {string} [options.curve] Elliptic curve name. For valid values, see * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', - * 'SECP256K1' + * 'P-256K' * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -190,8 +190,9 @@ export default class KeyVaultClient extends AzureServiceClient { * * @param {string} [key.kid] Key identifier. * - * @param {string} [key.kty] JsonWebKey key type (kty). Possible values - * include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @param {string} [key.kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible + * values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * * @param {array} [key.keyOps] * @@ -218,7 +219,7 @@ export default class KeyVaultClient extends AzureServiceClient { * * @param {string} [key.crv] Elliptic curve name. For valid values, see * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', - * 'SECP256K1' + * 'P-256K' * * @param {buffer} [key.x] X component of an EC public key. * @@ -269,8 +270,9 @@ export default class KeyVaultClient extends AzureServiceClient { * * @param {string} [key.kid] Key identifier. * - * @param {string} [key.kty] JsonWebKey key type (kty). Possible values - * include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @param {string} [key.kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible + * values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * * @param {array} [key.keyOps] * @@ -297,7 +299,7 @@ export default class KeyVaultClient extends AzureServiceClient { * * @param {string} [key.crv] Elliptic curve name. For valid values, see * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', - * 'SECP256K1' + * 'P-256K' * * @param {buffer} [key.x] X component of an EC public key. * @@ -1145,7 +1147,7 @@ export default class KeyVaultClient extends AzureServiceClient { * more information on possible algorithm types, see * JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', * 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', - * 'ECDSA256' + * 'ES256K' * * @param {buffer} value * @@ -1180,7 +1182,7 @@ export default class KeyVaultClient extends AzureServiceClient { * more information on possible algorithm types, see * JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', * 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', - * 'ECDSA256' + * 'ES256K' * * @param {buffer} value * @@ -1236,7 +1238,7 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {string} algorithm The signing/verification algorithm. For more * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. * Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', - * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256' + * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' * * @param {buffer} digest The digest used for signing. * @@ -1275,7 +1277,7 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {string} algorithm The signing/verification algorithm. For more * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. * Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', - * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256' + * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' * * @param {buffer} digest The digest used for signing. * @@ -2715,6 +2717,9 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {number} [options.maxresults] Maximum number of results to return in * a page. If not specified the service will return up to 25 results. * + * @param {boolean} [options.includePending] Specifies whether to include + * certificates which are not completely provisioned. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -2724,7 +2729,7 @@ export default class KeyVaultClient extends AzureServiceClient { * * @reject {Error|ServiceError} - The error object. */ - getCertificatesWithHttpOperationResponse(vaultBaseUrl: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + getCertificatesWithHttpOperationResponse(vaultBaseUrl: string, options?: { maxresults? : number, includePending? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary List certificates in a specified key vault @@ -2741,6 +2746,9 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {number} [options.maxresults] Maximum number of results to return in * a page. If not specified the service will return up to 25 results. * + * @param {boolean} [options.includePending] Specifies whether to include + * certificates which are not completely provisioned. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -2766,9 +2774,9 @@ export default class KeyVaultClient extends AzureServiceClient { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getCertificates(vaultBaseUrl: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getCertificates(vaultBaseUrl: string, options?: { maxresults? : number, includePending? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; getCertificates(vaultBaseUrl: string, callback: ServiceCallback): void; - getCertificates(vaultBaseUrl: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getCertificates(vaultBaseUrl: string, options: { maxresults? : number, includePending? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -3508,8 +3516,9 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {boolean} [options.certificatePolicy.keyProperties.exportable] * Indicates if the private key can be exported. * - * @param {string} [options.certificatePolicy.keyProperties.keyType] The key - * type. + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * * @param {number} [options.certificatePolicy.keyProperties.keySize] The key * size in bits. For example: 2048, 3072, or 4096 for RSA. @@ -3517,6 +3526,10 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] * Indicates if the same key pair will be used on certificate renewal. * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * * @param {object} [options.certificatePolicy.secretProperties] Properties of * the secret backing a certificate. * @@ -3570,6 +3583,11 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {string} [options.certificatePolicy.issuerParameters.certificateType] * Type of certificate to be requested from the issuer provider. * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * * @param {object} [options.certificatePolicy.attributes] The certificate * attributes. * @@ -3620,8 +3638,9 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {boolean} [options.certificatePolicy.keyProperties.exportable] * Indicates if the private key can be exported. * - * @param {string} [options.certificatePolicy.keyProperties.keyType] The key - * type. + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * * @param {number} [options.certificatePolicy.keyProperties.keySize] The key * size in bits. For example: 2048, 3072, or 4096 for RSA. @@ -3629,6 +3648,10 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] * Indicates if the same key pair will be used on certificate renewal. * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * * @param {object} [options.certificatePolicy.secretProperties] Properties of * the secret backing a certificate. * @@ -3682,6 +3705,11 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {string} [options.certificatePolicy.issuerParameters.certificateType] * Type of certificate to be requested from the issuer provider. * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * * @param {object} [options.certificatePolicy.attributes] The certificate * attributes. * @@ -3761,8 +3789,9 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {boolean} [options.certificatePolicy.keyProperties.exportable] * Indicates if the private key can be exported. * - * @param {string} [options.certificatePolicy.keyProperties.keyType] The key - * type. + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * * @param {number} [options.certificatePolicy.keyProperties.keySize] The key * size in bits. For example: 2048, 3072, or 4096 for RSA. @@ -3770,6 +3799,10 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] * Indicates if the same key pair will be used on certificate renewal. * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * * @param {object} [options.certificatePolicy.secretProperties] Properties of * the secret backing a certificate. * @@ -3823,6 +3856,11 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {string} [options.certificatePolicy.issuerParameters.certificateType] * Type of certificate to be requested from the issuer provider. * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * * @param {object} [options.certificatePolicy.attributes] The certificate * attributes. * @@ -3883,8 +3921,9 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {boolean} [options.certificatePolicy.keyProperties.exportable] * Indicates if the private key can be exported. * - * @param {string} [options.certificatePolicy.keyProperties.keyType] The key - * type. + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * * @param {number} [options.certificatePolicy.keyProperties.keySize] The key * size in bits. For example: 2048, 3072, or 4096 for RSA. @@ -3892,6 +3931,10 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] * Indicates if the same key pair will be used on certificate renewal. * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * * @param {object} [options.certificatePolicy.secretProperties] Properties of * the secret backing a certificate. * @@ -3945,6 +3988,11 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {string} [options.certificatePolicy.issuerParameters.certificateType] * Type of certificate to be requested from the issuer provider. * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * * @param {object} [options.certificatePolicy.attributes] The certificate * attributes. * @@ -4158,7 +4206,9 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {boolean} [certificatePolicy.keyProperties.exportable] Indicates if * the private key can be exported. * - * @param {string} [certificatePolicy.keyProperties.keyType] The key type. + * @param {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * * @param {number} [certificatePolicy.keyProperties.keySize] The key size in * bits. For example: 2048, 3072, or 4096 for RSA. @@ -4166,6 +4216,10 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if the * same key pair will be used on certificate renewal. * + * @param {string} [certificatePolicy.keyProperties.curve] Elliptic curve name. + * For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', + * 'P-384', 'P-521', 'P-256K' + * * @param {object} [certificatePolicy.secretProperties] Properties of the * secret backing a certificate. * @@ -4217,6 +4271,11 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {string} [certificatePolicy.issuerParameters.certificateType] Type of * certificate to be requested from the issuer provider. * + * @param {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. + * * @param {object} [certificatePolicy.attributes] The certificate attributes. * * @param {boolean} [certificatePolicy.attributes.enabled] Determines whether @@ -4260,7 +4319,9 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {boolean} [certificatePolicy.keyProperties.exportable] Indicates if * the private key can be exported. * - * @param {string} [certificatePolicy.keyProperties.keyType] The key type. + * @param {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * * @param {number} [certificatePolicy.keyProperties.keySize] The key size in * bits. For example: 2048, 3072, or 4096 for RSA. @@ -4268,6 +4329,10 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if the * same key pair will be used on certificate renewal. * + * @param {string} [certificatePolicy.keyProperties.curve] Elliptic curve name. + * For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', + * 'P-384', 'P-521', 'P-256K' + * * @param {object} [certificatePolicy.secretProperties] Properties of the * secret backing a certificate. * @@ -4319,6 +4384,11 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {string} [certificatePolicy.issuerParameters.certificateType] Type of * certificate to be requested from the issuer provider. * + * @param {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. + * * @param {object} [certificatePolicy.attributes] The certificate attributes. * * @param {boolean} [certificatePolicy.attributes.enabled] Determines whether @@ -4388,8 +4458,9 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {boolean} [options.certificatePolicy.keyProperties.exportable] * Indicates if the private key can be exported. * - * @param {string} [options.certificatePolicy.keyProperties.keyType] The key - * type. + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * * @param {number} [options.certificatePolicy.keyProperties.keySize] The key * size in bits. For example: 2048, 3072, or 4096 for RSA. @@ -4397,6 +4468,10 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] * Indicates if the same key pair will be used on certificate renewal. * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * * @param {object} [options.certificatePolicy.secretProperties] Properties of * the secret backing a certificate. * @@ -4450,6 +4525,11 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {string} [options.certificatePolicy.issuerParameters.certificateType] * Type of certificate to be requested from the issuer provider. * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * * @param {object} [options.certificatePolicy.attributes] The certificate * attributes. * @@ -4505,8 +4585,9 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {boolean} [options.certificatePolicy.keyProperties.exportable] * Indicates if the private key can be exported. * - * @param {string} [options.certificatePolicy.keyProperties.keyType] The key - * type. + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * * @param {number} [options.certificatePolicy.keyProperties.keySize] The key * size in bits. For example: 2048, 3072, or 4096 for RSA. @@ -4514,6 +4595,10 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] * Indicates if the same key pair will be used on certificate renewal. * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * * @param {object} [options.certificatePolicy.secretProperties] Properties of * the secret backing a certificate. * @@ -4567,6 +4652,11 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {string} [options.certificatePolicy.issuerParameters.certificateType] * Type of certificate to be requested from the issuer provider. * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * * @param {object} [options.certificatePolicy.attributes] The certificate * attributes. * @@ -5001,6 +5091,145 @@ export default class KeyVaultClient extends AzureServiceClient { mergeCertificate(vaultBaseUrl: string, certificateName: string, x509Certificates: Buffer[], options: { certificateAttributes? : models.CertificateAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Backs up the specified certificate. + * + * 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 {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + backupCertificateWithHttpOperationResponse(vaultBaseUrl: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Backs up the specified certificate. + * + * 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 {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {BackupCertificateResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {BackupCertificateResult} [result] - The deserialized result object if an error did not occur. + * See {@link BackupCertificateResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + backupCertificate(vaultBaseUrl: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + backupCertificate(vaultBaseUrl: string, certificateName: string, callback: ServiceCallback): void; + backupCertificate(vaultBaseUrl: string, certificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a backed up certificate to a vault. + * + * Restores a backed up certificate, and all its versions, to a vault. This + * operation requires the certificates/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} certificateBundleBackup The backup blob associated with a + * certificate bundle. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + restoreCertificateWithHttpOperationResponse(vaultBaseUrl: string, certificateBundleBackup: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a backed up certificate to a vault. + * + * Restores a backed up certificate, and all its versions, to a vault. This + * operation requires the certificates/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} certificateBundleBackup The backup blob associated with a + * certificate bundle. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {CertificateBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CertificateBundle} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + restoreCertificate(vaultBaseUrl: string, certificateBundleBackup: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restoreCertificate(vaultBaseUrl: string, certificateBundleBackup: Buffer, callback: ServiceCallback): void; + restoreCertificate(vaultBaseUrl: string, certificateBundleBackup: Buffer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Lists the deleted certificates in the specified vault currently * available for recovery. @@ -5019,6 +5248,9 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {number} [options.maxresults] Maximum number of results to return in * a page. If not specified the service will return up to 25 results. * + * @param {boolean} [options.includePending] Specifies whether to include + * certificates which are not completely provisioned. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -5028,7 +5260,7 @@ export default class KeyVaultClient extends AzureServiceClient { * * @reject {Error|ServiceError} - The error object. */ - getDeletedCertificatesWithHttpOperationResponse(vaultBaseUrl: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + getDeletedCertificatesWithHttpOperationResponse(vaultBaseUrl: string, options?: { maxresults? : number, includePending? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Lists the deleted certificates in the specified vault currently @@ -5048,6 +5280,9 @@ export default class KeyVaultClient extends AzureServiceClient { * @param {number} [options.maxresults] Maximum number of results to return in * a page. If not specified the service will return up to 25 results. * + * @param {boolean} [options.includePending] Specifies whether to include + * certificates which are not completely provisioned. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -5074,9 +5309,9 @@ export default class KeyVaultClient extends AzureServiceClient { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getDeletedCertificates(vaultBaseUrl: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedCertificates(vaultBaseUrl: string, options?: { maxresults? : number, includePending? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; getDeletedCertificates(vaultBaseUrl: string, callback: ServiceCallback): void; - getDeletedCertificates(vaultBaseUrl: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getDeletedCertificates(vaultBaseUrl: string, options: { maxresults? : number, includePending? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -5362,38 +5597,46 @@ export default class KeyVaultClient extends AzureServiceClient { /** - * Deletes a storage account. This operation requires the storage/delete - * permission. + * @summary Lists deleted storage accounts for the specified vault. + * + * The Get Deleted Storage Accounts operation returns the storage accounts that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/list permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} storageAccountName The name of the storage account. - * * @param {object} [options] Optional Parameters. * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getDeletedStorageAccountsWithHttpOperationResponse(vaultBaseUrl: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a storage account. This operation requires the storage/delete - * permission. + * @summary Lists deleted storage accounts for the specified vault. + * + * The Get Deleted Storage Accounts operation returns the storage accounts that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/list permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} storageAccountName The name of the storage account. - * * @param {object} [options] Optional Parameters. * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -5404,7 +5647,7 @@ export default class KeyVaultClient extends AzureServiceClient { * * {Promise} A promise is returned. * - * @resolve {StorageBundle} - The deserialized result object. + * @resolve {DeletedStorageListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5412,21 +5655,25 @@ export default class KeyVaultClient extends AzureServiceClient { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {StorageBundle} [result] - The deserialized result object if an error did not occur. - * See {@link StorageBundle} for more information. + * {DeletedStorageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedStorageListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteStorageAccount(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteStorageAccount(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; - deleteStorageAccount(vaultBaseUrl: string, storageAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getDeletedStorageAccounts(vaultBaseUrl: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedStorageAccounts(vaultBaseUrl: string, callback: ServiceCallback): void; + getDeletedStorageAccounts(vaultBaseUrl: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets information about a specified storage account. This operation requires - * the storage/get permission. + * @summary Gets the specified deleted storage account. + * + * The Get Deleted Storage Account operation returns the specified deleted + * storage account along with its attributes. This operation requires the + * storage/get permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. @@ -5440,15 +5687,18 @@ export default class KeyVaultClient extends AzureServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getDeletedStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets information about a specified storage account. This operation requires - * the storage/get permission. + * @summary Gets the specified deleted storage account. + * + * The Get Deleted Storage Account operation returns the specified deleted + * storage account along with its attributes. This operation requires the + * storage/get permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. @@ -5467,7 +5717,7 @@ export default class KeyVaultClient extends AzureServiceClient { * * {Promise} A promise is returned. * - * @resolve {StorageBundle} - The deserialized result object. + * @resolve {DeletedStorageBundle} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5475,89 +5725,59 @@ export default class KeyVaultClient extends AzureServiceClient { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {StorageBundle} [result] - The deserialized result object if an error did not occur. - * See {@link StorageBundle} for more information. + * {DeletedStorageBundle} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedStorageBundle} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getStorageAccount(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getStorageAccount(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; - getStorageAccount(vaultBaseUrl: string, storageAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getDeletedStorageAccount(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedStorageAccount(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; + getDeletedStorageAccount(vaultBaseUrl: string, storageAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a new storage account. This operation requires the - * storage/set permission. + * @summary Permanently deletes the specified storage account. + * + * The purge deleted storage account operation removes the secret permanently, + * without the possibility of recovery. This operation can only be performed on + * a soft-delete enabled vault. This operation requires the storage/purge + * permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} storageAccountName The name of the storage account. * - * @param {string} resourceId Storage account resource id. - * - * @param {string} activeKeyName Current active storage account key name. - * - * @param {boolean} autoRegenerateKey whether keyvault should manage the - * storage account for the user. - * * @param {object} [options] Optional Parameters. * - * @param {string} [options.regenerationPeriod] The key regeneration time - * duration specified in ISO-8601 format. - * - * @param {object} [options.storageAccountAttributes] The attributes of the - * storage account. - * - * @param {boolean} [options.storageAccountAttributes.enabled] the enabled - * state of the object. - * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - setStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, resourceId: string, activeKeyName: string, autoRegenerateKey: boolean, options?: { regenerationPeriod? : string, storageAccountAttributes? : models.StorageAccountAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise>; + purgeDeletedStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a new storage account. This operation requires the - * storage/set permission. + * @summary Permanently deletes the specified storage account. + * + * The purge deleted storage account operation removes the secret permanently, + * without the possibility of recovery. This operation can only be performed on + * a soft-delete enabled vault. This operation requires the storage/purge + * permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} storageAccountName The name of the storage account. * - * @param {string} resourceId Storage account resource id. - * - * @param {string} activeKeyName Current active storage account key name. - * - * @param {boolean} autoRegenerateKey whether keyvault should manage the - * storage account for the user. - * * @param {object} [options] Optional Parameters. * - * @param {string} [options.regenerationPeriod] The key regeneration time - * duration specified in ISO-8601 format. - * - * @param {object} [options.storageAccountAttributes] The attributes of the - * storage account. - * - * @param {boolean} [options.storageAccountAttributes.enabled] the enabled - * state of the object. - * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -5568,7 +5788,7 @@ export default class KeyVaultClient extends AzureServiceClient { * * {Promise} A promise is returned. * - * @resolve {StorageBundle} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5576,21 +5796,23 @@ export default class KeyVaultClient extends AzureServiceClient { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {StorageBundle} [result] - The deserialized result object if an error did not occur. - * See {@link StorageBundle} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - setStorageAccount(vaultBaseUrl: string, storageAccountName: string, resourceId: string, activeKeyName: string, autoRegenerateKey: boolean, options?: { regenerationPeriod? : string, storageAccountAttributes? : models.StorageAccountAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise; - setStorageAccount(vaultBaseUrl: string, storageAccountName: string, resourceId: string, activeKeyName: string, autoRegenerateKey: boolean, callback: ServiceCallback): void; - setStorageAccount(vaultBaseUrl: string, storageAccountName: string, resourceId: string, activeKeyName: string, autoRegenerateKey: boolean, options: { regenerationPeriod? : string, storageAccountAttributes? : models.StorageAccountAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + purgeDeletedStorageAccount(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + purgeDeletedStorageAccount(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; + purgeDeletedStorageAccount(vaultBaseUrl: string, storageAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates the specified attributes associated with the given storage account. - * This operation requires the storage/set/update permission. + * @summary Recovers the deleted storage account. + * + * Recovers the deleted storage account in the specified vault. This operation + * can only be performed on a soft-delete enabled vault. This operation + * requires the storage/recover permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. @@ -5599,24 +5821,6 @@ export default class KeyVaultClient extends AzureServiceClient { * * @param {object} [options] Optional Parameters. * - * @param {string} [options.activeKeyName] The current active storage account - * key name. - * - * @param {boolean} [options.autoRegenerateKey] whether keyvault should manage - * the storage account for the user. - * - * @param {string} [options.regenerationPeriod] The key regeneration time - * duration specified in ISO-8601 format. - * - * @param {object} [options.storageAccountAttributes] The attributes of the - * storage account. - * - * @param {boolean} [options.storageAccountAttributes.enabled] the enabled - * state of the object. - * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -5626,11 +5830,14 @@ export default class KeyVaultClient extends AzureServiceClient { * * @reject {Error|ServiceError} - The error object. */ - updateStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { activeKeyName? : string, autoRegenerateKey? : boolean, regenerationPeriod? : string, storageAccountAttributes? : models.StorageAccountAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise>; + recoverDeletedStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates the specified attributes associated with the given storage account. - * This operation requires the storage/set/update permission. + * @summary Recovers the deleted storage account. + * + * Recovers the deleted storage account in the specified vault. This operation + * can only be performed on a soft-delete enabled vault. This operation + * requires the storage/recover permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. @@ -5639,23 +5846,603 @@ export default class KeyVaultClient extends AzureServiceClient { * * @param {object} [options] Optional Parameters. * - * @param {string} [options.activeKeyName] The current active storage account - * key name. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [options.autoRegenerateKey] whether keyvault should manage - * the storage account for the user. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [options.regenerationPeriod] The key regeneration time + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {StorageBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {StorageBundle} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + recoverDeletedStorageAccount(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + recoverDeletedStorageAccount(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; + recoverDeletedStorageAccount(vaultBaseUrl: string, storageAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Backs up the specified storage account. + * + * Requests that a backup of the specified storage account be downloaded to the + * client. This operation requires the storage/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + backupStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Backs up the specified storage account. + * + * Requests that a backup of the specified storage account be downloaded to the + * client. This operation requires the storage/backup permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {BackupStorageResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {BackupStorageResult} [result] - The deserialized result object if an error did not occur. + * See {@link BackupStorageResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + backupStorageAccount(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + backupStorageAccount(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; + backupStorageAccount(vaultBaseUrl: string, storageAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a backed up storage account to a vault. + * + * Restores a backed up storage account to a vault. This operation requires the + * storage/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} storageBundleBackup The backup blob associated with a + * storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + restoreStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageBundleBackup: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a backed up storage account to a vault. + * + * Restores a backed up storage account to a vault. This operation requires the + * storage/restore permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {buffer} storageBundleBackup The backup blob associated with a + * storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {StorageBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {StorageBundle} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + restoreStorageAccount(vaultBaseUrl: string, storageBundleBackup: Buffer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restoreStorageAccount(vaultBaseUrl: string, storageBundleBackup: Buffer, callback: ServiceCallback): void; + restoreStorageAccount(vaultBaseUrl: string, storageBundleBackup: Buffer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a storage account. This operation requires the storage/delete + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a storage account. This operation requires the storage/delete + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeletedStorageBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedStorageBundle} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedStorageBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteStorageAccount(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteStorageAccount(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; + deleteStorageAccount(vaultBaseUrl: string, storageAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets information about a specified storage account. This operation requires + * the storage/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets information about a specified storage account. This operation requires + * the storage/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {StorageBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {StorageBundle} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getStorageAccount(vaultBaseUrl: string, storageAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getStorageAccount(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; + getStorageAccount(vaultBaseUrl: string, storageAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a new storage account. This operation requires the + * storage/set permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} resourceId Storage account resource id. + * + * @param {string} activeKeyName Current active storage account key name. + * + * @param {boolean} autoRegenerateKey whether keyvault should manage the + * storage account for the user. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.regenerationPeriod] The key regeneration time + * duration specified in ISO-8601 format. + * + * @param {object} [options.storageAccountAttributes] The attributes of the + * storage account. + * + * @param {boolean} [options.storageAccountAttributes.enabled] the enabled + * state of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + setStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, resourceId: string, activeKeyName: string, autoRegenerateKey: boolean, options?: { regenerationPeriod? : string, storageAccountAttributes? : models.StorageAccountAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a new storage account. This operation requires the + * storage/set permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} resourceId Storage account resource id. + * + * @param {string} activeKeyName Current active storage account key name. + * + * @param {boolean} autoRegenerateKey whether keyvault should manage the + * storage account for the user. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.regenerationPeriod] The key regeneration time + * duration specified in ISO-8601 format. + * + * @param {object} [options.storageAccountAttributes] The attributes of the + * storage account. + * + * @param {boolean} [options.storageAccountAttributes.enabled] the enabled + * state of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {StorageBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {StorageBundle} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + setStorageAccount(vaultBaseUrl: string, storageAccountName: string, resourceId: string, activeKeyName: string, autoRegenerateKey: boolean, options?: { regenerationPeriod? : string, storageAccountAttributes? : models.StorageAccountAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise; + setStorageAccount(vaultBaseUrl: string, storageAccountName: string, resourceId: string, activeKeyName: string, autoRegenerateKey: boolean, callback: ServiceCallback): void; + setStorageAccount(vaultBaseUrl: string, storageAccountName: string, resourceId: string, activeKeyName: string, autoRegenerateKey: boolean, options: { regenerationPeriod? : string, storageAccountAttributes? : models.StorageAccountAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates the specified attributes associated with the given storage account. + * This operation requires the storage/set/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.activeKeyName] The current active storage account + * key name. + * + * @param {boolean} [options.autoRegenerateKey] whether keyvault should manage + * the storage account for the user. + * + * @param {string} [options.regenerationPeriod] The key regeneration time + * duration specified in ISO-8601 format. + * + * @param {object} [options.storageAccountAttributes] The attributes of the + * storage account. + * + * @param {boolean} [options.storageAccountAttributes.enabled] the enabled + * state of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateStorageAccountWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { activeKeyName? : string, autoRegenerateKey? : boolean, regenerationPeriod? : string, storageAccountAttributes? : models.StorageAccountAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates the specified attributes associated with the given storage account. + * This operation requires the storage/set/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.activeKeyName] The current active storage account + * key name. + * + * @param {boolean} [options.autoRegenerateKey] whether keyvault should manage + * the storage account for the user. + * + * @param {string} [options.regenerationPeriod] The key regeneration time * duration specified in ISO-8601 format. * - * @param {object} [options.storageAccountAttributes] The attributes of the - * storage account. + * @param {object} [options.storageAccountAttributes] The attributes of the + * storage account. + * + * @param {boolean} [options.storageAccountAttributes.enabled] the enabled + * state of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {StorageBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {StorageBundle} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateStorageAccount(vaultBaseUrl: string, storageAccountName: string, options?: { activeKeyName? : string, autoRegenerateKey? : boolean, regenerationPeriod? : string, storageAccountAttributes? : models.StorageAccountAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise; + updateStorageAccount(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; + updateStorageAccount(vaultBaseUrl: string, storageAccountName: string, options: { activeKeyName? : string, autoRegenerateKey? : boolean, regenerationPeriod? : string, storageAccountAttributes? : models.StorageAccountAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Regenerates the specified key value for the given storage account. This + * operation requires the storage/regeneratekey permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} keyName The storage account key name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + regenerateStorageAccountKeyWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Regenerates the specified key value for the given storage account. This + * operation requires the storage/regeneratekey permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} keyName The storage account key name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {StorageBundle} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {StorageBundle} [result] - The deserialized result object if an error did not occur. + * See {@link StorageBundle} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + regenerateStorageAccountKey(vaultBaseUrl: string, storageAccountName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + regenerateStorageAccountKey(vaultBaseUrl: string, storageAccountName: string, keyName: string, callback: ServiceCallback): void; + regenerateStorageAccountKey(vaultBaseUrl: string, storageAccountName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * List storage SAS definitions for the given storage account. This operation + * requires the storage/listsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getSasDefinitionsWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * List storage SAS definitions for the given storage account. This operation + * requires the storage/listsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. * - * @param {boolean} [options.storageAccountAttributes.enabled] the enabled - * state of the object. + * @param {string} storageAccountName The name of the storage account. * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5667,7 +6454,7 @@ export default class KeyVaultClient extends AzureServiceClient { * * {Promise} A promise is returned. * - * @resolve {StorageBundle} - The deserialized result object. + * @resolve {SasDefinitionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5675,28 +6462,110 @@ export default class KeyVaultClient extends AzureServiceClient { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {StorageBundle} [result] - The deserialized result object if an error did not occur. - * See {@link StorageBundle} for more information. + * {SasDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - updateStorageAccount(vaultBaseUrl: string, storageAccountName: string, options?: { activeKeyName? : string, autoRegenerateKey? : boolean, regenerationPeriod? : string, storageAccountAttributes? : models.StorageAccountAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise; - updateStorageAccount(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; - updateStorageAccount(vaultBaseUrl: string, storageAccountName: string, options: { activeKeyName? : string, autoRegenerateKey? : boolean, regenerationPeriod? : string, storageAccountAttributes? : models.StorageAccountAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getSasDefinitions(vaultBaseUrl: string, storageAccountName: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getSasDefinitions(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; + getSasDefinitions(vaultBaseUrl: string, storageAccountName: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Regenerates the specified key value for the given storage account. This - * operation requires the storage/regeneratekey permission. + * @summary Lists deleted SAS definitions for the specified vault and storage + * account. + * + * The Get Deleted Sas Definitions operation returns the SAS definitions that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/listsas permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} storageAccountName The name of the storage account. * - * @param {string} keyName The storage account key name. + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getDeletedSasDefinitionsWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists deleted SAS definitions for the specified vault and storage + * account. + * + * The Get Deleted Sas Definitions operation returns the SAS definitions that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/listsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeletedSasDefinitionListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedSasDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSasDefinitionListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedSasDefinitions(vaultBaseUrl: string, storageAccountName: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedSasDefinitions(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; + getDeletedSasDefinitions(vaultBaseUrl: string, storageAccountName: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the specified deleted sas definition. + * + * The Get Deleted SAS Definition operation returns the specified deleted SAS + * definition along with its attributes. This operation requires the + * storage/getsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. * * @param {object} [options] Optional Parameters. * @@ -5705,22 +6574,25 @@ export default class KeyVaultClient extends AzureServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - regenerateStorageAccountKeyWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getDeletedSasDefinitionWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Regenerates the specified key value for the given storage account. This - * operation requires the storage/regeneratekey permission. + * @summary Gets the specified deleted sas definition. + * + * The Get Deleted SAS Definition operation returns the specified deleted SAS + * definition along with its attributes. This operation requires the + * storage/getsas permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} storageAccountName The name of the storage account. * - * @param {string} keyName The storage account key name. + * @param {string} sasDefinitionName The name of the SAS definition. * * @param {object} [options] Optional Parameters. * @@ -5734,7 +6606,7 @@ export default class KeyVaultClient extends AzureServiceClient { * * {Promise} A promise is returned. * - * @resolve {StorageBundle} - The deserialized result object. + * @resolve {DeletedSasDefinitionBundle} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5742,56 +6614,61 @@ export default class KeyVaultClient extends AzureServiceClient { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {StorageBundle} [result] - The deserialized result object if an error did not occur. - * See {@link StorageBundle} for more information. + * {DeletedSasDefinitionBundle} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSasDefinitionBundle} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - regenerateStorageAccountKey(vaultBaseUrl: string, storageAccountName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - regenerateStorageAccountKey(vaultBaseUrl: string, storageAccountName: string, keyName: string, callback: ServiceCallback): void; - regenerateStorageAccountKey(vaultBaseUrl: string, storageAccountName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getDeletedSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, callback: ServiceCallback): void; + getDeletedSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * List storage SAS definitions for the given storage account. This operation - * requires the storage/listsas permission. + * @summary Recovers the deleted SAS definition. + * + * Recovers the deleted SAS definition for the specified storage account. This + * operation can only be performed on a soft-delete enabled vault. This + * operation requires the storage/recover permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} storageAccountName The name of the storage account. * - * @param {object} [options] Optional Parameters. + * @param {string} sasDefinitionName The name of the SAS definition. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getSasDefinitionsWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + recoverDeletedSasDefinitionWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * List storage SAS definitions for the given storage account. This operation - * requires the storage/listsas permission. + * @summary Recovers the deleted SAS definition. + * + * Recovers the deleted SAS definition for the specified storage account. This + * operation can only be performed on a soft-delete enabled vault. This + * operation requires the storage/recover permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} storageAccountName The name of the storage account. * - * @param {object} [options] Optional Parameters. + * @param {string} sasDefinitionName The name of the SAS definition. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5803,7 +6680,7 @@ export default class KeyVaultClient extends AzureServiceClient { * * {Promise} A promise is returned. * - * @resolve {SasDefinitionListResult} - The deserialized result object. + * @resolve {SasDefinitionBundle} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5811,17 +6688,16 @@ export default class KeyVaultClient extends AzureServiceClient { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SasDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SasDefinitionListResult} for more - * information. + * {SasDefinitionBundle} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionBundle} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getSasDefinitions(vaultBaseUrl: string, storageAccountName: string, options?: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - getSasDefinitions(vaultBaseUrl: string, storageAccountName: string, callback: ServiceCallback): void; - getSasDefinitions(vaultBaseUrl: string, storageAccountName: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + recoverDeletedSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + recoverDeletedSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, callback: ServiceCallback): void; + recoverDeletedSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -5842,11 +6718,11 @@ export default class KeyVaultClient extends AzureServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteSasDefinitionWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteSasDefinitionWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Deletes a SAS definition from a specified storage account. This operation @@ -5871,7 +6747,7 @@ export default class KeyVaultClient extends AzureServiceClient { * * {Promise} A promise is returned. * - * @resolve {SasDefinitionBundle} - The deserialized result object. + * @resolve {DeletedSasDefinitionBundle} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5879,16 +6755,17 @@ export default class KeyVaultClient extends AzureServiceClient { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SasDefinitionBundle} [result] - The deserialized result object if an error did not occur. - * See {@link SasDefinitionBundle} for more information. + * {DeletedSasDefinitionBundle} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSasDefinitionBundle} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, callback: ServiceCallback): void; - deleteSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, callback: ServiceCallback): void; + deleteSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -5969,8 +6846,15 @@ export default class KeyVaultClient extends AzureServiceClient { * * @param {string} sasDefinitionName The name of the SAS definition. * - * @param {object} parameters Sas definition creation metadata in the form of - * key-value pairs. + * @param {string} templateUri The SAS definition token template signed with an + * arbitrary key. Tokens created according to the SAS definition will have the + * same properties as the template. + * + * @param {string} sasType The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * + * @param {string} validityPeriod The validity period of SAS tokens created + * according to the SAS definition. * * @param {object} [options] Optional Parameters. * @@ -5992,7 +6876,7 @@ export default class KeyVaultClient extends AzureServiceClient { * * @reject {Error|ServiceError} - The error object. */ - setSasDefinitionWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, parameters: { [propertyName: string]: string }, options?: { sasDefinitionAttributes? : models.SasDefinitionAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise>; + setSasDefinitionWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, templateUri: string, sasType: string, validityPeriod: string, options?: { sasDefinitionAttributes? : models.SasDefinitionAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Creates or updates a new SAS definition for the specified storage account. @@ -6005,8 +6889,15 @@ export default class KeyVaultClient extends AzureServiceClient { * * @param {string} sasDefinitionName The name of the SAS definition. * - * @param {object} parameters Sas definition creation metadata in the form of - * key-value pairs. + * @param {string} templateUri The SAS definition token template signed with an + * arbitrary key. Tokens created according to the SAS definition will have the + * same properties as the template. + * + * @param {string} sasType The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * + * @param {string} validityPeriod The validity period of SAS tokens created + * according to the SAS definition. * * @param {object} [options] Optional Parameters. * @@ -6044,9 +6935,9 @@ export default class KeyVaultClient extends AzureServiceClient { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - setSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, parameters: { [propertyName: string]: string }, options?: { sasDefinitionAttributes? : models.SasDefinitionAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise; - setSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, parameters: { [propertyName: string]: string }, callback: ServiceCallback): void; - setSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, parameters: { [propertyName: string]: string }, options: { sasDefinitionAttributes? : models.SasDefinitionAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + setSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, templateUri: string, sasType: string, validityPeriod: string, options?: { sasDefinitionAttributes? : models.SasDefinitionAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise; + setSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, templateUri: string, sasType: string, validityPeriod: string, callback: ServiceCallback): void; + setSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, templateUri: string, sasType: string, validityPeriod: string, options: { sasDefinitionAttributes? : models.SasDefinitionAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -6062,8 +6953,15 @@ export default class KeyVaultClient extends AzureServiceClient { * * @param {object} [options] Optional Parameters. * - * @param {object} [options.parameters] Sas definition update metadata in the - * form of key-value pairs. + * @param {string} [options.templateUri] The SAS definition token template + * signed with an arbitrary key. Tokens created according to the SAS + * definition will have the same properties as the template. + * + * @param {string} [options.sasType] The type of SAS token the SAS definition + * will create. Possible values include: 'account', 'service' + * + * @param {string} [options.validityPeriod] The validity period of SAS tokens + * created according to the SAS definition. * * @param {object} [options.sasDefinitionAttributes] The attributes of the SAS * definition. @@ -6083,7 +6981,7 @@ export default class KeyVaultClient extends AzureServiceClient { * * @reject {Error|ServiceError} - The error object. */ - updateSasDefinitionWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { parameters? : { [propertyName: string]: string }, sasDefinitionAttributes? : models.SasDefinitionAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise>; + updateSasDefinitionWithHttpOperationResponse(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { templateUri? : string, sasType? : string, validityPeriod? : string, sasDefinitionAttributes? : models.SasDefinitionAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Updates the specified attributes associated with the given SAS definition. @@ -6098,8 +6996,15 @@ export default class KeyVaultClient extends AzureServiceClient { * * @param {object} [options] Optional Parameters. * - * @param {object} [options.parameters] Sas definition update metadata in the - * form of key-value pairs. + * @param {string} [options.templateUri] The SAS definition token template + * signed with an arbitrary key. Tokens created according to the SAS + * definition will have the same properties as the template. + * + * @param {string} [options.sasType] The type of SAS token the SAS definition + * will create. Possible values include: 'account', 'service' + * + * @param {string} [options.validityPeriod] The validity period of SAS tokens + * created according to the SAS definition. * * @param {object} [options.sasDefinitionAttributes] The attributes of the SAS * definition. @@ -6135,9 +7040,9 @@ export default class KeyVaultClient extends AzureServiceClient { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - updateSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { parameters? : { [propertyName: string]: string }, sasDefinitionAttributes? : models.SasDefinitionAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise; + updateSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options?: { templateUri? : string, sasType? : string, validityPeriod? : string, sasDefinitionAttributes? : models.SasDefinitionAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }): Promise; updateSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, callback: ServiceCallback): void; - updateSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options: { parameters? : { [propertyName: string]: string }, sasDefinitionAttributes? : models.SasDefinitionAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateSasDefinition(vaultBaseUrl: string, storageAccountName: string, sasDefinitionName: string, options: { templateUri? : string, sasType? : string, validityPeriod? : string, sasDefinitionAttributes? : models.SasDefinitionAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -6870,6 +7775,72 @@ export default class KeyVaultClient extends AzureServiceClient { getStorageAccountsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Lists deleted storage accounts for the specified vault. + * + * The Get Deleted Storage Accounts operation returns the storage accounts that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getDeletedStorageAccountsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists deleted storage accounts for the specified vault. + * + * The Get Deleted Storage Accounts operation returns the storage accounts that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeletedStorageListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedStorageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedStorageListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedStorageAccountsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedStorageAccountsNext(nextPageLink: string, callback: ServiceCallback): void; + getDeletedStorageAccountsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * List storage SAS definitions for the given storage account. This operation * requires the storage/listsas permission. @@ -6928,6 +7899,74 @@ export default class KeyVaultClient extends AzureServiceClient { getSasDefinitionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; getSasDefinitionsNext(nextPageLink: string, callback: ServiceCallback): void; getSasDefinitionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists deleted SAS definitions for the specified vault and storage + * account. + * + * The Get Deleted Sas Definitions operation returns the SAS definitions that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/listsas permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getDeletedSasDefinitionsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists deleted SAS definitions for the specified vault and storage + * account. + * + * The Get Deleted Sas Definitions operation returns the SAS definitions that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/listsas permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DeletedSasDefinitionListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DeletedSasDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSasDefinitionListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedSasDefinitionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDeletedSasDefinitionsNext(nextPageLink: string, callback: ServiceCallback): void; + getDeletedSasDefinitionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } export { KeyVaultClient, models as KeyVaultModels }; diff --git a/lib/services/keyvault/lib/keyVaultClient.js b/lib/services/keyvault/lib/keyVaultClient.js index a435f4e270..3ba70c3b2c 100644 --- a/lib/services/keyvault/lib/keyVaultClient.js +++ b/lib/services/keyvault/lib/keyVaultClient.js @@ -61,7 +61,7 @@ const models = require('./models'); * * @param {string} [options.curve] Elliptic curve name. For valid values, see * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', - * 'SECP256K1' + * 'P-256K' * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -277,8 +277,9 @@ function _createKey(vaultBaseUrl, keyName, kty, options, callback) { * * @param {string} [key.kid] Key identifier. * - * @param {string} [key.kty] JsonWebKey key type (kty). Possible values - * include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @param {string} [key.kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible + * values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * * @param {array} [key.keyOps] * @@ -305,7 +306,7 @@ function _createKey(vaultBaseUrl, keyName, kty, options, callback) { * * @param {string} [key.crv] Elliptic curve name. For valid values, see * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', - * 'SECP256K1' + * 'P-256K' * * @param {buffer} [key.x] X component of an EC public key. * @@ -2090,7 +2091,7 @@ function _decrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, * more information on possible algorithm types, see * JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', * 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', - * 'ECDSA256' + * 'ES256K' * * @param {buffer} value * @@ -2285,7 +2286,7 @@ function _sign(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, cal * @param {string} algorithm The signing/verification algorithm. For more * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. * Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', - * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256' + * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' * * @param {buffer} digest The digest used for signing. * @@ -5397,6 +5398,9 @@ function _restoreSecret(vaultBaseUrl, secretBundleBackup, options, callback) { * @param {number} [options.maxresults] Maximum number of results to return in * a page. If not specified the service will return up to 25 results. * + * @param {boolean} [options.includePending] Specifies whether to include + * certificates which are not completely provisioned. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -5424,6 +5428,7 @@ function _getCertificates(vaultBaseUrl, options, callback) { throw new Error('callback cannot be null.'); } let maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + let includePending = (options && options.includePending !== undefined) ? options.includePending : undefined; // Validate try { if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { @@ -5442,6 +5447,9 @@ function _getCertificates(vaultBaseUrl, options, callback) { throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); } } + if (includePending !== null && includePending !== undefined && typeof includePending !== 'boolean') { + throw new Error('includePending must be of type boolean.'); + } if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); } @@ -5460,6 +5468,9 @@ function _getCertificates(vaultBaseUrl, options, callback) { if (maxresults !== null && maxresults !== undefined) { queryParameters.push('maxresults=' + encodeURIComponent(maxresults.toString())); } + if (includePending !== null && includePending !== undefined) { + queryParameters.push('includePending=' + encodeURIComponent(includePending.toString())); + } queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -7011,8 +7022,9 @@ function _deleteCertificateIssuer(vaultBaseUrl, issuerName, options, callback) { * @param {boolean} [options.certificatePolicy.keyProperties.exportable] * Indicates if the private key can be exported. * - * @param {string} [options.certificatePolicy.keyProperties.keyType] The key - * type. + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * * @param {number} [options.certificatePolicy.keyProperties.keySize] The key * size in bits. For example: 2048, 3072, or 4096 for RSA. @@ -7020,6 +7032,10 @@ function _deleteCertificateIssuer(vaultBaseUrl, issuerName, options, callback) { * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] * Indicates if the same key pair will be used on certificate renewal. * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * * @param {object} [options.certificatePolicy.secretProperties] Properties of * the secret backing a certificate. * @@ -7073,6 +7089,11 @@ function _deleteCertificateIssuer(vaultBaseUrl, issuerName, options, callback) { * @param {string} [options.certificatePolicy.issuerParameters.certificateType] * Type of certificate to be requested from the issuer provider. * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * * @param {object} [options.certificatePolicy.attributes] The certificate * attributes. * @@ -7292,8 +7313,9 @@ function _createCertificate(vaultBaseUrl, certificateName, options, callback) { * @param {boolean} [options.certificatePolicy.keyProperties.exportable] * Indicates if the private key can be exported. * - * @param {string} [options.certificatePolicy.keyProperties.keyType] The key - * type. + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * * @param {number} [options.certificatePolicy.keyProperties.keySize] The key * size in bits. For example: 2048, 3072, or 4096 for RSA. @@ -7301,6 +7323,10 @@ function _createCertificate(vaultBaseUrl, certificateName, options, callback) { * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] * Indicates if the same key pair will be used on certificate renewal. * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * * @param {object} [options.certificatePolicy.secretProperties] Properties of * the secret backing a certificate. * @@ -7354,6 +7380,11 @@ function _createCertificate(vaultBaseUrl, certificateName, options, callback) { * @param {string} [options.certificatePolicy.issuerParameters.certificateType] * Type of certificate to be requested from the issuer provider. * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * * @param {object} [options.certificatePolicy.attributes] The certificate * attributes. * @@ -7885,7 +7916,9 @@ function _getCertificatePolicy(vaultBaseUrl, certificateName, options, callback) * @param {boolean} [certificatePolicy.keyProperties.exportable] Indicates if * the private key can be exported. * - * @param {string} [certificatePolicy.keyProperties.keyType] The key type. + * @param {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * * @param {number} [certificatePolicy.keyProperties.keySize] The key size in * bits. For example: 2048, 3072, or 4096 for RSA. @@ -7893,6 +7926,10 @@ function _getCertificatePolicy(vaultBaseUrl, certificateName, options, callback) * @param {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if the * same key pair will be used on certificate renewal. * + * @param {string} [certificatePolicy.keyProperties.curve] Elliptic curve name. + * For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', + * 'P-384', 'P-521', 'P-256K' + * * @param {object} [certificatePolicy.secretProperties] Properties of the * secret backing a certificate. * @@ -7944,6 +7981,11 @@ function _getCertificatePolicy(vaultBaseUrl, certificateName, options, callback) * @param {string} [certificatePolicy.issuerParameters.certificateType] Type of * certificate to be requested from the issuer provider. * + * @param {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. + * * @param {object} [certificatePolicy.attributes] The certificate attributes. * * @param {boolean} [certificatePolicy.attributes.enabled] Determines whether @@ -8133,8 +8175,9 @@ function _updateCertificatePolicy(vaultBaseUrl, certificateName, certificatePoli * @param {boolean} [options.certificatePolicy.keyProperties.exportable] * Indicates if the private key can be exported. * - * @param {string} [options.certificatePolicy.keyProperties.keyType] The key - * type. + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * * @param {number} [options.certificatePolicy.keyProperties.keySize] The key * size in bits. For example: 2048, 3072, or 4096 for RSA. @@ -8142,6 +8185,10 @@ function _updateCertificatePolicy(vaultBaseUrl, certificateName, certificatePoli * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] * Indicates if the same key pair will be used on certificate renewal. * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * * @param {object} [options.certificatePolicy.secretProperties] Properties of * the secret backing a certificate. * @@ -8195,6 +8242,11 @@ function _updateCertificatePolicy(vaultBaseUrl, certificateName, certificatePoli * @param {string} [options.certificatePolicy.issuerParameters.certificateType] * Type of certificate to be requested from the issuer provider. * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * * @param {object} [options.certificatePolicy.attributes] The certificate * attributes. * @@ -9201,22 +9253,18 @@ function _mergeCertificate(vaultBaseUrl, certificateName, x509Certificates, opti } /** - * @summary Lists the deleted certificates in the specified vault currently - * available for recovery. + * @summary Backs up the specified certificate. * - * 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. + * 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 {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {object} [options] Optional Parameters. + * @param {string} certificateName The name of the certificate. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -9228,14 +9276,14 @@ function _mergeCertificate(vaultBaseUrl, certificateName, x509Certificates, opti * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeletedCertificateListResult} for more + * See {@link BackupCertificateResult} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getDeletedCertificates(vaultBaseUrl, options, callback) { +function _backupCertificate(vaultBaseUrl, certificateName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -9245,24 +9293,13 @@ function _getDeletedCertificates(vaultBaseUrl, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; // Validate try { if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); } - if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { - throw new Error('maxresults must be of type number.'); - } - if (maxresults !== null && maxresults !== undefined) { - if (maxresults > 25) - { - throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); - } - if (maxresults < 1) - { - throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); - } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); } if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); @@ -9276,12 +9313,10 @@ function _getDeletedCertificates(vaultBaseUrl, options, callback) { // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'deletedcertificates'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'certificates/{certificate-name}/backup'; requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); let queryParameters = []; - if (maxresults !== null && maxresults !== undefined) { - queryParameters.push('maxresults=' + encodeURIComponent(maxresults.toString())); - } queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -9289,7 +9324,7 @@ function _getDeletedCertificates(vaultBaseUrl, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -9350,7 +9385,7 @@ function _getDeletedCertificates(vaultBaseUrl, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DeletedCertificateListResult']().mapper(); + let resultMapper = new client.models['BackupCertificateResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -9366,17 +9401,16 @@ function _getDeletedCertificates(vaultBaseUrl, options, callback) { } /** - * @summary Retrieves information about the specified deleted certificate. + * @summary Restores a backed up certificate to a vault. * - * 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. + * Restores a backed up certificate, and all its versions, to a vault. This + * operation requires the certificates/restore permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate + * @param {buffer} certificateBundleBackup The backup blob associated with a + * certificate bundle. * * @param {object} [options] Optional Parameters. * @@ -9390,14 +9424,13 @@ function _getDeletedCertificates(vaultBaseUrl, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeletedCertificateBundle} for more - * information. + * See {@link CertificateBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getDeletedCertificate(vaultBaseUrl, certificateName, options, callback) { +function _restoreCertificate(vaultBaseUrl, certificateBundleBackup, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -9412,24 +9445,28 @@ function _getDeletedCertificate(vaultBaseUrl, certificateName, options, callback if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); } - if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { - throw new Error('certificateName cannot be null or undefined and it must be of type string.'); - } if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); } + if (!Buffer.isBuffer(certificateBundleBackup)) { + throw new Error('certificateBundleBackup cannot be null or undefined and it must be of type buffer.'); + } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } + let parameters; + if (certificateBundleBackup !== null && certificateBundleBackup !== undefined) { + parameters = new client.models['CertificateRestoreParameters'](); + parameters.certificateBundleBackup = certificateBundleBackup; + } // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'deletedcertificates/{certificate-name}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'certificates/restore'; requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); - requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { @@ -9438,7 +9475,7 @@ function _getDeletedCertificate(vaultBaseUrl, certificateName, options, callback // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -9456,7 +9493,21 @@ function _getDeletedCertificate(vaultBaseUrl, certificateName, options, callback } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['CertificateRestoreParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -9499,7 +9550,7 @@ function _getDeletedCertificate(vaultBaseUrl, certificateName, options, callback parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DeletedCertificateBundle']().mapper(); + let resultMapper = new client.models['CertificateBundle']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -9515,20 +9566,26 @@ function _getDeletedCertificate(vaultBaseUrl, certificateName, options, callback } /** - * @summary Permanently deletes the specified deleted certificate. + * @summary Lists the deleted certificates in the specified vault currently + * available for recovery. * - * 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. + * 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 {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate - * * @param {object} [options] Optional Parameters. * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {boolean} [options.includePending] Specifies whether to include + * certificates which are not completely provisioned. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -9538,13 +9595,15 @@ function _getDeletedCertificate(vaultBaseUrl, certificateName, options, callback * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedCertificateListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _purgeDeletedCertificate(vaultBaseUrl, certificateName, options, callback) { +function _getDeletedCertificates(vaultBaseUrl, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -9554,13 +9613,28 @@ function _purgeDeletedCertificate(vaultBaseUrl, certificateName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } + let maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + let includePending = (options && options.includePending !== undefined) ? options.includePending : undefined; // Validate try { if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); } - if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { - throw new Error('certificateName cannot be null or undefined and it must be of type string.'); + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (maxresults !== null && maxresults !== undefined) { + if (maxresults > 25) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); + } + if (maxresults < 1) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (includePending !== null && includePending !== undefined && typeof includePending !== 'boolean') { + throw new Error('includePending must be of type boolean.'); } if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); @@ -9574,10 +9648,15 @@ function _purgeDeletedCertificate(vaultBaseUrl, certificateName, options, callba // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'deletedcertificates/{certificate-name}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'deletedcertificates'; requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); - requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); let queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.toString())); + } + if (includePending !== null && includePending !== undefined) { + queryParameters.push('includePending=' + encodeURIComponent(includePending.toString())); + } queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -9585,7 +9664,7 @@ function _purgeDeletedCertificate(vaultBaseUrl, certificateName, options, callba // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -9610,7 +9689,7 @@ function _purgeDeletedCertificate(vaultBaseUrl, certificateName, options, callba return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -9639,25 +9718,40 @@ function _purgeDeletedCertificate(vaultBaseUrl, certificateName, options, callba // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedCertificateListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * @summary Recovers the deleted certificate back to its current version under - * /certificates. + * @summary Retrieves information about the specified deleted certificate. * - * 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. + * 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. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the deleted certificate + * @param {string} certificateName The name of the certificate * * @param {object} [options] Optional Parameters. * @@ -9671,13 +9765,14 @@ function _purgeDeletedCertificate(vaultBaseUrl, certificateName, options, callba * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CertificateBundle} for more information. + * See {@link DeletedCertificateBundle} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _recoverDeletedCertificate(vaultBaseUrl, certificateName, options, callback) { +function _getDeletedCertificate(vaultBaseUrl, certificateName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -9707,7 +9802,7 @@ function _recoverDeletedCertificate(vaultBaseUrl, certificateName, options, call // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'deletedcertificates/{certificate-name}/recover'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'deletedcertificates/{certificate-name}'; requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); let queryParameters = []; @@ -9718,7 +9813,7 @@ function _recoverDeletedCertificate(vaultBaseUrl, certificateName, options, call // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -9779,7 +9874,7 @@ function _recoverDeletedCertificate(vaultBaseUrl, certificateName, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['CertificateBundle']().mapper(); + let resultMapper = new client.models['DeletedCertificateBundle']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -9795,16 +9890,19 @@ function _recoverDeletedCertificate(vaultBaseUrl, certificateName, options, call } /** - * List storage accounts managed by the specified key vault. This operation - * requires the storage/list permission. + * @summary Permanently deletes the specified deleted certificate. + * + * 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. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {object} [options] Optional Parameters. + * @param {string} certificateName The name of the certificate * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -9815,14 +9913,13 @@ function _recoverDeletedCertificate(vaultBaseUrl, certificateName, options, call * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link StorageListResult} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getStorageAccounts(vaultBaseUrl, options, callback) { +function _purgeDeletedCertificate(vaultBaseUrl, certificateName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -9832,24 +9929,13 @@ function _getStorageAccounts(vaultBaseUrl, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; // Validate try { if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); } - if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { - throw new Error('maxresults must be of type number.'); - } - if (maxresults !== null && maxresults !== undefined) { - if (maxresults > 25) - { - throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); - } - if (maxresults < 1) - { - throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); - } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); } if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); @@ -9863,12 +9949,10 @@ function _getStorageAccounts(vaultBaseUrl, options, callback) { // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'deletedcertificates/{certificate-name}'; requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); let queryParameters = []; - if (maxresults !== null && maxresults !== undefined) { - queryParameters.push('maxresults=' + encodeURIComponent(maxresults.toString())); - } queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -9876,7 +9960,7 @@ function _getStorageAccounts(vaultBaseUrl, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -9901,7 +9985,7 @@ function _getStorageAccounts(vaultBaseUrl, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -9930,36 +10014,25 @@ function _getStorageAccounts(vaultBaseUrl, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StorageListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * Deletes a storage account. This operation requires the storage/delete + * @summary Recovers the deleted certificate back to its current version under + * /certificates. + * + * 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 {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} storageAccountName The name of the storage account. + * @param {string} certificateName The name of the deleted certificate * * @param {object} [options] Optional Parameters. * @@ -9973,13 +10046,13 @@ function _getStorageAccounts(vaultBaseUrl, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link StorageBundle} for more information. + * See {@link CertificateBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteStorageAccount(vaultBaseUrl, storageAccountName, options, callback) { +function _recoverDeletedCertificate(vaultBaseUrl, certificateName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -9994,14 +10067,8 @@ function _deleteStorageAccount(vaultBaseUrl, storageAccountName, options, callba if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); } - if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { - throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); - } - if (storageAccountName !== null && storageAccountName !== undefined) { - if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) - { - throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); - } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); } if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); @@ -10015,9 +10082,9 @@ function _deleteStorageAccount(vaultBaseUrl, storageAccountName, options, callba // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'deletedcertificates/{certificate-name}/recover'; requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); - requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { @@ -10026,7 +10093,7 @@ function _deleteStorageAccount(vaultBaseUrl, storageAccountName, options, callba // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -10087,7 +10154,7 @@ function _deleteStorageAccount(vaultBaseUrl, storageAccountName, options, callba parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StorageBundle']().mapper(); + let resultMapper = new client.models['CertificateBundle']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10103,16 +10170,17 @@ function _deleteStorageAccount(vaultBaseUrl, storageAccountName, options, callba } /** - * Gets information about a specified storage account. This operation requires - * the storage/get permission. + * List storage accounts managed by the specified key vault. This operation + * requires the storage/list permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} storageAccountName The name of the storage account. - * * @param {object} [options] Optional Parameters. * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -10123,13 +10191,13 @@ function _deleteStorageAccount(vaultBaseUrl, storageAccountName, options, callba * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link StorageBundle} for more information. + * See {@link StorageListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getStorageAccount(vaultBaseUrl, storageAccountName, options, callback) { +function _getStorageAccounts(vaultBaseUrl, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -10139,18 +10207,23 @@ function _getStorageAccount(vaultBaseUrl, storageAccountName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } + let maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; // Validate try { if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); } - if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { - throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); } - if (storageAccountName !== null && storageAccountName !== undefined) { - if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + if (maxresults !== null && maxresults !== undefined) { + if (maxresults > 25) { - throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); + } + if (maxresults < 1) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); } } if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { @@ -10165,10 +10238,12 @@ function _getStorageAccount(vaultBaseUrl, storageAccountName, options, callback) // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage'; requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); - requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); let queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.toString())); + } queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -10237,7 +10312,7 @@ function _getStorageAccount(vaultBaseUrl, storageAccountName, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StorageBundle']().mapper(); + let resultMapper = new client.models['StorageListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10253,34 +10328,19 @@ function _getStorageAccount(vaultBaseUrl, storageAccountName, options, callback) } /** - * Creates or updates a new storage account. This operation requires the - * storage/set permission. + * @summary Lists deleted storage accounts for the specified vault. + * + * The Get Deleted Storage Accounts operation returns the storage accounts that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/list permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} storageAccountName The name of the storage account. - * - * @param {string} resourceId Storage account resource id. - * - * @param {string} activeKeyName Current active storage account key name. - * - * @param {boolean} autoRegenerateKey whether keyvault should manage the - * storage account for the user. - * * @param {object} [options] Optional Parameters. * - * @param {string} [options.regenerationPeriod] The key regeneration time - * duration specified in ISO-8601 format. - * - * @param {object} [options.storageAccountAttributes] The attributes of the - * storage account. - * - * @param {boolean} [options.storageAccountAttributes.enabled] the enabled - * state of the object. - * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -10292,13 +10352,14 @@ function _getStorageAccount(vaultBaseUrl, storageAccountName, options, callback) * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link StorageBundle} for more information. + * See {@link DeletedStorageListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, options, callback) { +function _getDeletedStorageAccounts(vaultBaseUrl, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -10308,68 +10369,43 @@ function _setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, active if (!callback) { throw new Error('callback cannot be null.'); } - let regenerationPeriod = (options && options.regenerationPeriod !== undefined) ? options.regenerationPeriod : undefined; - let storageAccountAttributes = (options && options.storageAccountAttributes !== undefined) ? options.storageAccountAttributes : undefined; - let tags = (options && options.tags !== undefined) ? options.tags : undefined; + let maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; // Validate try { if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); } - if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { - throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); } - if (storageAccountName !== null && storageAccountName !== undefined) { - if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + if (maxresults !== null && maxresults !== undefined) { + if (maxresults > 25) { - throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); + } + if (maxresults < 1) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); } } if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); } - if (resourceId === null || resourceId === undefined || typeof resourceId.valueOf() !== 'string') { - throw new Error('resourceId cannot be null or undefined and it must be of type string.'); - } - if (activeKeyName === null || activeKeyName === undefined || typeof activeKeyName.valueOf() !== 'string') { - throw new Error('activeKeyName cannot be null or undefined and it must be of type string.'); - } - if (autoRegenerateKey === null || autoRegenerateKey === undefined || typeof autoRegenerateKey !== 'boolean') { - throw new Error('autoRegenerateKey cannot be null or undefined and it must be of type boolean.'); - } - if (regenerationPeriod !== null && regenerationPeriod !== undefined && typeof regenerationPeriod.valueOf() !== 'string') { - throw new Error('regenerationPeriod must be of type string.'); - } - if (tags && typeof tags === 'object') { - for(let valueElement in tags) { - if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { - throw new Error('tags[valueElement] must be of type string.'); - } - } - } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } - let parameters; - if ((resourceId !== null && resourceId !== undefined) || (activeKeyName !== null && activeKeyName !== undefined) || (autoRegenerateKey !== null && autoRegenerateKey !== undefined) || (regenerationPeriod !== null && regenerationPeriod !== undefined) || (storageAccountAttributes !== null && storageAccountAttributes !== undefined) || (tags !== null && tags !== undefined)) { - parameters = new client.models['StorageAccountCreateParameters'](); - parameters.resourceId = resourceId; - parameters.activeKeyName = activeKeyName; - parameters.autoRegenerateKey = autoRegenerateKey; - parameters.regenerationPeriod = regenerationPeriod; - parameters.storageAccountAttributes = storageAccountAttributes; - parameters.tags = tags; - } // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'deletedstorage'; requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); - requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); let queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.toString())); + } queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -10377,7 +10413,7 @@ function _setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, active // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -10395,21 +10431,7 @@ function _setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, active } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['StorageAccountCreateParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -10452,7 +10474,7 @@ function _setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, active parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StorageBundle']().mapper(); + let resultMapper = new client.models['DeletedStorageListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10468,8 +10490,11 @@ function _setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, active } /** - * Updates the specified attributes associated with the given storage account. - * This operation requires the storage/set/update permission. + * @summary Gets the specified deleted storage account. + * + * The Get Deleted Storage Account operation returns the specified deleted + * storage account along with its attributes. This operation requires the + * storage/get permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. @@ -10478,24 +10503,6 @@ function _setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, active * * @param {object} [options] Optional Parameters. * - * @param {string} [options.activeKeyName] The current active storage account - * key name. - * - * @param {boolean} [options.autoRegenerateKey] whether keyvault should manage - * the storage account for the user. - * - * @param {string} [options.regenerationPeriod] The key regeneration time - * duration specified in ISO-8601 format. - * - * @param {object} [options.storageAccountAttributes] The attributes of the - * storage account. - * - * @param {boolean} [options.storageAccountAttributes.enabled] the enabled - * state of the object. - * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -10506,13 +10513,13 @@ function _setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, active * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link StorageBundle} for more information. + * See {@link DeletedStorageBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _updateStorageAccount(vaultBaseUrl, storageAccountName, options, callback) { +function _getDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -10522,11 +10529,6 @@ function _updateStorageAccount(vaultBaseUrl, storageAccountName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let activeKeyName = (options && options.activeKeyName !== undefined) ? options.activeKeyName : undefined; - let autoRegenerateKey = (options && options.autoRegenerateKey !== undefined) ? options.autoRegenerateKey : undefined; - let regenerationPeriod = (options && options.regenerationPeriod !== undefined) ? options.regenerationPeriod : undefined; - let storageAccountAttributes = (options && options.storageAccountAttributes !== undefined) ? options.storageAccountAttributes : undefined; - let tags = (options && options.tags !== undefined) ? options.tags : undefined; // Validate try { if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { @@ -10544,41 +10546,16 @@ function _updateStorageAccount(vaultBaseUrl, storageAccountName, options, callba if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); } - if (activeKeyName !== null && activeKeyName !== undefined && typeof activeKeyName.valueOf() !== 'string') { - throw new Error('activeKeyName must be of type string.'); - } - if (autoRegenerateKey !== null && autoRegenerateKey !== undefined && typeof autoRegenerateKey !== 'boolean') { - throw new Error('autoRegenerateKey must be of type boolean.'); - } - if (regenerationPeriod !== null && regenerationPeriod !== undefined && typeof regenerationPeriod.valueOf() !== 'string') { - throw new Error('regenerationPeriod must be of type string.'); - } - if (tags && typeof tags === 'object') { - for(let valueElement in tags) { - if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { - throw new Error('tags[valueElement] must be of type string.'); - } - } - } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } - let parameters; - if ((activeKeyName !== null && activeKeyName !== undefined) || (autoRegenerateKey !== null && autoRegenerateKey !== undefined) || (regenerationPeriod !== null && regenerationPeriod !== undefined) || (storageAccountAttributes !== null && storageAccountAttributes !== undefined) || (tags !== null && tags !== undefined)) { - parameters = new client.models['StorageAccountUpdateParameters'](); - parameters.activeKeyName = activeKeyName; - parameters.autoRegenerateKey = autoRegenerateKey; - parameters.regenerationPeriod = regenerationPeriod; - parameters.storageAccountAttributes = storageAccountAttributes; - parameters.tags = tags; - } // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'deletedstorage/{storage-account-name}'; requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); let queryParameters = []; @@ -10589,7 +10566,7 @@ function _updateStorageAccount(vaultBaseUrl, storageAccountName, options, callba // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -10607,21 +10584,7 @@ function _updateStorageAccount(vaultBaseUrl, storageAccountName, options, callba } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['StorageAccountUpdateParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -10664,7 +10627,7 @@ function _updateStorageAccount(vaultBaseUrl, storageAccountName, options, callba parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StorageBundle']().mapper(); + let resultMapper = new client.models['DeletedStorageBundle']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10680,16 +10643,18 @@ function _updateStorageAccount(vaultBaseUrl, storageAccountName, options, callba } /** - * Regenerates the specified key value for the given storage account. This - * operation requires the storage/regeneratekey permission. + * @summary Permanently deletes the specified storage account. + * + * The purge deleted storage account operation removes the secret permanently, + * without the possibility of recovery. This operation can only be performed on + * a soft-delete enabled vault. This operation requires the storage/purge + * permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} storageAccountName The name of the storage account. * - * @param {string} keyName The storage account key name. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -10701,14 +10666,13 @@ function _updateStorageAccount(vaultBaseUrl, storageAccountName, options, callba * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link StorageBundle} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, options, callback) { +function _purgeDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -10735,24 +10699,16 @@ function _regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); } - if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { - throw new Error('keyName cannot be null or undefined and it must be of type string.'); - } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } - let parameters; - if (keyName !== null && keyName !== undefined) { - parameters = new client.models['StorageAccountRegenerteKeyParameters'](); - parameters.keyName = keyName; - } // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}/regeneratekey'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'deletedstorage/{storage-account-name}'; requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); let queryParameters = []; @@ -10763,7 +10719,7 @@ function _regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -10781,28 +10737,14 @@ function _regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['StorageAccountRegenerteKeyParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -10831,31 +10773,17 @@ function _regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StorageBundle']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * List storage SAS definitions for the given storage account. This operation - * requires the storage/listsas permission. + * @summary Recovers the deleted storage account. + * + * Recovers the deleted storage account in the specified vault. This operation + * can only be performed on a soft-delete enabled vault. This operation + * requires the storage/recover permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. @@ -10864,9 +10792,6 @@ function _regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, * * @param {object} [options] Optional Parameters. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -10877,14 +10802,13 @@ function _regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SasDefinitionListResult} for more - * information. + * See {@link StorageBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getSasDefinitions(vaultBaseUrl, storageAccountName, options, callback) { +function _recoverDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -10894,7 +10818,6 @@ function _getSasDefinitions(vaultBaseUrl, storageAccountName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; // Validate try { if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { @@ -10909,19 +10832,6 @@ function _getSasDefinitions(vaultBaseUrl, storageAccountName, options, callback) throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); } } - if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { - throw new Error('maxresults must be of type number.'); - } - if (maxresults !== null && maxresults !== undefined) { - if (maxresults > 25) - { - throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); - } - if (maxresults < 1) - { - throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); - } - } if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); } @@ -10934,13 +10844,10 @@ function _getSasDefinitions(vaultBaseUrl, storageAccountName, options, callback) // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}/sas'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'deletedstorage/{storage-account-name}/recover'; requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); let queryParameters = []; - if (maxresults !== null && maxresults !== undefined) { - queryParameters.push('maxresults=' + encodeURIComponent(maxresults.toString())); - } queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -10948,7 +10855,7 @@ function _getSasDefinitions(vaultBaseUrl, storageAccountName, options, callback) // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -11009,7 +10916,7 @@ function _getSasDefinitions(vaultBaseUrl, storageAccountName, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SasDefinitionListResult']().mapper(); + let resultMapper = new client.models['StorageBundle']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11025,16 +10932,16 @@ function _getSasDefinitions(vaultBaseUrl, storageAccountName, options, callback) } /** - * Deletes a SAS definition from a specified storage account. This operation - * requires the storage/deletesas permission. + * @summary Backs up the specified storage account. + * + * Requests that a backup of the specified storage account be downloaded to the + * client. This operation requires the storage/backup permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} storageAccountName The name of the storage account. * - * @param {string} sasDefinitionName The name of the SAS definition. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -11047,13 +10954,13 @@ function _getSasDefinitions(vaultBaseUrl, storageAccountName, options, callback) * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SasDefinitionBundle} for more information. + * See {@link BackupStorageResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, callback) { +function _backupStorageAccount(vaultBaseUrl, storageAccountName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -11071,21 +10978,6 @@ function _deleteSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionNam if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); } - if (storageAccountName !== null && storageAccountName !== undefined) { - if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) - { - throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); - } - } - if (sasDefinitionName === null || sasDefinitionName === undefined || typeof sasDefinitionName.valueOf() !== 'string') { - throw new Error('sasDefinitionName cannot be null or undefined and it must be of type string.'); - } - if (sasDefinitionName !== null && sasDefinitionName !== undefined) { - if (sasDefinitionName.match(/^[0-9a-zA-Z]+$/) === null) - { - throw new Error('"sasDefinitionName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); - } - } if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); } @@ -11098,10 +10990,9 @@ function _deleteSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionNam // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}/sas/{sas-definition-name}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}/backup'; requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); - requestUrl = requestUrl.replace('{sas-definition-name}', encodeURIComponent(sasDefinitionName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { @@ -11110,7 +11001,7 @@ function _deleteSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionNam // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -11171,7 +11062,7 @@ function _deleteSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionNam parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SasDefinitionBundle']().mapper(); + let resultMapper = new client.models['BackupStorageResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11187,15 +11078,16 @@ function _deleteSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionNam } /** - * Gets information about a SAS definition for the specified storage account. - * This operation requires the storage/getsas permission. + * @summary Restores a backed up storage account to a vault. + * + * Restores a backed up storage account to a vault. This operation requires the + * storage/restore permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} storageAccountName The name of the storage account. - * - * @param {string} sasDefinitionName The name of the SAS definition. + * @param {buffer} storageBundleBackup The backup blob associated with a + * storage account. * * @param {object} [options] Optional Parameters. * @@ -11209,13 +11101,13 @@ function _deleteSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionNam * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SasDefinitionBundle} for more information. + * See {@link StorageBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, callback) { +function _restoreStorageAccount(vaultBaseUrl, storageBundleBackup, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -11230,40 +11122,28 @@ function _getSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); } - if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { - throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); - } - if (storageAccountName !== null && storageAccountName !== undefined) { - if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) - { - throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); - } - } - if (sasDefinitionName === null || sasDefinitionName === undefined || typeof sasDefinitionName.valueOf() !== 'string') { - throw new Error('sasDefinitionName cannot be null or undefined and it must be of type string.'); - } - if (sasDefinitionName !== null && sasDefinitionName !== undefined) { - if (sasDefinitionName.match(/^[0-9a-zA-Z]+$/) === null) - { - throw new Error('"sasDefinitionName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); - } - } if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); } + if (!Buffer.isBuffer(storageBundleBackup)) { + throw new Error('storageBundleBackup cannot be null or undefined and it must be of type buffer.'); + } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } + let parameters; + if (storageBundleBackup !== null && storageBundleBackup !== undefined) { + parameters = new client.models['StorageRestoreParameters'](); + parameters.storageBundleBackup = storageBundleBackup; + } // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}/sas/{sas-definition-name}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/restore'; requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); - requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); - requestUrl = requestUrl.replace('{sas-definition-name}', encodeURIComponent(sasDefinitionName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { @@ -11272,7 +11152,7 @@ function _getSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -11290,7 +11170,21 @@ function _getSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['StorageRestoreParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -11333,7 +11227,7 @@ function _getSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SasDefinitionBundle']().mapper(); + let resultMapper = new client.models['StorageBundle']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11349,30 +11243,16 @@ function _getSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, } /** - * Creates or updates a new SAS definition for the specified storage account. - * This operation requires the storage/setsas permission. + * Deletes a storage account. This operation requires the storage/delete + * permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} storageAccountName The name of the storage account. * - * @param {string} sasDefinitionName The name of the SAS definition. - * - * @param {object} parameters Sas definition creation metadata in the form of - * key-value pairs. - * * @param {object} [options] Optional Parameters. * - * @param {object} [options.sasDefinitionAttributes] The attributes of the SAS - * definition. - * - * @param {boolean} [options.sasDefinitionAttributes.enabled] the enabled state - * of the object. - * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -11383,13 +11263,13 @@ function _getSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SasDefinitionBundle} for more information. + * See {@link DeletedStorageBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, parameters, options, callback) { +function _deleteStorageAccount(vaultBaseUrl, storageAccountName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -11399,8 +11279,6 @@ function _setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, if (!callback) { throw new Error('callback cannot be null.'); } - let sasDefinitionAttributes = (options && options.sasDefinitionAttributes !== undefined) ? options.sasDefinitionAttributes : undefined; - let tags = (options && options.tags !== undefined) ? options.tags : undefined; // Validate try { if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { @@ -11415,53 +11293,21 @@ function _setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); } } - if (sasDefinitionName === null || sasDefinitionName === undefined || typeof sasDefinitionName.valueOf() !== 'string') { - throw new Error('sasDefinitionName cannot be null or undefined and it must be of type string.'); - } - if (sasDefinitionName !== null && sasDefinitionName !== undefined) { - if (sasDefinitionName.match(/^[0-9a-zA-Z]+$/) === null) - { - throw new Error('"sasDefinitionName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); - } - } if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); } - if (parameters === null || parameters === undefined || typeof parameters !== 'object') { - throw new Error('parameters cannot be null or undefined and it must be of type object.'); - } - for(let valueElement in parameters) { - if (parameters[valueElement] !== null && parameters[valueElement] !== undefined && typeof parameters[valueElement].valueOf() !== 'string') { - throw new Error('parameters[valueElement] must be of type string.'); - } - } - if (tags && typeof tags === 'object') { - for(let valueElement1 in tags) { - if (tags[valueElement1] !== null && tags[valueElement1] !== undefined && typeof tags[valueElement1].valueOf() !== 'string') { - throw new Error('tags[valueElement1] must be of type string.'); - } - } - } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } - let parameters1; - if ((parameters !== null && parameters !== undefined) || (sasDefinitionAttributes !== null && sasDefinitionAttributes !== undefined) || (tags !== null && tags !== undefined)) { - parameters1 = new client.models['SasDefinitionCreateParameters'](); - parameters1.parameters = parameters; - parameters1.sasDefinitionAttributes = sasDefinitionAttributes; - parameters1.tags = tags; - } // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}/sas/{sas-definition-name}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}'; requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); - requestUrl = requestUrl.replace('{sas-definition-name}', encodeURIComponent(sasDefinitionName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { @@ -11470,7 +11316,7 @@ function _setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -11488,21 +11334,7 @@ function _setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters1 !== null && parameters1 !== undefined) { - let requestModelMapper = new client.models['SasDefinitionCreateParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters1, 'parameters1'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters1, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -11545,7 +11377,7 @@ function _setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SasDefinitionBundle']().mapper(); + let resultMapper = new client.models['DeletedStorageBundle']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11561,30 +11393,16 @@ function _setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, } /** - * Updates the specified attributes associated with the given SAS definition. - * This operation requires the storage/setsas permission. + * Gets information about a specified storage account. This operation requires + * the storage/get permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} storageAccountName The name of the storage account. * - * @param {string} sasDefinitionName The name of the SAS definition. - * * @param {object} [options] Optional Parameters. * - * @param {object} [options.parameters] Sas definition update metadata in the - * form of key-value pairs. - * - * @param {object} [options.sasDefinitionAttributes] The attributes of the SAS - * definition. - * - * @param {boolean} [options.sasDefinitionAttributes.enabled] the enabled state - * of the object. - * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -11595,13 +11413,13 @@ function _setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SasDefinitionBundle} for more information. + * See {@link StorageBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _updateSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, callback) { +function _getStorageAccount(vaultBaseUrl, storageAccountName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -11611,9 +11429,6 @@ function _updateSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionNam if (!callback) { throw new Error('callback cannot be null.'); } - let parameters = (options && options.parameters !== undefined) ? options.parameters : undefined; - let sasDefinitionAttributes = (options && options.sasDefinitionAttributes !== undefined) ? options.sasDefinitionAttributes : undefined; - let tags = (options && options.tags !== undefined) ? options.tags : undefined; // Validate try { if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { @@ -11628,52 +11443,21 @@ function _updateSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionNam throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); } } - if (sasDefinitionName === null || sasDefinitionName === undefined || typeof sasDefinitionName.valueOf() !== 'string') { - throw new Error('sasDefinitionName cannot be null or undefined and it must be of type string.'); - } - if (sasDefinitionName !== null && sasDefinitionName !== undefined) { - if (sasDefinitionName.match(/^[0-9a-zA-Z]+$/) === null) - { - throw new Error('"sasDefinitionName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); - } - } if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); } - if (parameters && typeof parameters === 'object') { - for(let valueElement in parameters) { - if (parameters[valueElement] !== null && parameters[valueElement] !== undefined && typeof parameters[valueElement].valueOf() !== 'string') { - throw new Error('parameters[valueElement] must be of type string.'); - } - } - } - if (tags && typeof tags === 'object') { - for(let valueElement1 in tags) { - if (tags[valueElement1] !== null && tags[valueElement1] !== undefined && typeof tags[valueElement1].valueOf() !== 'string') { - throw new Error('tags[valueElement1] must be of type string.'); - } - } - } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } - let parameters1; - if ((parameters !== null && parameters !== undefined) || (sasDefinitionAttributes !== null && sasDefinitionAttributes !== undefined) || (tags !== null && tags !== undefined)) { - parameters1 = new client.models['SasDefinitionUpdateParameters'](); - parameters1.parameters = parameters; - parameters1.sasDefinitionAttributes = sasDefinitionAttributes; - parameters1.tags = tags; - } // Construct URL let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}/sas/{sas-definition-name}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}'; requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); - requestUrl = requestUrl.replace('{sas-definition-name}', encodeURIComponent(sasDefinitionName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { @@ -11682,7 +11466,7 @@ function _updateSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionNam // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -11700,21 +11484,7 @@ function _updateSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionNam } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters1 !== null && parameters1 !== undefined) { - let requestModelMapper = new client.models['SasDefinitionUpdateParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters1, 'parameters1'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters1, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -11757,7 +11527,7 @@ function _updateSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionNam parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SasDefinitionBundle']().mapper(); + let resultMapper = new client.models['StorageBundle']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11773,16 +11543,35 @@ function _updateSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionNam } /** - * @summary Retrieves a list of individual key versions with the same key name. + * Creates or updates a new storage account. This operation requires the + * storage/set permission. * - * The full key identifier, attributes, and tags are provided in the response. - * This operation requires the keys/list permission. + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} resourceId Storage account resource id. + * + * @param {string} activeKeyName Current active storage account key name. + * + * @param {boolean} autoRegenerateKey whether keyvault should manage the + * storage account for the user. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.regenerationPeriod] The key regeneration time + * duration specified in ISO-8601 format. + * + * @param {object} [options.storageAccountAttributes] The attributes of the + * storage account. + * + * @param {boolean} [options.storageAccountAttributes.enabled] the enabled + * state of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -11793,13 +11582,13 @@ function _updateSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionNam * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link KeyListResult} for more information. + * See {@link StorageBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getKeyVersionsNext(nextPageLink, options, callback) { +function _setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -11809,10 +11598,44 @@ function _getKeyVersionsNext(nextPageLink, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let regenerationPeriod = (options && options.regenerationPeriod !== undefined) ? options.regenerationPeriod : undefined; + let storageAccountAttributes = (options && options.storageAccountAttributes !== undefined) ? options.storageAccountAttributes : undefined; + let tags = (options && options.tags !== undefined) ? options.tags : undefined; // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (resourceId === null || resourceId === undefined || typeof resourceId.valueOf() !== 'string') { + throw new Error('resourceId cannot be null or undefined and it must be of type string.'); + } + if (activeKeyName === null || activeKeyName === undefined || typeof activeKeyName.valueOf() !== 'string') { + throw new Error('activeKeyName cannot be null or undefined and it must be of type string.'); + } + if (autoRegenerateKey === null || autoRegenerateKey === undefined || typeof autoRegenerateKey !== 'boolean') { + throw new Error('autoRegenerateKey cannot be null or undefined and it must be of type boolean.'); + } + if (regenerationPeriod !== null && regenerationPeriod !== undefined && typeof regenerationPeriod.valueOf() !== 'string') { + throw new Error('regenerationPeriod must be of type string.'); + } + if (tags && typeof tags === 'object') { + for(let valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] must be of type string.'); + } + } } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); @@ -11820,14 +11643,31 @@ function _getKeyVersionsNext(nextPageLink, options, callback) { } catch (error) { return callback(error); } + let parameters; + if ((resourceId !== null && resourceId !== undefined) || (activeKeyName !== null && activeKeyName !== undefined) || (autoRegenerateKey !== null && autoRegenerateKey !== undefined) || (regenerationPeriod !== null && regenerationPeriod !== undefined) || (storageAccountAttributes !== null && storageAccountAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['StorageAccountCreateParameters'](); + parameters.resourceId = resourceId; + parameters.activeKeyName = activeKeyName; + parameters.autoRegenerateKey = autoRegenerateKey; + parameters.regenerationPeriod = regenerationPeriod; + parameters.storageAccountAttributes = storageAccountAttributes; + parameters.tags = tags; + } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -11845,7 +11685,21 @@ function _getKeyVersionsNext(nextPageLink, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['StorageAccountCreateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -11888,7 +11742,7 @@ function _getKeyVersionsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['KeyListResult']().mapper(); + let resultMapper = new client.models['StorageBundle']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11904,20 +11758,34 @@ function _getKeyVersionsNext(nextPageLink, options, callback) { } /** - * @summary List keys in the specified vault. + * Updates the specified attributes associated with the given storage account. + * This operation requires the storage/set/update permission. * - * Retrieves a list of the keys in the Key Vault as JSON Web Key structures - * that contain the public part of a stored key. The LIST operation is - * applicable to all key types, however only the base key identifier, - * attributes, and tags are provided in the response. Individual versions of a - * key are not listed in the response. This operation requires the keys/list - * permission. + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} storageAccountName The name of the storage account. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.activeKeyName] The current active storage account + * key name. + * + * @param {boolean} [options.autoRegenerateKey] whether keyvault should manage + * the storage account for the user. + * + * @param {string} [options.regenerationPeriod] The key regeneration time + * duration specified in ISO-8601 format. + * + * @param {object} [options.storageAccountAttributes] The attributes of the + * storage account. + * + * @param {boolean} [options.storageAccountAttributes.enabled] the enabled + * state of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -11928,13 +11796,13 @@ function _getKeyVersionsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link KeyListResult} for more information. + * See {@link StorageBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getKeysNext(nextPageLink, options, callback) { +function _updateStorageAccount(vaultBaseUrl, storageAccountName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -11944,10 +11812,43 @@ function _getKeysNext(nextPageLink, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let activeKeyName = (options && options.activeKeyName !== undefined) ? options.activeKeyName : undefined; + let autoRegenerateKey = (options && options.autoRegenerateKey !== undefined) ? options.autoRegenerateKey : undefined; + let regenerationPeriod = (options && options.regenerationPeriod !== undefined) ? options.regenerationPeriod : undefined; + let storageAccountAttributes = (options && options.storageAccountAttributes !== undefined) ? options.storageAccountAttributes : undefined; + let tags = (options && options.tags !== undefined) ? options.tags : undefined; // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (activeKeyName !== null && activeKeyName !== undefined && typeof activeKeyName.valueOf() !== 'string') { + throw new Error('activeKeyName must be of type string.'); + } + if (autoRegenerateKey !== null && autoRegenerateKey !== undefined && typeof autoRegenerateKey !== 'boolean') { + throw new Error('autoRegenerateKey must be of type boolean.'); + } + if (regenerationPeriod !== null && regenerationPeriod !== undefined && typeof regenerationPeriod.valueOf() !== 'string') { + throw new Error('regenerationPeriod must be of type string.'); + } + if (tags && typeof tags === 'object') { + for(let valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] must be of type string.'); + } + } } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); @@ -11955,14 +11856,30 @@ function _getKeysNext(nextPageLink, options, callback) { } catch (error) { return callback(error); } + let parameters; + if ((activeKeyName !== null && activeKeyName !== undefined) || (autoRegenerateKey !== null && autoRegenerateKey !== undefined) || (regenerationPeriod !== null && regenerationPeriod !== undefined) || (storageAccountAttributes !== null && storageAccountAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['StorageAccountUpdateParameters'](); + parameters.activeKeyName = activeKeyName; + parameters.autoRegenerateKey = autoRegenerateKey; + parameters.regenerationPeriod = regenerationPeriod; + parameters.storageAccountAttributes = storageAccountAttributes; + parameters.tags = tags; + } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -11980,7 +11897,21 @@ function _getKeysNext(nextPageLink, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['StorageAccountUpdateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -12023,7 +11954,7 @@ function _getKeysNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['KeyListResult']().mapper(); + let resultMapper = new client.models['StorageBundle']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12039,17 +11970,15 @@ function _getKeysNext(nextPageLink, options, callback) { } /** - * @summary Lists the deleted keys in the specified vault. + * Regenerates the specified key value for the given storage account. This + * operation requires the storage/regeneratekey permission. * - * Retrieves a list of the keys in the Key Vault as JSON Web Key structures - * that contain the public part of a deleted key. This operation includes - * deletion-specific information. The Get Deleted Keys operation is applicable - * for vaults enabled for soft-delete. While the operation can be invoked on - * any vault, it will return an error if invoked on a non soft-delete enabled - * vault. This operation requires the keys/list permission. + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} keyName The storage account key name. * * @param {object} [options] Optional Parameters. * @@ -12063,13 +11992,13 @@ function _getKeysNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeletedKeyListResult} for more information. + * See {@link StorageBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getDeletedKeysNext(nextPageLink, options, callback) { +function _regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -12081,23 +12010,50 @@ function _getDeletedKeysNext(nextPageLink, options, callback) { } // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); } - if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.acceptLanguage must be of type string.'); + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); } - } catch (error) { - return callback(error); - } - - // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + let parameters; + if (keyName !== null && keyName !== undefined) { + parameters = new client.models['StorageAccountRegenerteKeyParameters'](); + parameters.keyName = keyName; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}/regeneratekey'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -12115,7 +12071,21 @@ function _getDeletedKeysNext(nextPageLink, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['StorageAccountRegenerteKeyParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -12158,7 +12128,7 @@ function _getDeletedKeysNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DeletedKeyListResult']().mapper(); + let resultMapper = new client.models['StorageBundle']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12174,18 +12144,19 @@ function _getDeletedKeysNext(nextPageLink, options, callback) { } /** - * @summary List secrets in a specified key vault. + * List storage SAS definitions for the given storage account. This operation + * requires the storage/listsas permission. * - * The Get Secrets operation is applicable to the entire vault. However, only - * the base secret identifier and its attributes are provided in the response. - * Individual secret versions are not listed in the response. This operation - * requires the secrets/list permission. + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} storageAccountName The name of the storage account. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -12196,13 +12167,14 @@ function _getDeletedKeysNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SecretListResult} for more information. + * See {@link SasDefinitionListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getSecretsNext(nextPageLink, options, callback) { +function _getSasDefinitions(vaultBaseUrl, storageAccountName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -12212,10 +12184,36 @@ function _getSecretsNext(nextPageLink, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (maxresults !== null && maxresults !== undefined) { + if (maxresults > 25) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); + } + if (maxresults < 1) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); @@ -12225,8 +12223,18 @@ function _getSecretsNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}/sas'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + let queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); @@ -12291,7 +12299,7 @@ function _getSecretsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SecretListResult']().mapper(); + let resultMapper = new client.models['SasDefinitionListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12307,17 +12315,23 @@ function _getSecretsNext(nextPageLink, options, callback) { } /** - * @summary List all versions of the specified secret. + * @summary Lists deleted SAS definitions for the specified vault and storage + * account. * - * The full secret identifier and attributes are provided in the response. No - * values are returned for the secrets. This operations requires the - * secrets/list permission. + * The Get Deleted Sas Definitions operation returns the SAS definitions that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/listsas permission. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -12328,13 +12342,14 @@ function _getSecretsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SecretListResult} for more information. + * See {@link DeletedSasDefinitionListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getSecretVersionsNext(nextPageLink, options, callback) { +function _getDeletedSasDefinitions(vaultBaseUrl, storageAccountName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -12344,10 +12359,36 @@ function _getSecretVersionsNext(nextPageLink, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (maxresults !== null && maxresults !== undefined) { + if (maxresults > 25) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMaximum": 25'); + } + if (maxresults < 1) + { + throw new Error('"maxresults" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); @@ -12357,8 +12398,18 @@ function _getSecretVersionsNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'deletedstorage/{storage-account-name}/sas'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + let queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); @@ -12423,7 +12474,7 @@ function _getSecretVersionsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SecretListResult']().mapper(); + let resultMapper = new client.models['DeletedSasDefinitionListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12439,14 +12490,18 @@ function _getSecretVersionsNext(nextPageLink, options, callback) { } /** - * @summary Lists deleted secrets for the specified vault. + * @summary Gets the specified deleted sas definition. * - * The Get Deleted Secrets operation returns the secrets that have been deleted - * for a vault enabled for soft-delete. This operation requires the - * secrets/list permission. + * The Get Deleted SAS Definition operation returns the specified deleted SAS + * definition along with its attributes. This operation requires the + * storage/getsas permission. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. * * @param {object} [options] Optional Parameters. * @@ -12460,14 +12515,14 @@ function _getSecretVersionsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeletedSecretListResult} for more + * See {@link DeletedSasDefinitionBundle} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getDeletedSecretsNext(nextPageLink, options, callback) { +function _getDeletedSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -12479,8 +12534,29 @@ function _getDeletedSecretsNext(nextPageLink, options, callback) { } // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (sasDefinitionName === null || sasDefinitionName === undefined || typeof sasDefinitionName.valueOf() !== 'string') { + throw new Error('sasDefinitionName cannot be null or undefined and it must be of type string.'); + } + if (sasDefinitionName !== null && sasDefinitionName !== undefined) { + if (sasDefinitionName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"sasDefinitionName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); @@ -12490,8 +12566,16 @@ function _getDeletedSecretsNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'deletedstorage/{storage-account-name}/sas/{sas-definition-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + requestUrl = requestUrl.replace('{sas-definition-name}', encodeURIComponent(sasDefinitionName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); @@ -12556,7 +12640,7 @@ function _getDeletedSecretsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DeletedSecretListResult']().mapper(); + let resultMapper = new client.models['DeletedSasDefinitionBundle']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12572,14 +12656,18 @@ function _getDeletedSecretsNext(nextPageLink, options, callback) { } /** - * @summary List certificates in a specified key vault + * @summary Recovers the deleted SAS definition. * - * The GetCertificates operation returns the set of certificates resources in - * the specified key vault. This operation requires the certificates/list - * permission. + * Recovers the deleted SAS definition for the specified storage account. This + * operation can only be performed on a soft-delete enabled vault. This + * operation requires the storage/recover permission. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. * * @param {object} [options] Optional Parameters. * @@ -12593,13 +12681,13 @@ function _getDeletedSecretsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CertificateListResult} for more information. + * See {@link SasDefinitionBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getCertificatesNext(nextPageLink, options, callback) { +function _recoverDeletedSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -12611,23 +12699,52 @@ function _getCertificatesNext(nextPageLink, options, callback) { } // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); } - if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.acceptLanguage must be of type string.'); + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (sasDefinitionName === null || sasDefinitionName === undefined || typeof sasDefinitionName.valueOf() !== 'string') { + throw new Error('sasDefinitionName cannot be null or undefined and it must be of type string.'); + } + if (sasDefinitionName !== null && sasDefinitionName !== undefined) { + if (sasDefinitionName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"sasDefinitionName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'deletedstorage/{storage-account-name}/sas/{sas-definition-name}/recover'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + requestUrl = requestUrl.replace('{sas-definition-name}', encodeURIComponent(sasDefinitionName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -12688,7 +12805,7 @@ function _getCertificatesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['CertificateListResult']().mapper(); + let resultMapper = new client.models['SasDefinitionBundle']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12704,14 +12821,15 @@ function _getCertificatesNext(nextPageLink, options, callback) { } /** - * @summary List certificate issuers for a specified key vault. + * Deletes a SAS definition from a specified storage account. This operation + * requires the storage/deletesas permission. * - * The GetCertificateIssuers operation returns the set of certificate issuer - * resources in the specified key vault. This operation requires the - * certificates/manageissuers/getissuers permission. + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. * * @param {object} [options] Optional Parameters. * @@ -12725,14 +12843,14 @@ function _getCertificatesNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CertificateIssuerListResult} for more + * See {@link DeletedSasDefinitionBundle} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getCertificateIssuersNext(nextPageLink, options, callback) { +function _deleteSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -12744,8 +12862,29 @@ function _getCertificateIssuersNext(nextPageLink, options, callback) { } // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (sasDefinitionName === null || sasDefinitionName === undefined || typeof sasDefinitionName.valueOf() !== 'string') { + throw new Error('sasDefinitionName cannot be null or undefined and it must be of type string.'); + } + if (sasDefinitionName !== null && sasDefinitionName !== undefined) { + if (sasDefinitionName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"sasDefinitionName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); @@ -12755,12 +12894,20 @@ function _getCertificateIssuersNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}/sas/{sas-definition-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + requestUrl = requestUrl.replace('{sas-definition-name}', encodeURIComponent(sasDefinitionName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -12821,7 +12968,7 @@ function _getCertificateIssuersNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['CertificateIssuerListResult']().mapper(); + let resultMapper = new client.models['DeletedSasDefinitionBundle']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12837,14 +12984,15 @@ function _getCertificateIssuersNext(nextPageLink, options, callback) { } /** - * @summary List the versions of a certificate. + * Gets information about a SAS definition for the specified storage account. + * This operation requires the storage/getsas permission. * - * The GetCertificateVersions operation returns the versions of a certificate - * in the specified key vault. This operation requires the certificates/list - * permission. + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. * * @param {object} [options] Optional Parameters. * @@ -12858,13 +13006,13 @@ function _getCertificateIssuersNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CertificateListResult} for more information. + * See {@link SasDefinitionBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getCertificateVersionsNext(nextPageLink, options, callback) { +function _getSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -12876,8 +13024,29 @@ function _getCertificateVersionsNext(nextPageLink, options, callback) { } // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (sasDefinitionName === null || sasDefinitionName === undefined || typeof sasDefinitionName.valueOf() !== 'string') { + throw new Error('sasDefinitionName cannot be null or undefined and it must be of type string.'); + } + if (sasDefinitionName !== null && sasDefinitionName !== undefined) { + if (sasDefinitionName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"sasDefinitionName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); @@ -12887,8 +13056,16 @@ function _getCertificateVersionsNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}/sas/{sas-definition-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + requestUrl = requestUrl.replace('{sas-definition-name}', encodeURIComponent(sasDefinitionName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); @@ -12953,7 +13130,7 @@ function _getCertificateVersionsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['CertificateListResult']().mapper(); + let resultMapper = new client.models['SasDefinitionBundle']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12969,20 +13146,37 @@ function _getCertificateVersionsNext(nextPageLink, options, callback) { } /** - * @summary Lists the deleted certificates in the specified vault currently - * available for recovery. + * Creates or updates a new SAS definition for the specified storage account. + * This operation requires the storage/setsas permission. * - * 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 {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {string} templateUri The SAS definition token template signed with an + * arbitrary key. Tokens created according to the SAS definition will have the + * same properties as the template. + * + * @param {string} sasType The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * + * @param {string} validityPeriod The validity period of SAS tokens created + * according to the SAS definition. * * @param {object} [options] Optional Parameters. * + * @param {object} [options.sasDefinitionAttributes] The attributes of the SAS + * definition. + * + * @param {boolean} [options.sasDefinitionAttributes.enabled] the enabled state + * of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -12993,14 +13187,13 @@ function _getCertificateVersionsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeletedCertificateListResult} for more - * information. + * See {@link SasDefinitionBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getDeletedCertificatesNext(nextPageLink, options, callback) { +function _setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -13010,10 +13203,49 @@ function _getDeletedCertificatesNext(nextPageLink, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let sasDefinitionAttributes = (options && options.sasDefinitionAttributes !== undefined) ? options.sasDefinitionAttributes : undefined; + let tags = (options && options.tags !== undefined) ? options.tags : undefined; // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (sasDefinitionName === null || sasDefinitionName === undefined || typeof sasDefinitionName.valueOf() !== 'string') { + throw new Error('sasDefinitionName cannot be null or undefined and it must be of type string.'); + } + if (sasDefinitionName !== null && sasDefinitionName !== undefined) { + if (sasDefinitionName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"sasDefinitionName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (templateUri === null || templateUri === undefined || typeof templateUri.valueOf() !== 'string') { + throw new Error('templateUri cannot be null or undefined and it must be of type string.'); + } + if (sasType === null || sasType === undefined || typeof sasType.valueOf() !== 'string') { + throw new Error('sasType cannot be null or undefined and it must be of type string.'); + } + if (validityPeriod === null || validityPeriod === undefined || typeof validityPeriod.valueOf() !== 'string') { + throw new Error('validityPeriod cannot be null or undefined and it must be of type string.'); + } + if (tags && typeof tags === 'object') { + for(let valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] must be of type string.'); + } + } } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); @@ -13021,14 +13253,31 @@ function _getDeletedCertificatesNext(nextPageLink, options, callback) { } catch (error) { return callback(error); } + let parameters; + if ((templateUri !== null && templateUri !== undefined) || (sasType !== null && sasType !== undefined) || (validityPeriod !== null && validityPeriod !== undefined) || (sasDefinitionAttributes !== null && sasDefinitionAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['SasDefinitionCreateParameters'](); + parameters.templateUri = templateUri; + parameters.sasType = sasType; + parameters.validityPeriod = validityPeriod; + parameters.sasDefinitionAttributes = sasDefinitionAttributes; + parameters.tags = tags; + } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}/sas/{sas-definition-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + requestUrl = requestUrl.replace('{sas-definition-name}', encodeURIComponent(sasDefinitionName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13046,7 +13295,21 @@ function _getDeletedCertificatesNext(nextPageLink, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['SasDefinitionCreateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -13089,7 +13352,7 @@ function _getDeletedCertificatesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DeletedCertificateListResult']().mapper(); + let resultMapper = new client.models['SasDefinitionBundle']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -13105,8 +13368,235 @@ function _getDeletedCertificatesNext(nextPageLink, options, callback) { } /** - * List storage accounts managed by the specified key vault. This operation - * requires the storage/list permission. + * Updates the specified attributes associated with the given SAS definition. + * This operation requires the storage/setsas permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} sasDefinitionName The name of the SAS definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.templateUri] The SAS definition token template + * signed with an arbitrary key. Tokens created according to the SAS + * definition will have the same properties as the template. + * + * @param {string} [options.sasType] The type of SAS token the SAS definition + * will create. Possible values include: 'account', 'service' + * + * @param {string} [options.validityPeriod] The validity period of SAS tokens + * created according to the SAS definition. + * + * @param {object} [options.sasDefinitionAttributes] The attributes of the SAS + * definition. + * + * @param {boolean} [options.sasDefinitionAttributes.enabled] the enabled state + * of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let templateUri = (options && options.templateUri !== undefined) ? options.templateUri : undefined; + let sasType = (options && options.sasType !== undefined) ? options.sasType : undefined; + let validityPeriod = (options && options.validityPeriod !== undefined) ? options.validityPeriod : undefined; + let sasDefinitionAttributes = (options && options.sasDefinitionAttributes !== undefined) ? options.sasDefinitionAttributes : undefined; + let tags = (options && options.tags !== undefined) ? options.tags : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName === null || storageAccountName === undefined || typeof storageAccountName.valueOf() !== 'string') { + throw new Error('storageAccountName cannot be null or undefined and it must be of type string.'); + } + if (storageAccountName !== null && storageAccountName !== undefined) { + if (storageAccountName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"storageAccountName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (sasDefinitionName === null || sasDefinitionName === undefined || typeof sasDefinitionName.valueOf() !== 'string') { + throw new Error('sasDefinitionName cannot be null or undefined and it must be of type string.'); + } + if (sasDefinitionName !== null && sasDefinitionName !== undefined) { + if (sasDefinitionName.match(/^[0-9a-zA-Z]+$/) === null) + { + throw new Error('"sasDefinitionName" should satisfy the constraint - "Pattern": /^[0-9a-zA-Z]+$/'); + } + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (templateUri !== null && templateUri !== undefined && typeof templateUri.valueOf() !== 'string') { + throw new Error('templateUri must be of type string.'); + } + if (sasType !== null && sasType !== undefined && typeof sasType.valueOf() !== 'string') { + throw new Error('sasType must be of type string.'); + } + if (validityPeriod !== null && validityPeriod !== undefined && typeof validityPeriod.valueOf() !== 'string') { + throw new Error('validityPeriod must be of type string.'); + } + if (tags && typeof tags === 'object') { + for(let valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] must be of type string.'); + } + } + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + let parameters; + if ((templateUri !== null && templateUri !== undefined) || (sasType !== null && sasType !== undefined) || (validityPeriod !== null && validityPeriod !== undefined) || (sasDefinitionAttributes !== null && sasDefinitionAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['SasDefinitionUpdateParameters'](); + parameters.templateUri = templateUri; + parameters.sasType = sasType; + parameters.validityPeriod = validityPeriod; + parameters.sasDefinitionAttributes = sasDefinitionAttributes; + parameters.tags = tags; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'storage/{storage-account-name}/sas/{sas-definition-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{storage-account-name}', encodeURIComponent(storageAccountName)); + requestUrl = requestUrl.replace('{sas-definition-name}', encodeURIComponent(sasDefinitionName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['SasDefinitionUpdateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SasDefinitionBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Retrieves a list of individual key versions with the same key name. + * + * The full key identifier, attributes, and tags are provided in the response. + * This operation requires the keys/list permission. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -13123,13 +13613,13 @@ function _getDeletedCertificatesNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link StorageListResult} for more information. + * See {@link KeyListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getStorageAccountsNext(nextPageLink, options, callback) { +function _getKeyVersionsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -13218,7 +13708,7 @@ function _getStorageAccountsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StorageListResult']().mapper(); + let resultMapper = new client.models['KeyListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -13234,8 +13724,14 @@ function _getStorageAccountsNext(nextPageLink, options, callback) { } /** - * List storage SAS definitions for the given storage account. This operation - * requires the storage/listsas permission. + * @summary List keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a stored key. The LIST operation is + * applicable to all key types, however only the base key identifier, + * attributes, and tags are provided in the response. Individual versions of a + * key are not listed in the response. This operation requires the keys/list + * permission. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -13252,14 +13748,13 @@ function _getStorageAccountsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SasDefinitionListResult} for more - * information. + * See {@link KeyListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getSasDefinitionsNext(nextPageLink, options, callback) { +function _getKeysNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this; if(!callback && typeof options === 'function') { @@ -13348,7 +13843,7 @@ function _getSasDefinitionsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SasDefinitionListResult']().mapper(); + let resultMapper = new client.models['KeyListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -13363,185 +13858,2559 @@ function _getSasDefinitionsNext(nextPageLink, options, callback) { }); } -/** Class representing a KeyVaultClient. */ -class KeyVaultClient extends ServiceClient { - /** - * Create a KeyVaultClient. - * @param {credentials} credentials - Credentials needed for the client to connect to Azure. - * @param {object} [options] - The parameter options - * @param {Array} [options.filters] - Filters to be added to the request pipeline - * @param {object} [options.requestOptions] - Options for the underlying request object - * {@link https://github.com/request/request#requestoptions-callback Options doc} - * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. - */ - constructor(credentials, options) { - if (credentials === null || credentials === undefined) { - throw new Error('\'credentials\' cannot be null.'); - } - - if (!options) options = {}; - - super(credentials, options); - - this.apiVersion = '2016-10-01'; - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.generateClientRequestId = true; - this.baseUri = '{vaultBaseUrl}'; - this.credentials = credentials; - - let packageInfo = this.getPackageJsonInfo(__dirname); - this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); +/** + * @summary Lists the deleted keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a deleted key. This operation includes + * deletion-specific information. The Get Deleted Keys operation is applicable + * for vaults enabled for soft-delete. While the operation can be invoked on + * any vault, it will return an error if invoked on a non soft-delete enabled + * vault. This operation requires the keys/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedKeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDeletedKeysNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedKeyListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List secrets in a specified key vault. + * + * The Get Secrets operation is applicable to the entire vault. However, only + * the base secret identifier and its attributes are provided in the response. + * Individual secret versions are not listed in the response. This operation + * requires the secrets/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getSecretsNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SecretListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List all versions of the specified secret. + * + * The full secret identifier and attributes are provided in the response. No + * values are returned for the secrets. This operations requires the + * secrets/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getSecretVersionsNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SecretListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Lists deleted secrets for the specified vault. + * + * The Get Deleted Secrets operation returns the secrets that have been deleted + * for a vault enabled for soft-delete. This operation requires the + * secrets/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSecretListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDeletedSecretsNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedSecretListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List certificates in a specified key vault + * + * The GetCertificates operation returns the set of certificates resources in + * the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getCertificatesNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CertificateListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @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 {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateIssuerListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getCertificateIssuersNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CertificateIssuerListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List the versions of a certificate. + * + * The GetCertificateVersions operation returns the versions of a certificate + * in the specified key vault. This operation requires the certificates/list + * permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getCertificateVersionsNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CertificateListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Lists the deleted certificates in the specified vault currently + * available for recovery. + * + * 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 {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedCertificateListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDeletedCertificatesNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedCertificateListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * List storage accounts managed by the specified key vault. This operation + * requires the storage/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getStorageAccountsNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['StorageListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Lists deleted storage accounts for the specified vault. + * + * The Get Deleted Storage Accounts operation returns the storage accounts that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedStorageListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDeletedStorageAccountsNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedStorageListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * List storage SAS definitions for the given storage account. This operation + * requires the storage/listsas permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SasDefinitionListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getSasDefinitionsNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SasDefinitionListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Lists deleted SAS definitions for the specified vault and storage + * account. + * + * The Get Deleted Sas Definitions operation returns the SAS definitions that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/listsas permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSasDefinitionListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDeletedSasDefinitionsNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DeletedSasDefinitionListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a KeyVaultClient. */ +class KeyVaultClient extends ServiceClient { + /** + * Create a KeyVaultClient. + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * @param {object} [options] - The parameter options + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * @param {object} [options.requestOptions] - Options for the underlying request object + * {@link https://github.com/request/request#requestoptions-callback Options doc} + * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + */ + constructor(credentials, options) { + if (credentials === null || credentials === undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + + if (!options) options = {}; + + super(credentials, options); + + this.apiVersion = '7.0'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.baseUri = '{vaultBaseUrl}'; + this.credentials = credentials; + + let packageInfo = this.getPackageJsonInfo(__dirname); + this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { + this.generateClientRequestId = options.generateClientRequestId; + } + this.models = models; + this._createKey = _createKey; + this._importKey = _importKey; + this._deleteKey = _deleteKey; + this._updateKey = _updateKey; + this._getKey = _getKey; + this._getKeyVersions = _getKeyVersions; + this._getKeys = _getKeys; + this._backupKey = _backupKey; + this._restoreKey = _restoreKey; + this._encrypt = _encrypt; + this._decrypt = _decrypt; + this._sign = _sign; + this._verify = _verify; + this._wrapKey = _wrapKey; + this._unwrapKey = _unwrapKey; + this._getDeletedKeys = _getDeletedKeys; + this._getDeletedKey = _getDeletedKey; + this._purgeDeletedKey = _purgeDeletedKey; + this._recoverDeletedKey = _recoverDeletedKey; + this._setSecret = _setSecret; + this._deleteSecret = _deleteSecret; + this._updateSecret = _updateSecret; + this._getSecret = _getSecret; + this._getSecrets = _getSecrets; + this._getSecretVersions = _getSecretVersions; + this._getDeletedSecrets = _getDeletedSecrets; + this._getDeletedSecret = _getDeletedSecret; + this._purgeDeletedSecret = _purgeDeletedSecret; + this._recoverDeletedSecret = _recoverDeletedSecret; + this._backupSecret = _backupSecret; + this._restoreSecret = _restoreSecret; + this._getCertificates = _getCertificates; + this._deleteCertificate = _deleteCertificate; + this._setCertificateContacts = _setCertificateContacts; + this._getCertificateContacts = _getCertificateContacts; + this._deleteCertificateContacts = _deleteCertificateContacts; + this._getCertificateIssuers = _getCertificateIssuers; + this._setCertificateIssuer = _setCertificateIssuer; + this._updateCertificateIssuer = _updateCertificateIssuer; + this._getCertificateIssuer = _getCertificateIssuer; + this._deleteCertificateIssuer = _deleteCertificateIssuer; + this._createCertificate = _createCertificate; + this._importCertificate = _importCertificate; + this._getCertificateVersions = _getCertificateVersions; + this._getCertificatePolicy = _getCertificatePolicy; + this._updateCertificatePolicy = _updateCertificatePolicy; + this._updateCertificate = _updateCertificate; + this._getCertificate = _getCertificate; + this._updateCertificateOperation = _updateCertificateOperation; + this._getCertificateOperation = _getCertificateOperation; + this._deleteCertificateOperation = _deleteCertificateOperation; + this._mergeCertificate = _mergeCertificate; + this._backupCertificate = _backupCertificate; + this._restoreCertificate = _restoreCertificate; + this._getDeletedCertificates = _getDeletedCertificates; + this._getDeletedCertificate = _getDeletedCertificate; + this._purgeDeletedCertificate = _purgeDeletedCertificate; + this._recoverDeletedCertificate = _recoverDeletedCertificate; + this._getStorageAccounts = _getStorageAccounts; + this._getDeletedStorageAccounts = _getDeletedStorageAccounts; + this._getDeletedStorageAccount = _getDeletedStorageAccount; + this._purgeDeletedStorageAccount = _purgeDeletedStorageAccount; + this._recoverDeletedStorageAccount = _recoverDeletedStorageAccount; + this._backupStorageAccount = _backupStorageAccount; + this._restoreStorageAccount = _restoreStorageAccount; + this._deleteStorageAccount = _deleteStorageAccount; + this._getStorageAccount = _getStorageAccount; + this._setStorageAccount = _setStorageAccount; + this._updateStorageAccount = _updateStorageAccount; + this._regenerateStorageAccountKey = _regenerateStorageAccountKey; + this._getSasDefinitions = _getSasDefinitions; + this._getDeletedSasDefinitions = _getDeletedSasDefinitions; + this._getDeletedSasDefinition = _getDeletedSasDefinition; + this._recoverDeletedSasDefinition = _recoverDeletedSasDefinition; + this._deleteSasDefinition = _deleteSasDefinition; + this._getSasDefinition = _getSasDefinition; + this._setSasDefinition = _setSasDefinition; + this._updateSasDefinition = _updateSasDefinition; + this._getKeyVersionsNext = _getKeyVersionsNext; + this._getKeysNext = _getKeysNext; + this._getDeletedKeysNext = _getDeletedKeysNext; + this._getSecretsNext = _getSecretsNext; + this._getSecretVersionsNext = _getSecretVersionsNext; + this._getDeletedSecretsNext = _getDeletedSecretsNext; + this._getCertificatesNext = _getCertificatesNext; + this._getCertificateIssuersNext = _getCertificateIssuersNext; + this._getCertificateVersionsNext = _getCertificateVersionsNext; + this._getDeletedCertificatesNext = _getDeletedCertificatesNext; + this._getStorageAccountsNext = _getStorageAccountsNext; + this._getDeletedStorageAccountsNext = _getDeletedStorageAccountsNext; + this._getSasDefinitionsNext = _getSasDefinitionsNext; + this._getDeletedSasDefinitionsNext = _getDeletedSasDefinitionsNext; + msRest.addSerializationMixin(this); + } + + /** + * @summary Creates a new key, stores it, then returns key parameters and + * attributes to the client. + * + * The create key operation can be used to create any key type in Azure Key + * Vault. If the named key already exists, Azure Key Vault creates a new + * version of the key. It requires the keys/create permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name for the new key. The system will generate + * the version name for the new key. + * + * @param {string} kty The type of key to create. For valid values, see + * JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', + * 'oct' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.keySize] The key size in bits. For example: 2048, + * 3072, or 4096 for RSA. + * + * @param {array} [options.keyOps] + * + * @param {object} [options.keyAttributes] + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {string} [options.curve] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createKeyWithHttpOperationResponse(vaultBaseUrl, keyName, kty, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._createKey(vaultBaseUrl, keyName, kty, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new key, stores it, then returns key parameters and + * attributes to the client. + * + * The create key operation can be used to create any key type in Azure Key + * Vault. If the named key already exists, Azure Key Vault creates a new + * version of the key. It requires the keys/create permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name for the new key. The system will generate + * the version name for the new key. + * + * @param {string} kty The type of key to create. For valid values, see + * JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', + * 'oct' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.keySize] The key size in bits. For example: 2048, + * 3072, or 4096 for RSA. + * + * @param {array} [options.keyOps] + * + * @param {object} [options.keyAttributes] + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {string} [options.curve] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {KeyBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createKey(vaultBaseUrl, keyName, kty, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createKey(vaultBaseUrl, keyName, kty, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createKey(vaultBaseUrl, keyName, kty, options, optionalCallback); + } + } + + /** + * @summary Imports an externally created key, stores it, and returns key + * parameters and attributes to the client. + * + * The import key operation may be used to import any key type into an Azure + * Key Vault. If the named key already exists, Azure Key Vault creates a new + * version of the key. This operation requires the keys/import permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName Name for the imported key. + * + * @param {object} key The Json web key + * + * @param {string} [key.kid] Key identifier. + * + * @param {string} [key.kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible + * values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {array} [key.keyOps] + * + * @param {buffer} [key.n] RSA modulus. + * + * @param {buffer} [key.e] RSA public exponent. + * + * @param {buffer} [key.d] RSA private exponent, or the D component of an EC + * private key. + * + * @param {buffer} [key.dp] RSA private key parameter. + * + * @param {buffer} [key.dq] RSA private key parameter. + * + * @param {buffer} [key.qi] RSA private key parameter. + * + * @param {buffer} [key.p] RSA secret prime. + * + * @param {buffer} [key.q] RSA secret prime, with p < q. + * + * @param {buffer} [key.k] Symmetric key. + * + * @param {buffer} [key.t] HSM Token, used with 'Bring Your Own Key'. + * + * @param {string} [key.crv] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + * + * @param {buffer} [key.x] X component of an EC public key. + * + * @param {buffer} [key.y] Y component of an EC public key. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.hsm] Whether to import as a hardware key (HSM) or + * software key. + * + * @param {object} [options.keyAttributes] The key management attributes. + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + importKeyWithHttpOperationResponse(vaultBaseUrl, keyName, key, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._importKey(vaultBaseUrl, keyName, key, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Imports an externally created key, stores it, and returns key + * parameters and attributes to the client. + * + * The import key operation may be used to import any key type into an Azure + * Key Vault. If the named key already exists, Azure Key Vault creates a new + * version of the key. This operation requires the keys/import permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName Name for the imported key. + * + * @param {object} key The Json web key + * + * @param {string} [key.kid] Key identifier. + * + * @param {string} [key.kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible + * values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {array} [key.keyOps] + * + * @param {buffer} [key.n] RSA modulus. + * + * @param {buffer} [key.e] RSA public exponent. + * + * @param {buffer} [key.d] RSA private exponent, or the D component of an EC + * private key. + * + * @param {buffer} [key.dp] RSA private key parameter. + * + * @param {buffer} [key.dq] RSA private key parameter. + * + * @param {buffer} [key.qi] RSA private key parameter. + * + * @param {buffer} [key.p] RSA secret prime. + * + * @param {buffer} [key.q] RSA secret prime, with p < q. + * + * @param {buffer} [key.k] Symmetric key. + * + * @param {buffer} [key.t] HSM Token, used with 'Bring Your Own Key'. + * + * @param {string} [key.crv] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' + * + * @param {buffer} [key.x] X component of an EC public key. + * + * @param {buffer} [key.y] Y component of an EC public key. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.hsm] Whether to import as a hardware key (HSM) or + * software key. + * + * @param {object} [options.keyAttributes] The key management attributes. + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {KeyBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + importKey(vaultBaseUrl, keyName, key, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._importKey(vaultBaseUrl, keyName, key, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._importKey(vaultBaseUrl, keyName, key, options, optionalCallback); + } + } + + /** + * @summary Deletes a key of any type from storage in Azure Key Vault. + * + * The delete key operation cannot be used to remove individual versions of a + * key. This operation removes the cryptographic material associated with the + * key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or + * Encrypt/Decrypt operations. This operation requires the keys/delete + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteKeyWithHttpOperationResponse(vaultBaseUrl, keyName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._deleteKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a key of any type from storage in Azure Key Vault. + * + * The delete key operation cannot be used to remove individual versions of a + * key. This operation removes the cryptographic material associated with the + * key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or + * Encrypt/Decrypt operations. This operation requires the keys/delete + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeletedKeyBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedKeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteKey(vaultBaseUrl, keyName, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteKey(vaultBaseUrl, keyName, options, optionalCallback); + } + } + + /** + * @summary The update key operation changes specified attributes of a stored + * key and can be applied to any key type and key version stored in Azure Key + * Vault. + * + * In order to perform this operation, the key must already exist in the Key + * Vault. Note: The cryptographic material of a key itself cannot be changed. + * This operation requires the keys/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of key to update. + * + * @param {string} keyVersion The version of the key to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.keyOps] Json web key operations. For more + * information on possible key operations, see JsonWebKeyOperation. + * + * @param {object} [options.keyAttributes] + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateKeyWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._updateKey(vaultBaseUrl, keyName, keyVersion, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary The update key operation changes specified attributes of a stored + * key and can be applied to any key type and key version stored in Azure Key + * Vault. + * + * In order to perform this operation, the key must already exist in the Key + * Vault. Note: The cryptographic material of a key itself cannot be changed. + * This operation requires the keys/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of key to update. + * + * @param {string} keyVersion The version of the key to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.keyOps] Json web key operations. For more + * information on possible key operations, see JsonWebKeyOperation. + * + * @param {object} [options.keyAttributes] + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {KeyBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateKey(vaultBaseUrl, keyName, keyVersion, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updateKey(vaultBaseUrl, keyName, keyVersion, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateKey(vaultBaseUrl, keyName, keyVersion, options, optionalCallback); + } + } + + /** + * @summary Gets the public part of a stored key. + * + * The get key operation is applicable to all key types. If the requested key + * is symmetric, then no key material is released in the response. This + * operation requires the keys/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key to get. + * + * @param {string} keyVersion Adding the version parameter retrieves a specific + * version of a key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getKeyWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getKey(vaultBaseUrl, keyName, keyVersion, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the public part of a stored key. + * + * The get key operation is applicable to all key types. If the requested key + * is symmetric, then no key material is released in the response. This + * operation requires the keys/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key to get. + * + * @param {string} keyVersion Adding the version parameter retrieves a specific + * version of a key. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {KeyBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getKey(vaultBaseUrl, keyName, keyVersion, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; } - if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { - this.generateClientRequestId = options.generateClientRequestId; + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getKey(vaultBaseUrl, keyName, keyVersion, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getKey(vaultBaseUrl, keyName, keyVersion, options, optionalCallback); } - this.models = models; - this._createKey = _createKey; - this._importKey = _importKey; - this._deleteKey = _deleteKey; - this._updateKey = _updateKey; - this._getKey = _getKey; - this._getKeyVersions = _getKeyVersions; - this._getKeys = _getKeys; - this._backupKey = _backupKey; - this._restoreKey = _restoreKey; - this._encrypt = _encrypt; - this._decrypt = _decrypt; - this._sign = _sign; - this._verify = _verify; - this._wrapKey = _wrapKey; - this._unwrapKey = _unwrapKey; - this._getDeletedKeys = _getDeletedKeys; - this._getDeletedKey = _getDeletedKey; - this._purgeDeletedKey = _purgeDeletedKey; - this._recoverDeletedKey = _recoverDeletedKey; - this._setSecret = _setSecret; - this._deleteSecret = _deleteSecret; - this._updateSecret = _updateSecret; - this._getSecret = _getSecret; - this._getSecrets = _getSecrets; - this._getSecretVersions = _getSecretVersions; - this._getDeletedSecrets = _getDeletedSecrets; - this._getDeletedSecret = _getDeletedSecret; - this._purgeDeletedSecret = _purgeDeletedSecret; - this._recoverDeletedSecret = _recoverDeletedSecret; - this._backupSecret = _backupSecret; - this._restoreSecret = _restoreSecret; - this._getCertificates = _getCertificates; - this._deleteCertificate = _deleteCertificate; - this._setCertificateContacts = _setCertificateContacts; - this._getCertificateContacts = _getCertificateContacts; - this._deleteCertificateContacts = _deleteCertificateContacts; - this._getCertificateIssuers = _getCertificateIssuers; - this._setCertificateIssuer = _setCertificateIssuer; - this._updateCertificateIssuer = _updateCertificateIssuer; - this._getCertificateIssuer = _getCertificateIssuer; - this._deleteCertificateIssuer = _deleteCertificateIssuer; - this._createCertificate = _createCertificate; - this._importCertificate = _importCertificate; - this._getCertificateVersions = _getCertificateVersions; - this._getCertificatePolicy = _getCertificatePolicy; - this._updateCertificatePolicy = _updateCertificatePolicy; - this._updateCertificate = _updateCertificate; - this._getCertificate = _getCertificate; - this._updateCertificateOperation = _updateCertificateOperation; - this._getCertificateOperation = _getCertificateOperation; - this._deleteCertificateOperation = _deleteCertificateOperation; - this._mergeCertificate = _mergeCertificate; - this._getDeletedCertificates = _getDeletedCertificates; - this._getDeletedCertificate = _getDeletedCertificate; - this._purgeDeletedCertificate = _purgeDeletedCertificate; - this._recoverDeletedCertificate = _recoverDeletedCertificate; - this._getStorageAccounts = _getStorageAccounts; - this._deleteStorageAccount = _deleteStorageAccount; - this._getStorageAccount = _getStorageAccount; - this._setStorageAccount = _setStorageAccount; - this._updateStorageAccount = _updateStorageAccount; - this._regenerateStorageAccountKey = _regenerateStorageAccountKey; - this._getSasDefinitions = _getSasDefinitions; - this._deleteSasDefinition = _deleteSasDefinition; - this._getSasDefinition = _getSasDefinition; - this._setSasDefinition = _setSasDefinition; - this._updateSasDefinition = _updateSasDefinition; - this._getKeyVersionsNext = _getKeyVersionsNext; - this._getKeysNext = _getKeysNext; - this._getDeletedKeysNext = _getDeletedKeysNext; - this._getSecretsNext = _getSecretsNext; - this._getSecretVersionsNext = _getSecretVersionsNext; - this._getDeletedSecretsNext = _getDeletedSecretsNext; - this._getCertificatesNext = _getCertificatesNext; - this._getCertificateIssuersNext = _getCertificateIssuersNext; - this._getCertificateVersionsNext = _getCertificateVersionsNext; - this._getDeletedCertificatesNext = _getDeletedCertificatesNext; - this._getStorageAccountsNext = _getStorageAccountsNext; - this._getSasDefinitionsNext = _getSasDefinitionsNext; - msRest.addSerializationMixin(this); } /** - * @summary Creates a new key, stores it, then returns key parameters and - * attributes to the client. + * @summary Retrieves a list of individual key versions with the same key name. * - * The create key operation can be used to create any key type in Azure Key - * Vault. If the named key already exists, Azure Key Vault creates a new - * version of the key. It requires the keys/create permission. + * The full key identifier, attributes, and tags are provided in the response. + * This operation requires the keys/list permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name for the new key. The system will generate - * the version name for the new key. + * @param {string} keyName The name of the key. * - * @param {string} kty The type of key to create. For valid values, see - * JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', - * 'oct' + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getKeyVersionsWithHttpOperationResponse(vaultBaseUrl, keyName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getKeyVersions(vaultBaseUrl, keyName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Retrieves a list of individual key versions with the same key name. + * + * The full key identifier, attributes, and tags are provided in the response. + * This operation requires the keys/list permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} keyName The name of the key. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.keySize] The key size in bits. For example: 2048, - * 3072, or 4096 for RSA. + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. * - * @param {array} [options.keyOps] + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [options.keyAttributes] + * @param {function} [optionalCallback] - The optional callback. * - * @param {boolean} [options.keyAttributes.enabled] Determines whether the - * object is enabled. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * {Promise} A promise is returned * - * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * @resolve {KeyListResult} - The deserialized result object. * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. + * @reject {Error} - The error object. * - * @param {string} [options.curve] Elliptic curve name. For valid values, see - * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', - * 'SECP256K1' + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link KeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getKeyVersions(vaultBaseUrl, keyName, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getKeyVersions(vaultBaseUrl, keyName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getKeyVersions(vaultBaseUrl, keyName, options, optionalCallback); + } + } + + /** + * @summary List keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a stored key. The LIST operation is + * applicable to all key types, however only the base key identifier, + * attributes, and tags are provided in the response. Individual versions of a + * key are not listed in the response. This operation requires the keys/list + * permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createKeyWithHttpOperationResponse(vaultBaseUrl, keyName, kty, options) { + getKeysWithHttpOperationResponse(vaultBaseUrl, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._createKey(vaultBaseUrl, keyName, kty, options, (err, result, request, response) => { + self._getKeys(vaultBaseUrl, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -13552,45 +16421,22 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Creates a new key, stores it, then returns key parameters and - * attributes to the client. + * @summary List keys in the specified vault. * - * The create key operation can be used to create any key type in Azure Key - * Vault. If the named key already exists, Azure Key Vault creates a new - * version of the key. It requires the keys/create permission. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a stored key. The LIST operation is + * applicable to all key types, however only the base key identifier, + * attributes, and tags are provided in the response. Individual versions of a + * key are not listed in the response. This operation requires the keys/list + * permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name for the new key. The system will generate - * the version name for the new key. - * - * @param {string} kty The type of key to create. For valid values, see - * JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', - * 'oct' - * * @param {object} [options] Optional Parameters. * - * @param {number} [options.keySize] The key size in bits. For example: 2048, - * 3072, or 4096 for RSA. - * - * @param {array} [options.keyOps] - * - * @param {object} [options.keyAttributes] - * - * @param {boolean} [options.keyAttributes.enabled] Determines whether the - * object is enabled. - * - * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. - * - * @param {date} [options.keyAttributes.expires] Expiry date in UTC. - * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. - * - * @param {string} [options.curve] Elliptic curve name. For valid values, see - * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', - * 'SECP256K1' + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -13602,7 +16448,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {KeyBundle} - The deserialized result object. + * @resolve {KeyListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -13611,13 +16457,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link KeyBundle} for more information. + * See {@link KeyListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createKey(vaultBaseUrl, keyName, kty, options, optionalCallback) { + getKeys(vaultBaseUrl, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -13626,99 +16472,56 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createKey(vaultBaseUrl, keyName, kty, options, (err, result, request, response) => { + self._getKeys(vaultBaseUrl, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createKey(vaultBaseUrl, keyName, kty, options, optionalCallback); + return self._getKeys(vaultBaseUrl, options, optionalCallback); } } /** - * @summary Imports an externally created key, stores it, and returns key - * parameters and attributes to the client. + * @summary Requests that a backup of the specified key be downloaded to the + * client. * - * The import key operation may be used to import any key type into an Azure - * Key Vault. If the named key already exists, Azure Key Vault creates a new - * version of the key. This operation requires the keys/import permission. + * The Key Backup operation exports a key from Azure Key Vault in a protected + * form. Note that this operation does NOT return key material in a form that + * can be used outside the Azure Key Vault system, the returned key material is + * either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The + * intent of this operation is to allow a client to GENERATE a key in one Azure + * Key Vault instance, BACKUP the key, and then RESTORE it into another Azure + * Key Vault instance. The BACKUP operation may be used to export, in protected + * form, any key type from Azure Key Vault. Individual versions of a key cannot + * be backed up. BACKUP / RESTORE can be performed within geographical + * boundaries only; meaning that a BACKUP from one geographical area cannot be + * restored to another geographical area. For example, a backup from the US + * geographical area cannot be restored in an EU geographical area. This + * operation requires the key/backup permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName Name for the imported key. - * - * @param {object} key The Json web key - * - * @param {string} [key.kid] Key identifier. - * - * @param {string} [key.kty] JsonWebKey key type (kty). Possible values - * include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' - * - * @param {array} [key.keyOps] - * - * @param {buffer} [key.n] RSA modulus. - * - * @param {buffer} [key.e] RSA public exponent. - * - * @param {buffer} [key.d] RSA private exponent, or the D component of an EC - * private key. - * - * @param {buffer} [key.dp] RSA private key parameter. - * - * @param {buffer} [key.dq] RSA private key parameter. - * - * @param {buffer} [key.qi] RSA private key parameter. - * - * @param {buffer} [key.p] RSA secret prime. - * - * @param {buffer} [key.q] RSA secret prime, with p < q. - * - * @param {buffer} [key.k] Symmetric key. - * - * @param {buffer} [key.t] HSM Token, used with 'Bring Your Own Key'. - * - * @param {string} [key.crv] Elliptic curve name. For valid values, see - * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', - * 'SECP256K1' - * - * @param {buffer} [key.x] X component of an EC public key. - * - * @param {buffer} [key.y] Y component of an EC public key. + * @param {string} keyName The name of the key. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.hsm] Whether to import as a hardware key (HSM) or - * software key. - * - * @param {object} [options.keyAttributes] The key management attributes. - * - * @param {boolean} [options.keyAttributes.enabled] Determines whether the - * object is enabled. - * - * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. - * - * @param {date} [options.keyAttributes.expires] Expiry date in UTC. - * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - importKeyWithHttpOperationResponse(vaultBaseUrl, keyName, key, options) { + backupKeyWithHttpOperationResponse(vaultBaseUrl, keyName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._importKey(vaultBaseUrl, keyName, key, options, (err, result, request, response) => { + self._backupKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -13729,73 +16532,30 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Imports an externally created key, stores it, and returns key - * parameters and attributes to the client. + * @summary Requests that a backup of the specified key be downloaded to the + * client. * - * The import key operation may be used to import any key type into an Azure - * Key Vault. If the named key already exists, Azure Key Vault creates a new - * version of the key. This operation requires the keys/import permission. + * The Key Backup operation exports a key from Azure Key Vault in a protected + * form. Note that this operation does NOT return key material in a form that + * can be used outside the Azure Key Vault system, the returned key material is + * either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The + * intent of this operation is to allow a client to GENERATE a key in one Azure + * Key Vault instance, BACKUP the key, and then RESTORE it into another Azure + * Key Vault instance. The BACKUP operation may be used to export, in protected + * form, any key type from Azure Key Vault. Individual versions of a key cannot + * be backed up. BACKUP / RESTORE can be performed within geographical + * boundaries only; meaning that a BACKUP from one geographical area cannot be + * restored to another geographical area. For example, a backup from the US + * geographical area cannot be restored in an EU geographical area. This + * operation requires the key/backup permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName Name for the imported key. - * - * @param {object} key The Json web key - * - * @param {string} [key.kid] Key identifier. - * - * @param {string} [key.kty] JsonWebKey key type (kty). Possible values - * include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' - * - * @param {array} [key.keyOps] - * - * @param {buffer} [key.n] RSA modulus. - * - * @param {buffer} [key.e] RSA public exponent. - * - * @param {buffer} [key.d] RSA private exponent, or the D component of an EC - * private key. - * - * @param {buffer} [key.dp] RSA private key parameter. - * - * @param {buffer} [key.dq] RSA private key parameter. - * - * @param {buffer} [key.qi] RSA private key parameter. - * - * @param {buffer} [key.p] RSA secret prime. - * - * @param {buffer} [key.q] RSA secret prime, with p < q. - * - * @param {buffer} [key.k] Symmetric key. - * - * @param {buffer} [key.t] HSM Token, used with 'Bring Your Own Key'. - * - * @param {string} [key.crv] Elliptic curve name. For valid values, see - * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', - * 'SECP256K1' - * - * @param {buffer} [key.x] X component of an EC public key. - * - * @param {buffer} [key.y] Y component of an EC public key. + * @param {string} keyName The name of the key. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.hsm] Whether to import as a hardware key (HSM) or - * software key. - * - * @param {object} [options.keyAttributes] The key management attributes. - * - * @param {boolean} [options.keyAttributes.enabled] Determines whether the - * object is enabled. - * - * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. - * - * @param {date} [options.keyAttributes.expires] Expiry date in UTC. - * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -13806,7 +16566,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {KeyBundle} - The deserialized result object. + * @resolve {BackupKeyResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -13815,13 +16575,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link KeyBundle} for more information. + * See {@link BackupKeyResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - importKey(vaultBaseUrl, keyName, key, options, optionalCallback) { + backupKey(vaultBaseUrl, keyName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -13830,30 +16590,39 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._importKey(vaultBaseUrl, keyName, key, options, (err, result, request, response) => { + self._backupKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._importKey(vaultBaseUrl, keyName, key, options, optionalCallback); + return self._backupKey(vaultBaseUrl, keyName, options, optionalCallback); } } /** - * @summary Deletes a key of any type from storage in Azure Key Vault. + * @summary Restores a backed up key to a vault. * - * The delete key operation cannot be used to remove individual versions of a - * key. This operation removes the cryptographic material associated with the - * key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or - * Encrypt/Decrypt operations. This operation requires the keys/delete - * permission. + * Imports a previously backed up key into Azure Key Vault, restoring the key, + * its key identifier, attributes and access control policies. The RESTORE + * operation may be used to import a previously backed up key. Individual + * versions of a key cannot be restored. The key is restored in its entirety + * with the same key name as it had when it was backed up. If the key name is + * not available in the target Key Vault, the RESTORE operation will be + * rejected. While the key name is retained during restore, the final key + * identifier will change if the key is restored to a different vault. Restore + * will restore all versions and preserve version identifiers. The RESTORE + * operation is subject to security constraints: The target Key Vault must be + * owned by the same Microsoft Azure Subscription as the source Key Vault The + * user must have RESTORE permission in the target Key Vault. This operation + * requires the keys/restore permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of the key to delete. + * @param {buffer} keyBundleBackup The backup blob associated with a key + * bundle. * * @param {object} [options] Optional Parameters. * @@ -13862,15 +16631,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteKeyWithHttpOperationResponse(vaultBaseUrl, keyName, options) { + restoreKeyWithHttpOperationResponse(vaultBaseUrl, keyBundleBackup, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deleteKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { + self._restoreKey(vaultBaseUrl, keyBundleBackup, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -13881,18 +16650,27 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Deletes a key of any type from storage in Azure Key Vault. + * @summary Restores a backed up key to a vault. * - * The delete key operation cannot be used to remove individual versions of a - * key. This operation removes the cryptographic material associated with the - * key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or - * Encrypt/Decrypt operations. This operation requires the keys/delete - * permission. + * Imports a previously backed up key into Azure Key Vault, restoring the key, + * its key identifier, attributes and access control policies. The RESTORE + * operation may be used to import a previously backed up key. Individual + * versions of a key cannot be restored. The key is restored in its entirety + * with the same key name as it had when it was backed up. If the key name is + * not available in the target Key Vault, the RESTORE operation will be + * rejected. While the key name is retained during restore, the final key + * identifier will change if the key is restored to a different vault. Restore + * will restore all versions and preserve version identifiers. The RESTORE + * operation is subject to security constraints: The target Key Vault must be + * owned by the same Microsoft Azure Subscription as the source Key Vault The + * user must have RESTORE permission in the target Key Vault. This operation + * requires the keys/restore permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of the key to delete. + * @param {buffer} keyBundleBackup The backup blob associated with a key + * bundle. * * @param {object} [options] Optional Parameters. * @@ -13906,7 +16684,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {DeletedKeyBundle} - The deserialized result object. + * @resolve {KeyBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -13915,13 +16693,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeletedKeyBundle} for more information. + * See {@link KeyBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteKey(vaultBaseUrl, keyName, options, optionalCallback) { + restoreKey(vaultBaseUrl, keyBundleBackup, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -13930,64 +16708,60 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { + self._restoreKey(vaultBaseUrl, keyBundleBackup, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteKey(vaultBaseUrl, keyName, options, optionalCallback); + return self._restoreKey(vaultBaseUrl, keyBundleBackup, options, optionalCallback); } } /** - * @summary The update key operation changes specified attributes of a stored - * key and can be applied to any key type and key version stored in Azure Key - * Vault. + * @summary Encrypts an arbitrary sequence of bytes using an encryption key + * that is stored in a key vault. * - * In order to perform this operation, the key must already exist in the Key - * Vault. Note: The cryptographic material of a key itself cannot be changed. - * This operation requires the keys/update permission. + * The ENCRYPT operation encrypts an arbitrary sequence of bytes using an + * encryption key that is stored in Azure Key Vault. Note that the ENCRYPT + * operation only supports a single block of data, the size of which is + * dependent on the target key and the encryption algorithm to be used. The + * ENCRYPT operation is only strictly necessary for symmetric keys stored in + * Azure Key Vault since protection with an asymmetric key can be performed + * using public portion of the key. This operation is supported for asymmetric + * keys as a convenience for callers that have a key-reference but do not have + * access to the public key material. This operation requires the keys/encypt + * permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of key to update. - * - * @param {string} keyVersion The version of the key to update. - * - * @param {object} [options] Optional Parameters. - * - * @param {array} [options.keyOps] Json web key operations. For more - * information on possible key operations, see JsonWebKeyOperation. - * - * @param {object} [options.keyAttributes] + * @param {string} keyName The name of the key. * - * @param {boolean} [options.keyAttributes.enabled] Determines whether the - * object is enabled. + * @param {string} keyVersion The version of the key. * - * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' * - * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * @param {buffer} value * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - updateKeyWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, options) { + encryptWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, algorithm, value, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._updateKey(vaultBaseUrl, keyName, keyVersion, options, (err, result, request, response) => { + self._encrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -13998,37 +16772,33 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary The update key operation changes specified attributes of a stored - * key and can be applied to any key type and key version stored in Azure Key - * Vault. + * @summary Encrypts an arbitrary sequence of bytes using an encryption key + * that is stored in a key vault. * - * In order to perform this operation, the key must already exist in the Key - * Vault. Note: The cryptographic material of a key itself cannot be changed. - * This operation requires the keys/update permission. + * The ENCRYPT operation encrypts an arbitrary sequence of bytes using an + * encryption key that is stored in Azure Key Vault. Note that the ENCRYPT + * operation only supports a single block of data, the size of which is + * dependent on the target key and the encryption algorithm to be used. The + * ENCRYPT operation is only strictly necessary for symmetric keys stored in + * Azure Key Vault since protection with an asymmetric key can be performed + * using public portion of the key. This operation is supported for asymmetric + * keys as a convenience for callers that have a key-reference but do not have + * access to the public key material. This operation requires the keys/encypt + * permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of key to update. - * - * @param {string} keyVersion The version of the key to update. - * - * @param {object} [options] Optional Parameters. - * - * @param {array} [options.keyOps] Json web key operations. For more - * information on possible key operations, see JsonWebKeyOperation. - * - * @param {object} [options.keyAttributes] + * @param {string} keyName The name of the key. * - * @param {boolean} [options.keyAttributes.enabled] Determines whether the - * object is enabled. + * @param {string} keyVersion The version of the key. * - * @param {date} [options.keyAttributes.notBefore] Not before date in UTC. + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' * - * @param {date} [options.keyAttributes.expires] Expiry date in UTC. + * @param {buffer} value * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14040,7 +16810,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {KeyBundle} - The deserialized result object. + * @resolve {KeyOperationResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -14049,13 +16819,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link KeyBundle} for more information. + * See {@link KeyOperationResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - updateKey(vaultBaseUrl, keyName, keyVersion, options, optionalCallback) { + encrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -14064,31 +16834,39 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateKey(vaultBaseUrl, keyName, keyVersion, options, (err, result, request, response) => { + self._encrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateKey(vaultBaseUrl, keyName, keyVersion, options, optionalCallback); + return self._encrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback); } } /** - * @summary Gets the public part of a stored key. + * @summary Decrypts a single block of encrypted data. * - * The get key operation is applicable to all key types. If the requested key - * is symmetric, then no key material is released in the response. This - * operation requires the keys/get permission. + * The DECRYPT operation decrypts a well-formed block of ciphertext using the + * target encryption key and specified algorithm. This operation is the reverse + * of the ENCRYPT operation; only a single block of data may be decrypted, the + * size of this block is dependent on the target key and the algorithm to be + * used. The DECRYPT operation applies to asymmetric and symmetric keys stored + * in Azure Key Vault since it uses the private portion of the key. This + * operation requires the keys/decrypt permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of the key to get. + * @param {string} keyName The name of the key. * - * @param {string} keyVersion Adding the version parameter retrieves a specific - * version of a key. + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value * * @param {object} [options] Optional Parameters. * @@ -14097,15 +16875,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getKeyWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, options) { + decryptWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, algorithm, value, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getKey(vaultBaseUrl, keyName, keyVersion, options, (err, result, request, response) => { + self._decrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -14116,19 +16894,27 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Gets the public part of a stored key. + * @summary Decrypts a single block of encrypted data. * - * The get key operation is applicable to all key types. If the requested key - * is symmetric, then no key material is released in the response. This - * operation requires the keys/get permission. + * The DECRYPT operation decrypts a well-formed block of ciphertext using the + * target encryption key and specified algorithm. This operation is the reverse + * of the ENCRYPT operation; only a single block of data may be decrypted, the + * size of this block is dependent on the target key and the algorithm to be + * used. The DECRYPT operation applies to asymmetric and symmetric keys stored + * in Azure Key Vault since it uses the private portion of the key. This + * operation requires the keys/decrypt permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of the key to get. + * @param {string} keyName The name of the key. * - * @param {string} keyVersion Adding the version parameter retrieves a specific - * version of a key. + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value * * @param {object} [options] Optional Parameters. * @@ -14142,7 +16928,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {KeyBundle} - The deserialized result object. + * @resolve {KeyOperationResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -14151,13 +16937,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link KeyBundle} for more information. + * See {@link KeyOperationResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getKey(vaultBaseUrl, keyName, keyVersion, options, optionalCallback) { + decrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -14166,47 +16952,55 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getKey(vaultBaseUrl, keyName, keyVersion, options, (err, result, request, response) => { + self._decrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getKey(vaultBaseUrl, keyName, keyVersion, options, optionalCallback); + return self._decrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback); } } /** - * @summary Retrieves a list of individual key versions with the same key name. + * @summary Creates a signature from a digest using the specified key. * - * The full key identifier, attributes, and tags are provided in the response. - * This operation requires the keys/list permission. + * The SIGN operation is applicable to asymmetric and symmetric keys stored in + * Azure Key Vault since this operation uses the private portion of the key. + * This operation requires the keys/sign permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} keyName The name of the key. * - * @param {object} [options] Optional Parameters. + * @param {string} keyVersion The version of the key. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. + * @param {string} algorithm The signing/verification algorithm identifier. For + * more information on possible algorithm types, see + * JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', + * 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', + * 'ES256K' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getKeyVersionsWithHttpOperationResponse(vaultBaseUrl, keyName, options) { + signWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, algorithm, value, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getKeyVersions(vaultBaseUrl, keyName, options, (err, result, request, response) => { + self._sign(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -14217,20 +17011,28 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Retrieves a list of individual key versions with the same key name. + * @summary Creates a signature from a digest using the specified key. * - * The full key identifier, attributes, and tags are provided in the response. - * This operation requires the keys/list permission. + * The SIGN operation is applicable to asymmetric and symmetric keys stored in + * Azure Key Vault since this operation uses the private portion of the key. + * This operation requires the keys/sign permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} keyName The name of the key. * - * @param {object} [options] Optional Parameters. + * @param {string} keyVersion The version of the key. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. + * @param {string} algorithm The signing/verification algorithm identifier. For + * more information on possible algorithm types, see + * JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', + * 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', + * 'ES256K' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14242,7 +17044,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {KeyListResult} - The deserialized result object. + * @resolve {KeyOperationResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -14251,13 +17053,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link KeyListResult} for more information. + * See {@link KeyOperationResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getKeyVersions(vaultBaseUrl, keyName, options, optionalCallback) { + sign(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -14266,49 +17068,59 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getKeyVersions(vaultBaseUrl, keyName, options, (err, result, request, response) => { + self._sign(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getKeyVersions(vaultBaseUrl, keyName, options, optionalCallback); + return self._sign(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback); } } /** - * @summary List keys in the specified vault. + * @summary Verifies a signature using a specified key. * - * Retrieves a list of the keys in the Key Vault as JSON Web Key structures - * that contain the public part of a stored key. The LIST operation is - * applicable to all key types, however only the base key identifier, - * attributes, and tags are provided in the response. Individual versions of a - * key are not listed in the response. This operation requires the keys/list - * permission. + * The VERIFY operation is applicable to symmetric keys stored in Azure Key + * Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure + * Key Vault since signature verification can be performed using the public + * portion of the key but this operation is supported as a convenience for + * callers that only have a key-reference and not the public portion of the + * key. This operation requires the keys/verify permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {object} [options] Optional Parameters. + * @param {string} keyName The name of the key. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm The signing/verification algorithm. For more + * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. + * Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', + * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * + * @param {buffer} digest The digest used for signing. + * + * @param {buffer} signature The signature to be verified. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getKeysWithHttpOperationResponse(vaultBaseUrl, options) { + verifyWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getKeys(vaultBaseUrl, options, (err, result, request, response) => { + self._verify(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -14319,22 +17131,32 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary List keys in the specified vault. + * @summary Verifies a signature using a specified key. * - * Retrieves a list of the keys in the Key Vault as JSON Web Key structures - * that contain the public part of a stored key. The LIST operation is - * applicable to all key types, however only the base key identifier, - * attributes, and tags are provided in the response. Individual versions of a - * key are not listed in the response. This operation requires the keys/list - * permission. + * The VERIFY operation is applicable to symmetric keys stored in Azure Key + * Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure + * Key Vault since signature verification can be performed using the public + * portion of the key but this operation is supported as a convenience for + * callers that only have a key-reference and not the public portion of the + * key. This operation requires the keys/verify permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {object} [options] Optional Parameters. + * @param {string} keyName The name of the key. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm The signing/verification algorithm. For more + * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. + * Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', + * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' + * + * @param {buffer} digest The digest used for signing. + * + * @param {buffer} signature The signature to be verified. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -14346,7 +17168,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {KeyListResult} - The deserialized result object. + * @resolve {KeyVerifyResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -14355,13 +17177,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link KeyListResult} for more information. + * See {@link KeyVerifyResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getKeys(vaultBaseUrl, options, optionalCallback) { + verify(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -14370,40 +17192,41 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getKeys(vaultBaseUrl, options, (err, result, request, response) => { + self._verify(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getKeys(vaultBaseUrl, options, optionalCallback); + return self._verify(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature, options, optionalCallback); } } /** - * @summary Requests that a backup of the specified key be downloaded to the - * client. + * @summary Wraps a symmetric key using a specified key. * - * The Key Backup operation exports a key from Azure Key Vault in a protected - * form. Note that this operation does NOT return key material in a form that - * can be used outside the Azure Key Vault system, the returned key material is - * either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The - * intent of this operation is to allow a client to GENERATE a key in one Azure - * Key Vault instance, BACKUP the key, and then RESTORE it into another Azure - * Key Vault instance. The BACKUP operation may be used to export, in protected - * form, any key type from Azure Key Vault. Individual versions of a key cannot - * be backed up. BACKUP / RESTORE can be performed within geographical - * boundaries only; meaning that a BACKUP from one geographical area cannot be - * restored to another geographical area. For example, a backup from the US - * geographical area cannot be restored in an EU geographical area. This - * operation requires the key/backup permission. + * The WRAP operation supports encryption of a symmetric key using a key + * encryption key that has previously been stored in an Azure Key Vault. The + * WRAP operation is only strictly necessary for symmetric keys stored in Azure + * Key Vault since protection with an asymmetric key can be performed using the + * public portion of the key. This operation is supported for asymmetric keys + * as a convenience for callers that have a key-reference but do not have + * access to the public key material. This operation requires the keys/wrapKey + * permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} keyName The name of the key. * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -14411,15 +17234,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - backupKeyWithHttpOperationResponse(vaultBaseUrl, keyName, options) { + wrapKeyWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, algorithm, value, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._backupKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { + self._wrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -14430,28 +17253,29 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Requests that a backup of the specified key be downloaded to the - * client. + * @summary Wraps a symmetric key using a specified key. * - * The Key Backup operation exports a key from Azure Key Vault in a protected - * form. Note that this operation does NOT return key material in a form that - * can be used outside the Azure Key Vault system, the returned key material is - * either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The - * intent of this operation is to allow a client to GENERATE a key in one Azure - * Key Vault instance, BACKUP the key, and then RESTORE it into another Azure - * Key Vault instance. The BACKUP operation may be used to export, in protected - * form, any key type from Azure Key Vault. Individual versions of a key cannot - * be backed up. BACKUP / RESTORE can be performed within geographical - * boundaries only; meaning that a BACKUP from one geographical area cannot be - * restored to another geographical area. For example, a backup from the US - * geographical area cannot be restored in an EU geographical area. This - * operation requires the key/backup permission. + * The WRAP operation supports encryption of a symmetric key using a key + * encryption key that has previously been stored in an Azure Key Vault. The + * WRAP operation is only strictly necessary for symmetric keys stored in Azure + * Key Vault since protection with an asymmetric key can be performed using the + * public portion of the key. This operation is supported for asymmetric keys + * as a convenience for callers that have a key-reference but do not have + * access to the public key material. This operation requires the keys/wrapKey + * permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} keyName The name of the key. * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -14464,7 +17288,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {BackupKeyResult} - The deserialized result object. + * @resolve {KeyOperationResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -14473,13 +17297,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link BackupKeyResult} for more information. + * See {@link KeyOperationResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - backupKey(vaultBaseUrl, keyName, options, optionalCallback) { + wrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -14488,39 +17312,38 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._backupKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { + self._wrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._backupKey(vaultBaseUrl, keyName, options, optionalCallback); + return self._wrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback); } } /** - * @summary Restores a backed up key to a vault. + * @summary Unwraps a symmetric key using the specified key that was initially + * used for wrapping that key. * - * Imports a previously backed up key into Azure Key Vault, restoring the key, - * its key identifier, attributes and access control policies. The RESTORE - * operation may be used to import a previously backed up key. Individual - * versions of a key cannot be restored. The key is restored in its entirety - * with the same key name as it had when it was backed up. If the key name is - * not available in the target Key Vault, the RESTORE operation will be - * rejected. While the key name is retained during restore, the final key - * identifier will change if the key is restored to a different vault. Restore - * will restore all versions and preserve version identifiers. The RESTORE - * operation is subject to security constraints: The target Key Vault must be - * owned by the same Microsoft Azure Subscription as the source Key Vault The - * user must have RESTORE permission in the target Key Vault. This operation - * requires the keys/restore permission. + * The UNWRAP operation supports decryption of a symmetric key using the target + * key encryption key. This operation is the reverse of the WRAP operation. The + * UNWRAP operation applies to asymmetric and symmetric keys stored in Azure + * Key Vault since it uses the private portion of the key. This operation + * requires the keys/unwrapKey permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {buffer} keyBundleBackup The backup blob associated with a key - * bundle. + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value * * @param {object} [options] Optional Parameters. * @@ -14529,15 +17352,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - restoreKeyWithHttpOperationResponse(vaultBaseUrl, keyBundleBackup, options) { + unwrapKeyWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, algorithm, value, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._restoreKey(vaultBaseUrl, keyBundleBackup, options, (err, result, request, response) => { + self._unwrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -14548,27 +17371,26 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Restores a backed up key to a vault. + * @summary Unwraps a symmetric key using the specified key that was initially + * used for wrapping that key. * - * Imports a previously backed up key into Azure Key Vault, restoring the key, - * its key identifier, attributes and access control policies. The RESTORE - * operation may be used to import a previously backed up key. Individual - * versions of a key cannot be restored. The key is restored in its entirety - * with the same key name as it had when it was backed up. If the key name is - * not available in the target Key Vault, the RESTORE operation will be - * rejected. While the key name is retained during restore, the final key - * identifier will change if the key is restored to a different vault. Restore - * will restore all versions and preserve version identifiers. The RESTORE - * operation is subject to security constraints: The target Key Vault must be - * owned by the same Microsoft Azure Subscription as the source Key Vault The - * user must have RESTORE permission in the target Key Vault. This operation - * requires the keys/restore permission. + * The UNWRAP operation supports decryption of a symmetric key using the target + * key encryption key. This operation is the reverse of the WRAP operation. The + * UNWRAP operation applies to asymmetric and symmetric keys stored in Azure + * Key Vault since it uses the private portion of the key. This operation + * requires the keys/unwrapKey permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {buffer} keyBundleBackup The backup blob associated with a key - * bundle. + * @param {string} keyName The name of the key. + * + * @param {string} keyVersion The version of the key. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * + * @param {buffer} value * * @param {object} [options] Optional Parameters. * @@ -14582,7 +17404,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {KeyBundle} - The deserialized result object. + * @resolve {KeyOperationResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -14591,13 +17413,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link KeyBundle} for more information. + * See {@link KeyOperationResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - restoreKey(vaultBaseUrl, keyBundleBackup, options, optionalCallback) { + unwrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -14606,98 +17428,76 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._restoreKey(vaultBaseUrl, keyBundleBackup, options, (err, result, request, response) => { + self._unwrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._restoreKey(vaultBaseUrl, keyBundleBackup, options, optionalCallback); + return self._unwrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback); } } /** - * @summary Encrypts an arbitrary sequence of bytes using an encryption key - * that is stored in a key vault. + * @summary Lists the deleted keys in the specified vault. * - * The ENCRYPT operation encrypts an arbitrary sequence of bytes using an - * encryption key that is stored in Azure Key Vault. Note that the ENCRYPT - * operation only supports a single block of data, the size of which is - * dependent on the target key and the encryption algorithm to be used. The - * ENCRYPT operation is only strictly necessary for symmetric keys stored in - * Azure Key Vault since protection with an asymmetric key can be performed - * using public portion of the key. This operation is supported for asymmetric - * keys as a convenience for callers that have a key-reference but do not have - * access to the public key material. This operation requires the keys/encypt - * permission. + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a deleted key. This operation includes + * deletion-specific information. The Get Deleted Keys operation is applicable + * for vaults enabled for soft-delete. While the operation can be invoked on + * any vault, it will return an error if invoked on a non soft-delete enabled + * vault. This operation requires the keys/list permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of the key. - * - * @param {string} keyVersion The version of the key. - * - * @param {string} algorithm algorithm identifier. Possible values include: - * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' - * - * @param {buffer} value - * * @param {object} [options] Optional Parameters. * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - encryptWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, algorithm, value, options) { + getDeletedKeysWithHttpOperationResponse(vaultBaseUrl, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._encrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { + self._getDeletedKeys(vaultBaseUrl, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } return; - }); - }); - } - - /** - * @summary Encrypts an arbitrary sequence of bytes using an encryption key - * that is stored in a key vault. - * - * The ENCRYPT operation encrypts an arbitrary sequence of bytes using an - * encryption key that is stored in Azure Key Vault. Note that the ENCRYPT - * operation only supports a single block of data, the size of which is - * dependent on the target key and the encryption algorithm to be used. The - * ENCRYPT operation is only strictly necessary for symmetric keys stored in - * Azure Key Vault since protection with an asymmetric key can be performed - * using public portion of the key. This operation is supported for asymmetric - * keys as a convenience for callers that have a key-reference but do not have - * access to the public key material. This operation requires the keys/encypt - * permission. + }); + }); + } + + /** + * @summary Lists the deleted keys in the specified vault. + * + * Retrieves a list of the keys in the Key Vault as JSON Web Key structures + * that contain the public part of a deleted key. This operation includes + * deletion-specific information. The Get Deleted Keys operation is applicable + * for vaults enabled for soft-delete. While the operation can be invoked on + * any vault, it will return an error if invoked on a non soft-delete enabled + * vault. This operation requires the keys/list permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of the key. - * - * @param {string} keyVersion The version of the key. - * - * @param {string} algorithm algorithm identifier. Possible values include: - * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' - * - * @param {buffer} value - * * @param {object} [options] Optional Parameters. * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -14708,7 +17508,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {KeyOperationResult} - The deserialized result object. + * @resolve {DeletedKeyListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -14717,13 +17517,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link KeyOperationResult} for more information. + * See {@link DeletedKeyListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - encrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback) { + getDeletedKeys(vaultBaseUrl, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -14732,40 +17532,30 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._encrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { + self._getDeletedKeys(vaultBaseUrl, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._encrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback); + return self._getDeletedKeys(vaultBaseUrl, options, optionalCallback); } } /** - * @summary Decrypts a single block of encrypted data. + * @summary Gets the public part of a deleted key. * - * The DECRYPT operation decrypts a well-formed block of ciphertext using the - * target encryption key and specified algorithm. This operation is the reverse - * of the ENCRYPT operation; only a single block of data may be decrypted, the - * size of this block is dependent on the target key and the algorithm to be - * used. The DECRYPT operation applies to asymmetric and symmetric keys stored - * in Azure Key Vault since it uses the private portion of the key. This - * operation requires the keys/decrypt permission. + * The Get Deleted Key operation is applicable for soft-delete enabled vaults. + * While the operation can be invoked on any vault, it will return an error if + * invoked on a non soft-delete enabled vault. This operation requires the + * keys/get permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} keyName The name of the key. * - * @param {string} keyVersion The version of the key. - * - * @param {string} algorithm algorithm identifier. Possible values include: - * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' - * - * @param {buffer} value - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -14773,15 +17563,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - decryptWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, algorithm, value, options) { + getDeletedKeyWithHttpOperationResponse(vaultBaseUrl, keyName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._decrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { + self._getDeletedKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -14792,28 +17582,18 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Decrypts a single block of encrypted data. + * @summary Gets the public part of a deleted key. * - * The DECRYPT operation decrypts a well-formed block of ciphertext using the - * target encryption key and specified algorithm. This operation is the reverse - * of the ENCRYPT operation; only a single block of data may be decrypted, the - * size of this block is dependent on the target key and the algorithm to be - * used. The DECRYPT operation applies to asymmetric and symmetric keys stored - * in Azure Key Vault since it uses the private portion of the key. This - * operation requires the keys/decrypt permission. + * The Get Deleted Key operation is applicable for soft-delete enabled vaults. + * While the operation can be invoked on any vault, it will return an error if + * invoked on a non soft-delete enabled vault. This operation requires the + * keys/get permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} keyName The name of the key. * - * @param {string} keyVersion The version of the key. - * - * @param {string} algorithm algorithm identifier. Possible values include: - * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' - * - * @param {buffer} value - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -14826,7 +17606,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {KeyOperationResult} - The deserialized result object. + * @resolve {DeletedKeyBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -14835,13 +17615,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link KeyOperationResult} for more information. + * See {@link DeletedKeyBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - decrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback) { + getDeletedKey(vaultBaseUrl, keyName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -14850,38 +17630,29 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._decrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { + self._getDeletedKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._decrypt(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback); + return self._getDeletedKey(vaultBaseUrl, keyName, options, optionalCallback); } } /** - * @summary Creates a signature from a digest using the specified key. + * @summary Permanently deletes the specified key. * - * The SIGN operation is applicable to asymmetric and symmetric keys stored in - * Azure Key Vault since this operation uses the private portion of the key. - * This operation requires the keys/sign permission. + * The Purge Deleted Key operation is applicable for soft-delete enabled + * vaults. While the operation can be invoked on any vault, it will return an + * error if invoked on a non soft-delete enabled vault. This operation requires + * the keys/purge permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of the key. - * - * @param {string} keyVersion The version of the key. - * - * @param {string} algorithm The signing/verification algorithm identifier. For - * more information on possible algorithm types, see - * JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', - * 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', - * 'ECDSA256' - * - * @param {buffer} value + * @param {string} keyName The name of the key * * @param {object} [options] Optional Parameters. * @@ -14890,15 +17661,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - signWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, algorithm, value, options) { + purgeDeletedKeyWithHttpOperationResponse(vaultBaseUrl, keyName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._sign(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { + self._purgeDeletedKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -14909,26 +17680,17 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Creates a signature from a digest using the specified key. + * @summary Permanently deletes the specified key. * - * The SIGN operation is applicable to asymmetric and symmetric keys stored in - * Azure Key Vault since this operation uses the private portion of the key. - * This operation requires the keys/sign permission. + * The Purge Deleted Key operation is applicable for soft-delete enabled + * vaults. While the operation can be invoked on any vault, it will return an + * error if invoked on a non soft-delete enabled vault. This operation requires + * the keys/purge permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of the key. - * - * @param {string} keyVersion The version of the key. - * - * @param {string} algorithm The signing/verification algorithm identifier. For - * more information on possible algorithm types, see - * JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', - * 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', - * 'ECDSA256' - * - * @param {buffer} value + * @param {string} keyName The name of the key * * @param {object} [options] Optional Parameters. * @@ -14942,7 +17704,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {KeyOperationResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -14950,14 +17712,13 @@ class KeyVaultClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link KeyOperationResult} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - sign(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback) { + purgeDeletedKey(vaultBaseUrl, keyName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -14966,42 +17727,30 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._sign(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { + self._purgeDeletedKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._sign(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback); + return self._purgeDeletedKey(vaultBaseUrl, keyName, options, optionalCallback); } } /** - * @summary Verifies a signature using a specified key. + * @summary Recovers the deleted key to its latest version. * - * The VERIFY operation is applicable to symmetric keys stored in Azure Key - * Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure - * Key Vault since signature verification can be performed using the public - * portion of the key but this operation is supported as a convenience for - * callers that only have a key-reference and not the public portion of the - * key. This operation requires the keys/verify permission. + * The Recover Deleted Key operation is applicable for deleted keys in + * soft-delete enabled vaults. It recovers the deleted key back to its latest + * version under /keys. An attempt to recover an non-deleted key will return an + * error. Consider this the inverse of the delete operation on soft-delete + * enabled vaults. This operation requires the keys/recover permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of the key. - * - * @param {string} keyVersion The version of the key. - * - * @param {string} algorithm The signing/verification algorithm. For more - * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. - * Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', - * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256' - * - * @param {buffer} digest The digest used for signing. - * - * @param {buffer} signature The signature to be verified. + * @param {string} keyName The name of the deleted key. * * @param {object} [options] Optional Parameters. * @@ -15010,15 +17759,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - verifyWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature, options) { + recoverDeletedKeyWithHttpOperationResponse(vaultBaseUrl, keyName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._verify(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature, options, (err, result, request, response) => { + self._recoverDeletedKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -15029,30 +17778,18 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Verifies a signature using a specified key. + * @summary Recovers the deleted key to its latest version. * - * The VERIFY operation is applicable to symmetric keys stored in Azure Key - * Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure - * Key Vault since signature verification can be performed using the public - * portion of the key but this operation is supported as a convenience for - * callers that only have a key-reference and not the public portion of the - * key. This operation requires the keys/verify permission. + * The Recover Deleted Key operation is applicable for deleted keys in + * soft-delete enabled vaults. It recovers the deleted key back to its latest + * version under /keys. An attempt to recover an non-deleted key will return an + * error. Consider this the inverse of the delete operation on soft-delete + * enabled vaults. This operation requires the keys/recover permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of the key. - * - * @param {string} keyVersion The version of the key. - * - * @param {string} algorithm The signing/verification algorithm. For more - * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. - * Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', - * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256' - * - * @param {buffer} digest The digest used for signing. - * - * @param {buffer} signature The signature to be verified. + * @param {string} keyName The name of the deleted key. * * @param {object} [options] Optional Parameters. * @@ -15066,7 +17803,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {KeyVerifyResult} - The deserialized result object. + * @resolve {KeyBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -15075,13 +17812,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link KeyVerifyResult} for more information. + * See {@link KeyBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - verify(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature, options, optionalCallback) { + recoverDeletedKey(vaultBaseUrl, keyName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -15090,57 +17827,62 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._verify(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature, options, (err, result, request, response) => { + self._recoverDeletedKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._verify(vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature, options, optionalCallback); + return self._recoverDeletedKey(vaultBaseUrl, keyName, options, optionalCallback); } } /** - * @summary Wraps a symmetric key using a specified key. + * @summary Sets a secret in a specified key vault. * - * The WRAP operation supports encryption of a symmetric key using a key - * encryption key that has previously been stored in an Azure Key Vault. The - * WRAP operation is only strictly necessary for symmetric keys stored in Azure - * Key Vault since protection with an asymmetric key can be performed using the - * public portion of the key. This operation is supported for asymmetric keys - * as a convenience for callers that have a key-reference but do not have - * access to the public key material. This operation requires the keys/wrapKey - * permission. + * The SET operation adds a secret to the Azure Key Vault. If the named secret + * already exists, Azure Key Vault creates a new version of that secret. This + * operation requires the secrets/set permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of the key. + * @param {string} secretName The name of the secret. * - * @param {string} keyVersion The version of the key. + * @param {string} value The value of the secret. * - * @param {string} algorithm algorithm identifier. Possible values include: - * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param {object} [options] Optional Parameters. * - * @param {buffer} value + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.contentType] Type of the secret value such as a + * password. + * + * @param {object} [options.secretAttributes] The secret management attributes. + * + * @param {boolean} [options.secretAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.secretAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.secretAttributes.expires] Expiry date in UTC. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - wrapKeyWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, algorithm, value, options) { + setSecretWithHttpOperationResponse(vaultBaseUrl, secretName, value, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._wrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { + self._setSecret(vaultBaseUrl, secretName, value, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -15151,30 +17893,35 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Wraps a symmetric key using a specified key. + * @summary Sets a secret in a specified key vault. * - * The WRAP operation supports encryption of a symmetric key using a key - * encryption key that has previously been stored in an Azure Key Vault. The - * WRAP operation is only strictly necessary for symmetric keys stored in Azure - * Key Vault since protection with an asymmetric key can be performed using the - * public portion of the key. This operation is supported for asymmetric keys - * as a convenience for callers that have a key-reference but do not have - * access to the public key material. This operation requires the keys/wrapKey - * permission. + * The SET operation adds a secret to the Azure Key Vault. If the named secret + * already exists, Azure Key Vault creates a new version of that secret. This + * operation requires the secrets/set permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of the key. + * @param {string} secretName The name of the secret. * - * @param {string} keyVersion The version of the key. + * @param {string} value The value of the secret. * - * @param {string} algorithm algorithm identifier. Possible values include: - * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + * @param {object} [options] Optional Parameters. * - * @param {buffer} value + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.contentType] Type of the secret value such as a + * password. + * + * @param {object} [options.secretAttributes] The secret management attributes. + * + * @param {boolean} [options.secretAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.secretAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.secretAttributes.expires] Expiry date in UTC. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15186,7 +17933,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {KeyOperationResult} - The deserialized result object. + * @resolve {SecretBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -15195,13 +17942,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link KeyOperationResult} for more information. + * See {@link SecretBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - wrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback) { + setSecret(vaultBaseUrl, secretName, value, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -15210,38 +17957,28 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._wrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { + self._setSecret(vaultBaseUrl, secretName, value, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._wrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback); + return self._setSecret(vaultBaseUrl, secretName, value, options, optionalCallback); } } /** - * @summary Unwraps a symmetric key using the specified key that was initially - * used for wrapping that key. + * @summary Deletes a secret from a specified key vault. * - * The UNWRAP operation supports decryption of a symmetric key using the target - * key encryption key. This operation is the reverse of the WRAP operation. The - * UNWRAP operation applies to asymmetric and symmetric keys stored in Azure - * Key Vault since it uses the private portion of the key. This operation - * requires the keys/unwrapKey permission. + * The DELETE operation applies to any secret stored in Azure Key Vault. DELETE + * cannot be applied to an individual version of a secret. This operation + * requires the secrets/delete permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of the key. - * - * @param {string} keyVersion The version of the key. - * - * @param {string} algorithm algorithm identifier. Possible values include: - * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' - * - * @param {buffer} value + * @param {string} secretName The name of the secret. * * @param {object} [options] Optional Parameters. * @@ -15250,15 +17987,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - unwrapKeyWithHttpOperationResponse(vaultBaseUrl, keyName, keyVersion, algorithm, value, options) { + deleteSecretWithHttpOperationResponse(vaultBaseUrl, secretName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._unwrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { + self._deleteSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -15269,26 +18006,16 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Unwraps a symmetric key using the specified key that was initially - * used for wrapping that key. + * @summary Deletes a secret from a specified key vault. * - * The UNWRAP operation supports decryption of a symmetric key using the target - * key encryption key. This operation is the reverse of the WRAP operation. The - * UNWRAP operation applies to asymmetric and symmetric keys stored in Azure - * Key Vault since it uses the private portion of the key. This operation - * requires the keys/unwrapKey permission. + * The DELETE operation applies to any secret stored in Azure Key Vault. DELETE + * cannot be applied to an individual version of a secret. This operation + * requires the secrets/delete permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of the key. - * - * @param {string} keyVersion The version of the key. - * - * @param {string} algorithm algorithm identifier. Possible values include: - * 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' - * - * @param {buffer} value + * @param {string} secretName The name of the secret. * * @param {object} [options] Optional Parameters. * @@ -15302,7 +18029,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {KeyOperationResult} - The deserialized result object. + * @resolve {DeletedSecretBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -15311,13 +18038,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link KeyOperationResult} for more information. + * See {@link DeletedSecretBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - unwrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback) { + deleteSecret(vaultBaseUrl, secretName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -15326,49 +18053,64 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._unwrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, (err, result, request, response) => { + self._deleteSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._unwrapKey(vaultBaseUrl, keyName, keyVersion, algorithm, value, options, optionalCallback); + return self._deleteSecret(vaultBaseUrl, secretName, options, optionalCallback); } } /** - * @summary Lists the deleted keys in the specified vault. + * @summary Updates the attributes associated with a specified secret in a + * given key vault. * - * Retrieves a list of the keys in the Key Vault as JSON Web Key structures - * that contain the public part of a deleted key. This operation includes - * deletion-specific information. The Get Deleted Keys operation is applicable - * for vaults enabled for soft-delete. While the operation can be invoked on - * any vault, it will return an error if invoked on a non soft-delete enabled - * vault. This operation requires the keys/list permission. + * The UPDATE operation changes specified attributes of an existing stored + * secret. Attributes that are not specified in the request are left unchanged. + * The value of a secret itself cannot be changed. This operation requires the + * secrets/set permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * + * @param {string} secretName The name of the secret. + * + * @param {string} secretVersion The version of the secret. + * * @param {object} [options] Optional Parameters. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. + * @param {string} [options.contentType] Type of the secret value such as a + * password. + * + * @param {object} [options.secretAttributes] The secret management attributes. + * + * @param {boolean} [options.secretAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.secretAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.secretAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeletedKeysWithHttpOperationResponse(vaultBaseUrl, options) { + updateSecretWithHttpOperationResponse(vaultBaseUrl, secretName, secretVersion, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeletedKeys(vaultBaseUrl, options, (err, result, request, response) => { + self._updateSecret(vaultBaseUrl, secretName, secretVersion, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -15379,22 +18121,37 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Lists the deleted keys in the specified vault. + * @summary Updates the attributes associated with a specified secret in a + * given key vault. * - * Retrieves a list of the keys in the Key Vault as JSON Web Key structures - * that contain the public part of a deleted key. This operation includes - * deletion-specific information. The Get Deleted Keys operation is applicable - * for vaults enabled for soft-delete. While the operation can be invoked on - * any vault, it will return an error if invoked on a non soft-delete enabled - * vault. This operation requires the keys/list permission. + * The UPDATE operation changes specified attributes of an existing stored + * secret. Attributes that are not specified in the request are left unchanged. + * The value of a secret itself cannot be changed. This operation requires the + * secrets/set permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * + * @param {string} secretName The name of the secret. + * + * @param {string} secretVersion The version of the secret. + * * @param {object} [options] Optional Parameters. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. + * @param {string} [options.contentType] Type of the secret value such as a + * password. + * + * @param {object} [options.secretAttributes] The secret management attributes. + * + * @param {boolean} [options.secretAttributes.enabled] Determines whether the + * object is enabled. + * + * @param {date} [options.secretAttributes.notBefore] Not before date in UTC. + * + * @param {date} [options.secretAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15406,7 +18163,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {DeletedKeyListResult} - The deserialized result object. + * @resolve {SecretBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -15415,13 +18172,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeletedKeyListResult} for more information. + * See {@link SecretBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getDeletedKeys(vaultBaseUrl, options, optionalCallback) { + updateSecret(vaultBaseUrl, secretName, secretVersion, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -15430,29 +18187,29 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeletedKeys(vaultBaseUrl, options, (err, result, request, response) => { + self._updateSecret(vaultBaseUrl, secretName, secretVersion, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeletedKeys(vaultBaseUrl, options, optionalCallback); + return self._updateSecret(vaultBaseUrl, secretName, secretVersion, options, optionalCallback); } } /** - * @summary Gets the public part of a deleted key. + * @summary Get a specified secret from a given key vault. * - * The Get Deleted Key operation is applicable for soft-delete enabled vaults. - * While the operation can be invoked on any vault, it will return an error if - * invoked on a non soft-delete enabled vault. This operation requires the - * keys/get permission. + * The GET operation is applicable to any secret stored in Azure Key Vault. + * This operation requires the secrets/get permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of the key. + * @param {string} secretName The name of the secret. + * + * @param {string} secretVersion The version of the secret. * * @param {object} [options] Optional Parameters. * @@ -15461,15 +18218,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeletedKeyWithHttpOperationResponse(vaultBaseUrl, keyName, options) { + getSecretWithHttpOperationResponse(vaultBaseUrl, secretName, secretVersion, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeletedKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { + self._getSecret(vaultBaseUrl, secretName, secretVersion, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -15480,17 +18237,17 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Gets the public part of a deleted key. + * @summary Get a specified secret from a given key vault. * - * The Get Deleted Key operation is applicable for soft-delete enabled vaults. - * While the operation can be invoked on any vault, it will return an error if - * invoked on a non soft-delete enabled vault. This operation requires the - * keys/get permission. + * The GET operation is applicable to any secret stored in Azure Key Vault. + * This operation requires the secrets/get permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of the key. + * @param {string} secretName The name of the secret. + * + * @param {string} secretVersion The version of the secret. * * @param {object} [options] Optional Parameters. * @@ -15504,7 +18261,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {DeletedKeyBundle} - The deserialized result object. + * @resolve {SecretBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -15513,13 +18270,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeletedKeyBundle} for more information. + * See {@link SecretBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getDeletedKey(vaultBaseUrl, keyName, options, optionalCallback) { + getSecret(vaultBaseUrl, secretName, secretVersion, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -15528,46 +18285,47 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeletedKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { + self._getSecret(vaultBaseUrl, secretName, secretVersion, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeletedKey(vaultBaseUrl, keyName, options, optionalCallback); + return self._getSecret(vaultBaseUrl, secretName, secretVersion, options, optionalCallback); } } /** - * @summary Permanently deletes the specified key. + * @summary List secrets in a specified key vault. * - * The Purge Deleted Key operation is applicable for soft-delete enabled - * vaults. While the operation can be invoked on any vault, it will return an - * error if invoked on a non soft-delete enabled vault. This operation requires - * the keys/purge permission. + * The Get Secrets operation is applicable to the entire vault. However, only + * the base secret identifier and its attributes are provided in the response. + * Individual secret versions are not listed in the response. This operation + * requires the secrets/list permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of the key - * * @param {object} [options] Optional Parameters. * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified, the service will return up to 25 results. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - purgeDeletedKeyWithHttpOperationResponse(vaultBaseUrl, keyName, options) { + getSecretsWithHttpOperationResponse(vaultBaseUrl, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._purgeDeletedKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { + self._getSecrets(vaultBaseUrl, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -15578,20 +18336,21 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Permanently deletes the specified key. + * @summary List secrets in a specified key vault. * - * The Purge Deleted Key operation is applicable for soft-delete enabled - * vaults. While the operation can be invoked on any vault, it will return an - * error if invoked on a non soft-delete enabled vault. This operation requires - * the keys/purge permission. + * The Get Secrets operation is applicable to the entire vault. However, only + * the base secret identifier and its attributes are provided in the response. + * Individual secret versions are not listed in the response. This operation + * requires the secrets/list permission. * * @param {string} vaultBaseUrl The vault name, for example - * https://myvault.vault.azure.net. - * - * @param {string} keyName The name of the key + * https://myvault.vault.azure.net. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified, the service will return up to 25 results. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -15602,7 +18361,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {SecretListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -15610,13 +18369,14 @@ class KeyVaultClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SecretListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - purgeDeletedKey(vaultBaseUrl, keyName, options, optionalCallback) { + getSecrets(vaultBaseUrl, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -15625,47 +18385,48 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._purgeDeletedKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { + self._getSecrets(vaultBaseUrl, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._purgeDeletedKey(vaultBaseUrl, keyName, options, optionalCallback); + return self._getSecrets(vaultBaseUrl, options, optionalCallback); } } /** - * @summary Recovers the deleted key to its latest version. + * @summary List all versions of the specified secret. * - * The Recover Deleted Key operation is applicable for deleted keys in - * soft-delete enabled vaults. It recovers the deleted key back to its latest - * version under /keys. An attempt to recover an non-deleted key will return an - * error. Consider this the inverse of the delete operation on soft-delete - * enabled vaults. This operation requires the keys/recover permission. + * The full secret identifier and attributes are provided in the response. No + * values are returned for the secrets. This operations requires the + * secrets/list permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of the deleted key. + * @param {string} secretName The name of the secret. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified, the service will return up to 25 results. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - recoverDeletedKeyWithHttpOperationResponse(vaultBaseUrl, keyName, options) { + getSecretVersionsWithHttpOperationResponse(vaultBaseUrl, secretName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._recoverDeletedKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { + self._getSecretVersions(vaultBaseUrl, secretName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -15676,21 +18437,22 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Recovers the deleted key to its latest version. + * @summary List all versions of the specified secret. * - * The Recover Deleted Key operation is applicable for deleted keys in - * soft-delete enabled vaults. It recovers the deleted key back to its latest - * version under /keys. An attempt to recover an non-deleted key will return an - * error. Consider this the inverse of the delete operation on soft-delete - * enabled vaults. This operation requires the keys/recover permission. + * The full secret identifier and attributes are provided in the response. No + * values are returned for the secrets. This operations requires the + * secrets/list permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} keyName The name of the deleted key. + * @param {string} secretName The name of the secret. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified, the service will return up to 25 results. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -15701,7 +18463,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {KeyBundle} - The deserialized result object. + * @resolve {SecretListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -15710,13 +18472,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link KeyBundle} for more information. + * See {@link SecretListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - recoverDeletedKey(vaultBaseUrl, keyName, options, optionalCallback) { + getSecretVersions(vaultBaseUrl, secretName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -15725,62 +18487,46 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._recoverDeletedKey(vaultBaseUrl, keyName, options, (err, result, request, response) => { + self._getSecretVersions(vaultBaseUrl, secretName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._recoverDeletedKey(vaultBaseUrl, keyName, options, optionalCallback); + return self._getSecretVersions(vaultBaseUrl, secretName, options, optionalCallback); } } /** - * @summary Sets a secret in a specified key vault. + * @summary Lists deleted secrets for the specified vault. * - * The SET operation adds a secret to the Azure Key Vault. If the named secret - * already exists, Azure Key Vault creates a new version of that secret. This - * operation requires the secrets/set permission. + * The Get Deleted Secrets operation returns the secrets that have been deleted + * for a vault enabled for soft-delete. This operation requires the + * secrets/list permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} secretName The name of the secret. - * - * @param {string} value The value of the secret. - * * @param {object} [options] Optional Parameters. * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. - * - * @param {string} [options.contentType] Type of the secret value such as a - * password. - * - * @param {object} [options.secretAttributes] The secret management attributes. - * - * @param {boolean} [options.secretAttributes.enabled] Determines whether the - * object is enabled. - * - * @param {date} [options.secretAttributes.notBefore] Not before date in UTC. - * - * @param {date} [options.secretAttributes.expires] Expiry date in UTC. + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - setSecretWithHttpOperationResponse(vaultBaseUrl, secretName, value, options) { + getDeletedSecretsWithHttpOperationResponse(vaultBaseUrl, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._setSecret(vaultBaseUrl, secretName, value, options, (err, result, request, response) => { + self._getDeletedSecrets(vaultBaseUrl, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -15791,35 +18537,19 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Sets a secret in a specified key vault. + * @summary Lists deleted secrets for the specified vault. * - * The SET operation adds a secret to the Azure Key Vault. If the named secret - * already exists, Azure Key Vault creates a new version of that secret. This - * operation requires the secrets/set permission. + * The Get Deleted Secrets operation returns the secrets that have been deleted + * for a vault enabled for soft-delete. This operation requires the + * secrets/list permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} secretName The name of the secret. - * - * @param {string} value The value of the secret. - * * @param {object} [options] Optional Parameters. * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. - * - * @param {string} [options.contentType] Type of the secret value such as a - * password. - * - * @param {object} [options.secretAttributes] The secret management attributes. - * - * @param {boolean} [options.secretAttributes.enabled] Determines whether the - * object is enabled. - * - * @param {date} [options.secretAttributes.notBefore] Not before date in UTC. - * - * @param {date} [options.secretAttributes.expires] Expiry date in UTC. + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15831,7 +18561,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {SecretBundle} - The deserialized result object. + * @resolve {DeletedSecretListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -15840,13 +18570,14 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SecretBundle} for more information. + * See {@link DeletedSecretListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - setSecret(vaultBaseUrl, secretName, value, options, optionalCallback) { + getDeletedSecrets(vaultBaseUrl, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -15855,23 +18586,22 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._setSecret(vaultBaseUrl, secretName, value, options, (err, result, request, response) => { + self._getDeletedSecrets(vaultBaseUrl, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._setSecret(vaultBaseUrl, secretName, value, options, optionalCallback); + return self._getDeletedSecrets(vaultBaseUrl, options, optionalCallback); } } /** - * @summary Deletes a secret from a specified key vault. + * @summary Gets the specified deleted secret. * - * The DELETE operation applies to any secret stored in Azure Key Vault. DELETE - * cannot be applied to an individual version of a secret. This operation - * requires the secrets/delete permission. + * The Get Deleted Secret operation returns the specified deleted secret along + * with its attributes. This operation requires the secrets/get permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. @@ -15889,11 +18619,11 @@ class KeyVaultClient extends ServiceClient { * * @reject {Error} - The error object. */ - deleteSecretWithHttpOperationResponse(vaultBaseUrl, secretName, options) { + getDeletedSecretWithHttpOperationResponse(vaultBaseUrl, secretName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deleteSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { + self._getDeletedSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -15904,11 +18634,10 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Deletes a secret from a specified key vault. + * @summary Gets the specified deleted secret. * - * The DELETE operation applies to any secret stored in Azure Key Vault. DELETE - * cannot be applied to an individual version of a secret. This operation - * requires the secrets/delete permission. + * The Get Deleted Secret operation returns the specified deleted secret along + * with its attributes. This operation requires the secrets/get permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. @@ -15942,7 +18671,7 @@ class KeyVaultClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteSecret(vaultBaseUrl, secretName, options, optionalCallback) { + getDeletedSecret(vaultBaseUrl, secretName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -15951,64 +18680,46 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { + self._getDeletedSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteSecret(vaultBaseUrl, secretName, options, optionalCallback); + return self._getDeletedSecret(vaultBaseUrl, secretName, options, optionalCallback); } } /** - * @summary Updates the attributes associated with a specified secret in a - * given key vault. + * @summary Permanently deletes the specified secret. * - * The UPDATE operation changes specified attributes of an existing stored - * secret. Attributes that are not specified in the request are left unchanged. - * The value of a secret itself cannot be changed. This operation requires the - * secrets/set permission. + * The purge deleted secret operation removes the secret permanently, without + * the possibility of recovery. This operation can only be enabled on a + * soft-delete enabled vault. This operation requires the secrets/purge + * permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} secretName The name of the secret. * - * @param {string} secretVersion The version of the secret. - * * @param {object} [options] Optional Parameters. * - * @param {string} [options.contentType] Type of the secret value such as a - * password. - * - * @param {object} [options.secretAttributes] The secret management attributes. - * - * @param {boolean} [options.secretAttributes.enabled] Determines whether the - * object is enabled. - * - * @param {date} [options.secretAttributes.notBefore] Not before date in UTC. - * - * @param {date} [options.secretAttributes.expires] Expiry date in UTC. - * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - updateSecretWithHttpOperationResponse(vaultBaseUrl, secretName, secretVersion, options) { + purgeDeletedSecretWithHttpOperationResponse(vaultBaseUrl, secretName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._updateSecret(vaultBaseUrl, secretName, secretVersion, options, (err, result, request, response) => { + self._purgeDeletedSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -16019,38 +18730,20 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Updates the attributes associated with a specified secret in a - * given key vault. + * @summary Permanently deletes the specified secret. * - * The UPDATE operation changes specified attributes of an existing stored - * secret. Attributes that are not specified in the request are left unchanged. - * The value of a secret itself cannot be changed. This operation requires the - * secrets/set permission. + * The purge deleted secret operation removes the secret permanently, without + * the possibility of recovery. This operation can only be enabled on a + * soft-delete enabled vault. This operation requires the secrets/purge + * permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} secretName The name of the secret. * - * @param {string} secretVersion The version of the secret. - * * @param {object} [options] Optional Parameters. * - * @param {string} [options.contentType] Type of the secret value such as a - * password. - * - * @param {object} [options.secretAttributes] The secret management attributes. - * - * @param {boolean} [options.secretAttributes.enabled] Determines whether the - * object is enabled. - * - * @param {date} [options.secretAttributes.notBefore] Not before date in UTC. - * - * @param {date} [options.secretAttributes.expires] Expiry date in UTC. - * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -16061,7 +18754,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {SecretBundle} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -16069,14 +18762,13 @@ class KeyVaultClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SecretBundle} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - updateSecret(vaultBaseUrl, secretName, secretVersion, options, optionalCallback) { + purgeDeletedSecret(vaultBaseUrl, secretName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -16085,29 +18777,28 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateSecret(vaultBaseUrl, secretName, secretVersion, options, (err, result, request, response) => { + self._purgeDeletedSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateSecret(vaultBaseUrl, secretName, secretVersion, options, optionalCallback); + return self._purgeDeletedSecret(vaultBaseUrl, secretName, options, optionalCallback); } } /** - * @summary Get a specified secret from a given key vault. + * @summary Recovers the deleted secret to the latest version. * - * The GET operation is applicable to any secret stored in Azure Key Vault. - * This operation requires the secrets/get permission. + * Recovers the deleted secret in the specified vault. This operation can only + * be performed on a soft-delete enabled vault. This operation requires the + * secrets/recover permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} secretName The name of the secret. - * - * @param {string} secretVersion The version of the secret. + * @param {string} secretName The name of the deleted secret. * * @param {object} [options] Optional Parameters. * @@ -16120,11 +18811,11 @@ class KeyVaultClient extends ServiceClient { * * @reject {Error} - The error object. */ - getSecretWithHttpOperationResponse(vaultBaseUrl, secretName, secretVersion, options) { + recoverDeletedSecretWithHttpOperationResponse(vaultBaseUrl, secretName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getSecret(vaultBaseUrl, secretName, secretVersion, options, (err, result, request, response) => { + self._recoverDeletedSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -16135,17 +18826,16 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Get a specified secret from a given key vault. + * @summary Recovers the deleted secret to the latest version. * - * The GET operation is applicable to any secret stored in Azure Key Vault. - * This operation requires the secrets/get permission. + * Recovers the deleted secret in the specified vault. This operation can only + * be performed on a soft-delete enabled vault. This operation requires the + * secrets/recover permission. * * @param {string} vaultBaseUrl The vault name, for example - * https://myvault.vault.azure.net. - * - * @param {string} secretName The name of the secret. + * https://myvault.vault.azure.net. * - * @param {string} secretVersion The version of the secret. + * @param {string} secretName The name of the deleted secret. * * @param {object} [options] Optional Parameters. * @@ -16174,7 +18864,7 @@ class KeyVaultClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getSecret(vaultBaseUrl, secretName, secretVersion, options, optionalCallback) { + recoverDeletedSecret(vaultBaseUrl, secretName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -16183,47 +18873,45 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getSecret(vaultBaseUrl, secretName, secretVersion, options, (err, result, request, response) => { + self._recoverDeletedSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getSecret(vaultBaseUrl, secretName, secretVersion, options, optionalCallback); + return self._recoverDeletedSecret(vaultBaseUrl, secretName, options, optionalCallback); } } /** - * @summary List secrets in a specified key vault. + * @summary Backs up the specified secret. * - * The Get Secrets operation is applicable to the entire vault. However, only - * the base secret identifier and its attributes are provided in the response. - * Individual secret versions are not listed in the response. This operation - * requires the secrets/list permission. + * Requests that a backup of the specified secret be downloaded to the client. + * All versions of the secret will be downloaded. This operation requires the + * secrets/backup permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {object} [options] Optional Parameters. + * @param {string} secretName The name of the secret. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified, the service will return up to 25 results. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getSecretsWithHttpOperationResponse(vaultBaseUrl, options) { + backupSecretWithHttpOperationResponse(vaultBaseUrl, secretName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getSecrets(vaultBaseUrl, options, (err, result, request, response) => { + self._backupSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -16234,20 +18922,18 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary List secrets in a specified key vault. + * @summary Backs up the specified secret. * - * The Get Secrets operation is applicable to the entire vault. However, only - * the base secret identifier and its attributes are provided in the response. - * Individual secret versions are not listed in the response. This operation - * requires the secrets/list permission. + * Requests that a backup of the specified secret be downloaded to the client. + * All versions of the secret will be downloaded. This operation requires the + * secrets/backup permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {object} [options] Optional Parameters. + * @param {string} secretName The name of the secret. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified, the service will return up to 25 results. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -16259,7 +18945,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {SecretListResult} - The deserialized result object. + * @resolve {BackupSecretResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -16268,13 +18954,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SecretListResult} for more information. + * See {@link BackupSecretResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getSecrets(vaultBaseUrl, options, optionalCallback) { + backupSecret(vaultBaseUrl, secretName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -16283,48 +18969,45 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getSecrets(vaultBaseUrl, options, (err, result, request, response) => { + self._backupSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getSecrets(vaultBaseUrl, options, optionalCallback); + return self._backupSecret(vaultBaseUrl, secretName, options, optionalCallback); } } /** - * @summary List all versions of the specified secret. + * @summary Restores a backed up secret to a vault. * - * The full secret identifier and attributes are provided in the response. No - * values are returned for the secrets. This operations requires the - * secrets/list permission. + * Restores a backed up secret, and all its versions, to a vault. This + * operation requires the secrets/restore permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} secretName The name of the secret. + * @param {buffer} secretBundleBackup The backup blob associated with a secret + * bundle. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified, the service will return up to 25 results. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getSecretVersionsWithHttpOperationResponse(vaultBaseUrl, secretName, options) { + restoreSecretWithHttpOperationResponse(vaultBaseUrl, secretBundleBackup, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getSecretVersions(vaultBaseUrl, secretName, options, (err, result, request, response) => { + self._restoreSecret(vaultBaseUrl, secretBundleBackup, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -16335,22 +19018,19 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary List all versions of the specified secret. + * @summary Restores a backed up secret to a vault. * - * The full secret identifier and attributes are provided in the response. No - * values are returned for the secrets. This operations requires the - * secrets/list permission. + * Restores a backed up secret, and all its versions, to a vault. This + * operation requires the secrets/restore permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} secretName The name of the secret. + * @param {buffer} secretBundleBackup The backup blob associated with a secret + * bundle. * * @param {object} [options] Optional Parameters. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified, the service will return up to 25 results. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -16361,7 +19041,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {SecretListResult} - The deserialized result object. + * @resolve {SecretBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -16370,13 +19050,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SecretListResult} for more information. + * See {@link SecretBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getSecretVersions(vaultBaseUrl, secretName, options, optionalCallback) { + restoreSecret(vaultBaseUrl, secretBundleBackup, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -16385,23 +19065,23 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getSecretVersions(vaultBaseUrl, secretName, options, (err, result, request, response) => { + self._restoreSecret(vaultBaseUrl, secretBundleBackup, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getSecretVersions(vaultBaseUrl, secretName, options, optionalCallback); + return self._restoreSecret(vaultBaseUrl, secretBundleBackup, options, optionalCallback); } } /** - * @summary Lists deleted secrets for the specified vault. + * @summary List certificates in a specified key vault * - * The Get Deleted Secrets operation returns the secrets that have been deleted - * for a vault enabled for soft-delete. This operation requires the - * secrets/list permission. + * The GetCertificates operation returns the set of certificates resources in + * the specified key vault. This operation requires the certificates/list + * permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. @@ -16411,20 +19091,23 @@ class KeyVaultClient extends ServiceClient { * @param {number} [options.maxresults] Maximum number of results to return in * a page. If not specified the service will return up to 25 results. * + * @param {boolean} [options.includePending] Specifies whether to include + * certificates which are not completely provisioned. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeletedSecretsWithHttpOperationResponse(vaultBaseUrl, options) { + getCertificatesWithHttpOperationResponse(vaultBaseUrl, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeletedSecrets(vaultBaseUrl, options, (err, result, request, response) => { + self._getCertificates(vaultBaseUrl, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -16435,11 +19118,11 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Lists deleted secrets for the specified vault. + * @summary List certificates in a specified key vault * - * The Get Deleted Secrets operation returns the secrets that have been deleted - * for a vault enabled for soft-delete. This operation requires the - * secrets/list permission. + * The GetCertificates operation returns the set of certificates resources in + * the specified key vault. This operation requires the certificates/list + * permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. @@ -16449,6 +19132,9 @@ class KeyVaultClient extends ServiceClient { * @param {number} [options.maxresults] Maximum number of results to return in * a page. If not specified the service will return up to 25 results. * + * @param {boolean} [options.includePending] Specifies whether to include + * certificates which are not completely provisioned. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -16459,7 +19145,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {DeletedSecretListResult} - The deserialized result object. + * @resolve {CertificateListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -16468,14 +19154,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeletedSecretListResult} for more - * information. + * See {@link CertificateListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getDeletedSecrets(vaultBaseUrl, options, optionalCallback) { + getCertificates(vaultBaseUrl, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -16484,27 +19169,29 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeletedSecrets(vaultBaseUrl, options, (err, result, request, response) => { + self._getCertificates(vaultBaseUrl, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeletedSecrets(vaultBaseUrl, options, optionalCallback); + return self._getCertificates(vaultBaseUrl, options, optionalCallback); } } /** - * @summary Gets the specified deleted secret. + * @summary Deletes a certificate from a specified key vault. * - * The Get Deleted Secret operation returns the specified deleted secret along - * with its attributes. This operation requires the secrets/get permission. + * 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 {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} secretName The name of the secret. + * @param {string} certificateName The name of the certificate. * * @param {object} [options] Optional Parameters. * @@ -16513,15 +19200,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeletedSecretWithHttpOperationResponse(vaultBaseUrl, secretName, options) { + deleteCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeletedSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { + self._deleteCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -16532,15 +19219,17 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Gets the specified deleted secret. + * @summary Deletes a certificate from a specified key vault. * - * The Get Deleted Secret operation returns the specified deleted secret along - * with its attributes. This operation requires the secrets/get permission. + * 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 {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} secretName The name of the secret. + * @param {string} certificateName The name of the certificate. * * @param {object} [options] Optional Parameters. * @@ -16554,7 +19243,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {DeletedSecretBundle} - The deserialized result object. + * @resolve {DeletedCertificateBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -16563,13 +19252,14 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeletedSecretBundle} for more information. + * See {@link DeletedCertificateBundle} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getDeletedSecret(vaultBaseUrl, secretName, options, optionalCallback) { + deleteCertificate(vaultBaseUrl, certificateName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -16578,29 +19268,30 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeletedSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { + self._deleteCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeletedSecret(vaultBaseUrl, secretName, options, optionalCallback); + return self._deleteCertificate(vaultBaseUrl, certificateName, options, optionalCallback); } } /** - * @summary Permanently deletes the specified secret. + * @summary Sets the certificate contacts for the specified key vault. * - * The purge deleted secret operation removes the secret permanently, without - * the possibility of recovery. This operation can only be enabled on a - * soft-delete enabled vault. This operation requires the secrets/purge - * permission. + * Sets the certificate contacts for the specified key vault. This operation + * requires the certificates/managecontacts permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} secretName The name of the secret. + * @param {object} contacts The contacts for the key vault certificate. + * + * @param {array} [contacts.contactList] The contact list for the vault + * certificates. * * @param {object} [options] Optional Parameters. * @@ -16609,15 +19300,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - purgeDeletedSecretWithHttpOperationResponse(vaultBaseUrl, secretName, options) { + setCertificateContactsWithHttpOperationResponse(vaultBaseUrl, contacts, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._purgeDeletedSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { + self._setCertificateContacts(vaultBaseUrl, contacts, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -16628,17 +19319,18 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Permanently deletes the specified secret. + * @summary Sets the certificate contacts for the specified key vault. * - * The purge deleted secret operation removes the secret permanently, without - * the possibility of recovery. This operation can only be enabled on a - * soft-delete enabled vault. This operation requires the secrets/purge - * permission. + * Sets the certificate contacts for the specified key vault. This operation + * requires the certificates/managecontacts permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} secretName The name of the secret. + * @param {object} contacts The contacts for the key vault certificate. + * + * @param {array} [contacts.contactList] The contact list for the vault + * certificates. * * @param {object} [options] Optional Parameters. * @@ -16652,7 +19344,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {Contacts} - The deserialized result object. * * @reject {Error} - The error object. * @@ -16660,13 +19352,14 @@ class KeyVaultClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Contacts} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - purgeDeletedSecret(vaultBaseUrl, secretName, options, optionalCallback) { + setCertificateContacts(vaultBaseUrl, contacts, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -16675,29 +19368,27 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._purgeDeletedSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { + self._setCertificateContacts(vaultBaseUrl, contacts, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._purgeDeletedSecret(vaultBaseUrl, secretName, options, optionalCallback); + return self._setCertificateContacts(vaultBaseUrl, contacts, options, optionalCallback); } } /** - * @summary Recovers the deleted secret to the latest version. + * @summary Lists the certificate contacts for a specified key vault. * - * Recovers the deleted secret in the specified vault. This operation can only - * be performed on a soft-delete enabled vault. This operation requires the - * secrets/recover permission. + * The GetCertificateContacts operation returns the set of certificate contact + * resources in the specified key vault. This operation requires the + * certificates/managecontacts permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} secretName The name of the deleted secret. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -16705,15 +19396,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - recoverDeletedSecretWithHttpOperationResponse(vaultBaseUrl, secretName, options) { + getCertificateContactsWithHttpOperationResponse(vaultBaseUrl, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._recoverDeletedSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { + self._getCertificateContacts(vaultBaseUrl, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -16724,17 +19415,15 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Recovers the deleted secret to the latest version. + * @summary Lists the certificate contacts for a specified key vault. * - * Recovers the deleted secret in the specified vault. This operation can only - * be performed on a soft-delete enabled vault. This operation requires the - * secrets/recover permission. + * The GetCertificateContacts operation returns the set of certificate contact + * resources in the specified key vault. This operation requires the + * certificates/managecontacts permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} secretName The name of the deleted secret. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -16747,7 +19436,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {SecretBundle} - The deserialized result object. + * @resolve {Contacts} - The deserialized result object. * * @reject {Error} - The error object. * @@ -16756,13 +19445,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SecretBundle} for more information. + * See {@link Contacts} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - recoverDeletedSecret(vaultBaseUrl, secretName, options, optionalCallback) { + getCertificateContacts(vaultBaseUrl, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -16771,28 +19460,25 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._recoverDeletedSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { + self._getCertificateContacts(vaultBaseUrl, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._recoverDeletedSecret(vaultBaseUrl, secretName, options, optionalCallback); + return self._getCertificateContacts(vaultBaseUrl, options, optionalCallback); } } /** - * @summary Backs up the specified secret. + * @summary Deletes the certificate contacts for a specified key vault. * - * Requests that a backup of the specified secret be downloaded to the client. - * All versions of the secret will be downloaded. This operation requires the - * secrets/backup permission. + * Deletes the certificate contacts for a specified key vault certificate. This + * operation requires the certificates/managecontacts permission. * * @param {string} vaultBaseUrl The vault name, for example - * https://myvault.vault.azure.net. - * - * @param {string} secretName The name of the secret. + * https://myvault.vault.azure.net. * * @param {object} [options] Optional Parameters. * @@ -16801,15 +19487,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - backupSecretWithHttpOperationResponse(vaultBaseUrl, secretName, options) { + deleteCertificateContactsWithHttpOperationResponse(vaultBaseUrl, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._backupSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { + self._deleteCertificateContacts(vaultBaseUrl, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -16820,17 +19506,14 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Backs up the specified secret. + * @summary Deletes the certificate contacts for a specified key vault. * - * Requests that a backup of the specified secret be downloaded to the client. - * All versions of the secret will be downloaded. This operation requires the - * secrets/backup permission. + * Deletes the certificate contacts for a specified key vault certificate. This + * operation requires the certificates/managecontacts permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} secretName The name of the secret. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -16843,7 +19526,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {BackupSecretResult} - The deserialized result object. + * @resolve {Contacts} - The deserialized result object. * * @reject {Error} - The error object. * @@ -16852,13 +19535,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link BackupSecretResult} for more information. + * See {@link Contacts} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - backupSecret(vaultBaseUrl, secretName, options, optionalCallback) { + deleteCertificateContacts(vaultBaseUrl, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -16867,45 +19550,46 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._backupSecret(vaultBaseUrl, secretName, options, (err, result, request, response) => { + self._deleteCertificateContacts(vaultBaseUrl, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._backupSecret(vaultBaseUrl, secretName, options, optionalCallback); + return self._deleteCertificateContacts(vaultBaseUrl, options, optionalCallback); } } /** - * @summary Restores a backed up secret to a vault. + * @summary List certificate issuers for a specified key vault. * - * Restores a backed up secret, and all its versions, to a vault. This - * operation requires the secrets/restore permission. + * The GetCertificateIssuers operation returns the set of certificate issuer + * resources in the specified key vault. This operation requires the + * certificates/manageissuers/getissuers permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {buffer} secretBundleBackup The backup blob associated with a secret - * bundle. - * * @param {object} [options] Optional Parameters. * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - restoreSecretWithHttpOperationResponse(vaultBaseUrl, secretBundleBackup, options) { + getCertificateIssuersWithHttpOperationResponse(vaultBaseUrl, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._restoreSecret(vaultBaseUrl, secretBundleBackup, options, (err, result, request, response) => { + self._getCertificateIssuers(vaultBaseUrl, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -16916,19 +19600,20 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Restores a backed up secret to a vault. + * @summary List certificate issuers for a specified key vault. * - * Restores a backed up secret, and all its versions, to a vault. This - * operation requires the secrets/restore permission. + * The GetCertificateIssuers operation returns the set of certificate issuer + * resources in the specified key vault. This operation requires the + * certificates/manageissuers/getissuers permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {buffer} secretBundleBackup The backup blob associated with a secret - * bundle. - * * @param {object} [options] Optional Parameters. * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -16939,7 +19624,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {SecretBundle} - The deserialized result object. + * @resolve {CertificateIssuerListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -16948,13 +19633,14 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SecretBundle} for more information. + * See {@link CertificateIssuerListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - restoreSecret(vaultBaseUrl, secretBundleBackup, options, optionalCallback) { + getCertificateIssuers(vaultBaseUrl, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -16963,46 +19649,68 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._restoreSecret(vaultBaseUrl, secretBundleBackup, options, (err, result, request, response) => { + self._getCertificateIssuers(vaultBaseUrl, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._restoreSecret(vaultBaseUrl, secretBundleBackup, options, optionalCallback); + return self._getCertificateIssuers(vaultBaseUrl, options, optionalCallback); } } /** - * @summary List certificates in a specified key vault + * @summary Sets the specified certificate issuer. * - * The GetCertificates operation returns the set of certificates resources in - * the specified key vault. This operation requires the certificates/list - * permission. + * The SetCertificateIssuer operation adds or updates the specified certificate + * issuer. This operation requires the certificates/setissuers permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * + * @param {string} issuerName The name of the issuer. + * + * @param {string} provider The issuer provider. + * * @param {object} [options] Optional Parameters. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. + * @param {object} [options.credentials] The credentials to be used for the + * issuer. + * + * @param {string} [options.credentials.accountId] The user name/account + * name/account id. + * + * @param {string} [options.credentials.password] The password/secret/account + * key. + * + * @param {object} [options.organizationDetails] Details of the organization as + * provided to the issuer. + * + * @param {string} [options.organizationDetails.id] Id of the organization. + * + * @param {array} [options.organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @param {object} [options.attributes] Attributes of the issuer object. + * + * @param {boolean} [options.attributes.enabled] Determines whether the issuer + * is enabled. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getCertificatesWithHttpOperationResponse(vaultBaseUrl, options) { + setCertificateIssuerWithHttpOperationResponse(vaultBaseUrl, issuerName, provider, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getCertificates(vaultBaseUrl, options, (err, result, request, response) => { + self._setCertificateIssuer(vaultBaseUrl, issuerName, provider, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -17013,19 +19721,41 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary List certificates in a specified key vault + * @summary Sets the specified certificate issuer. * - * The GetCertificates operation returns the set of certificates resources in - * the specified key vault. This operation requires the certificates/list - * permission. + * The SetCertificateIssuer operation adds or updates the specified certificate + * issuer. This operation requires the certificates/setissuers permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * + * @param {string} issuerName The name of the issuer. + * + * @param {string} provider The issuer provider. + * * @param {object} [options] Optional Parameters. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. + * @param {object} [options.credentials] The credentials to be used for the + * issuer. + * + * @param {string} [options.credentials.accountId] The user name/account + * name/account id. + * + * @param {string} [options.credentials.password] The password/secret/account + * key. + * + * @param {object} [options.organizationDetails] Details of the organization as + * provided to the issuer. + * + * @param {string} [options.organizationDetails.id] Id of the organization. + * + * @param {array} [options.organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @param {object} [options.attributes] Attributes of the issuer object. + * + * @param {boolean} [options.attributes.enabled] Determines whether the issuer + * is enabled. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17037,7 +19767,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {CertificateListResult} - The deserialized result object. + * @resolve {IssuerBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -17046,13 +19776,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CertificateListResult} for more information. + * See {@link IssuerBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getCertificates(vaultBaseUrl, options, optionalCallback) { + setCertificateIssuer(vaultBaseUrl, issuerName, provider, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -17061,46 +19791,69 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getCertificates(vaultBaseUrl, options, (err, result, request, response) => { + self._setCertificateIssuer(vaultBaseUrl, issuerName, provider, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getCertificates(vaultBaseUrl, options, optionalCallback); + return self._setCertificateIssuer(vaultBaseUrl, issuerName, provider, options, optionalCallback); } } /** - * @summary Deletes a certificate from a specified key vault. + * @summary Updates the specified certificate issuer. * - * 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. + * The UpdateCertificateIssuer operation performs an update on the specified + * certificate issuer entity. This operation requires the + * certificates/setissuers permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate. + * @param {string} issuerName The name of the issuer. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.provider] The issuer provider. + * + * @param {object} [options.credentials] The credentials to be used for the + * issuer. + * + * @param {string} [options.credentials.accountId] The user name/account + * name/account id. + * + * @param {string} [options.credentials.password] The password/secret/account + * key. + * + * @param {object} [options.organizationDetails] Details of the organization as + * provided to the issuer. + * + * @param {string} [options.organizationDetails.id] Id of the organization. + * + * @param {array} [options.organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @param {object} [options.attributes] Attributes of the issuer object. + * + * @param {boolean} [options.attributes.enabled] Determines whether the issuer + * is enabled. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + updateCertificateIssuerWithHttpOperationResponse(vaultBaseUrl, issuerName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deleteCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + self._updateCertificateIssuer(vaultBaseUrl, issuerName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -17111,20 +19864,43 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Deletes a certificate from a specified key vault. + * @summary Updates the specified certificate issuer. * - * 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. + * The UpdateCertificateIssuer operation performs an update on the specified + * certificate issuer entity. This operation requires the + * certificates/setissuers permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate. + * @param {string} issuerName The name of the issuer. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.provider] The issuer provider. + * + * @param {object} [options.credentials] The credentials to be used for the + * issuer. + * + * @param {string} [options.credentials.accountId] The user name/account + * name/account id. + * + * @param {string} [options.credentials.password] The password/secret/account + * key. + * + * @param {object} [options.organizationDetails] Details of the organization as + * provided to the issuer. + * + * @param {string} [options.organizationDetails.id] Id of the organization. + * + * @param {array} [options.organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @param {object} [options.attributes] Attributes of the issuer object. + * + * @param {boolean} [options.attributes.enabled] Determines whether the issuer + * is enabled. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -17135,7 +19911,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {DeletedCertificateBundle} - The deserialized result object. + * @resolve {IssuerBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -17144,14 +19920,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeletedCertificateBundle} for more - * information. + * See {@link IssuerBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteCertificate(vaultBaseUrl, certificateName, options, optionalCallback) { + updateCertificateIssuer(vaultBaseUrl, issuerName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -17160,30 +19935,28 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + self._updateCertificateIssuer(vaultBaseUrl, issuerName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteCertificate(vaultBaseUrl, certificateName, options, optionalCallback); + return self._updateCertificateIssuer(vaultBaseUrl, issuerName, options, optionalCallback); } } /** - * @summary Sets the certificate contacts for the specified key vault. + * @summary Lists the specified certificate issuer. * - * Sets the certificate contacts for the specified key vault. This operation - * requires the certificates/managecontacts permission. + * The GetCertificateIssuer operation returns the specified certificate issuer + * resources in the specified key vault. This operation requires the + * certificates/manageissuers/getissuers permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {object} contacts The contacts for the key vault certificate. - * - * @param {array} [contacts.contactList] The contact list for the vault - * certificates. + * @param {string} issuerName The name of the issuer. * * @param {object} [options] Optional Parameters. * @@ -17192,15 +19965,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - setCertificateContactsWithHttpOperationResponse(vaultBaseUrl, contacts, options) { + getCertificateIssuerWithHttpOperationResponse(vaultBaseUrl, issuerName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._setCertificateContacts(vaultBaseUrl, contacts, options, (err, result, request, response) => { + self._getCertificateIssuer(vaultBaseUrl, issuerName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -17211,18 +19984,16 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Sets the certificate contacts for the specified key vault. + * @summary Lists the specified certificate issuer. * - * Sets the certificate contacts for the specified key vault. This operation - * requires the certificates/managecontacts permission. + * The GetCertificateIssuer operation returns the specified certificate issuer + * resources in the specified key vault. This operation requires the + * certificates/manageissuers/getissuers permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {object} contacts The contacts for the key vault certificate. - * - * @param {array} [contacts.contactList] The contact list for the vault - * certificates. + * @param {string} issuerName The name of the issuer. * * @param {object} [options] Optional Parameters. * @@ -17236,7 +20007,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Contacts} - The deserialized result object. + * @resolve {IssuerBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -17245,13 +20016,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Contacts} for more information. + * See {@link IssuerBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - setCertificateContacts(vaultBaseUrl, contacts, options, optionalCallback) { + getCertificateIssuer(vaultBaseUrl, issuerName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -17260,27 +20031,29 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._setCertificateContacts(vaultBaseUrl, contacts, options, (err, result, request, response) => { + self._getCertificateIssuer(vaultBaseUrl, issuerName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._setCertificateContacts(vaultBaseUrl, contacts, options, optionalCallback); + return self._getCertificateIssuer(vaultBaseUrl, issuerName, options, optionalCallback); } } /** - * @summary Lists the certificate contacts for a specified key vault. + * @summary Deletes the specified certificate issuer. * - * The GetCertificateContacts operation returns the set of certificate contact - * resources in the specified key vault. This operation requires the - * certificates/managecontacts permission. + * The DeleteCertificateIssuer operation permanently removes the specified + * certificate issuer from the vault. This operation requires the + * certificates/manageissuers/deleteissuers permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * + * @param {string} issuerName The name of the issuer. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -17288,15 +20061,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getCertificateContactsWithHttpOperationResponse(vaultBaseUrl, options) { + deleteCertificateIssuerWithHttpOperationResponse(vaultBaseUrl, issuerName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getCertificateContacts(vaultBaseUrl, options, (err, result, request, response) => { + self._deleteCertificateIssuer(vaultBaseUrl, issuerName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -17307,15 +20080,17 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Lists the certificate contacts for a specified key vault. + * @summary Deletes the specified certificate issuer. * - * The GetCertificateContacts operation returns the set of certificate contact - * resources in the specified key vault. This operation requires the - * certificates/managecontacts permission. + * The DeleteCertificateIssuer operation permanently removes the specified + * certificate issuer from the vault. This operation requires the + * certificates/manageissuers/deleteissuers permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * + * @param {string} issuerName The name of the issuer. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -17328,7 +20103,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Contacts} - The deserialized result object. + * @resolve {IssuerBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -17337,13 +20112,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Contacts} for more information. + * See {@link IssuerBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getCertificateContacts(vaultBaseUrl, options, optionalCallback) { + deleteCertificateIssuer(vaultBaseUrl, issuerName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -17352,42 +20127,142 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getCertificateContacts(vaultBaseUrl, options, (err, result, request, response) => { + self._deleteCertificateIssuer(vaultBaseUrl, issuerName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getCertificateContacts(vaultBaseUrl, options, optionalCallback); + return self._deleteCertificateIssuer(vaultBaseUrl, issuerName, options, optionalCallback); } } /** - * @summary Deletes the certificate contacts for a specified key vault. + * @summary Creates a new certificate. * - * Deletes the certificate contacts for a specified key vault certificate. This - * operation requires the certificates/managecontacts permission. + * If this is the first version, the certificate resource is created. This + * operation requires the certificates/create permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * + * @param {string} certificateName The name of the certificate. + * * @param {object} [options] Optional Parameters. * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate. + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhanced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will + * be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerParameters] Parameters for + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerParameters.name] Name of + * the referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [options.certificatePolicy.issuerParameters.certificateType] + * Type of certificate to be requested from the issuer provider. + * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteCertificateContactsWithHttpOperationResponse(vaultBaseUrl, options) { + createCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deleteCertificateContacts(vaultBaseUrl, options, (err, result, request, response) => { + self._createCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -17398,15 +20273,115 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Deletes the certificate contacts for a specified key vault. + * @summary Creates a new certificate. * - * Deletes the certificate contacts for a specified key vault certificate. This - * operation requires the certificates/managecontacts permission. + * If this is the first version, the certificate resource is created. This + * operation requires the certificates/create permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {object} [options] Optional Parameters. + * @param {string} certificateName The name of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate. + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhanced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will + * be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerParameters] Parameters for + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerParameters.name] Name of + * the referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [options.certificatePolicy.issuerParameters.certificateType] + * Type of certificate to be requested from the issuer provider. + * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17418,7 +20393,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {Contacts} - The deserialized result object. + * @resolve {CertificateOperation} - The deserialized result object. * * @reject {Error} - The error object. * @@ -17427,13 +20402,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Contacts} for more information. + * See {@link CertificateOperation} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteCertificateContacts(vaultBaseUrl, options, optionalCallback) { + createCertificate(vaultBaseUrl, certificateName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -17442,167 +20417,152 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteCertificateContacts(vaultBaseUrl, options, (err, result, request, response) => { + self._createCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteCertificateContacts(vaultBaseUrl, options, optionalCallback); + return self._createCertificate(vaultBaseUrl, certificateName, options, optionalCallback); } } /** - * @summary List certificate issuers for a specified key vault. + * @summary Imports a certificate into 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. + * 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. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. + * @param {string} certificateName The name of the certificate. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} base64EncodedCertificate Base64 encoded representation of + * the certificate object to import. This certificate needs to contain the + * private key. * - * @returns {Promise} A promise is returned + * @param {object} [options] Optional Parameters. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [options.password] If the private key in + * base64EncodedCertificate is encrypted, the password used for encryption. * - * @reject {Error} - The error object. - */ - getCertificateIssuersWithHttpOperationResponse(vaultBaseUrl, options) { - let client = this; - let self = this; - return new Promise((resolve, reject) => { - self._getCertificateIssuers(vaultBaseUrl, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary List certificate issuers for a specified key vault. + * @param {object} [options.certificatePolicy] The management policy for the + * certificate. * - * The GetCertificateIssuers operation returns the set of certificate issuer - * resources in the specified key vault. This operation requires the - * certificates/manageissuers/getissuers permission. + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. * - * @param {string} vaultBaseUrl The vault name, for example - * https://myvault.vault.azure.net. + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bits. For example: 2048, 3072, or 4096 for RSA. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. * - * @param {function} [optionalCallback] - The optional callback. + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. * - * {Promise} A promise is returned + * @param {string} [options.certificatePolicy.secretProperties.contentType] The + * media type (MIME type). * - * @resolve {CertificateIssuerListResult} - The deserialized result object. + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. * - * @reject {Error} - The error object. + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. * - * {function} optionalCallback(err, result, request, response) + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhanced key usage. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CertificateIssuerListResult} for more - * information. + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getCertificateIssuers(vaultBaseUrl, options, optionalCallback) { - let client = this; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getCertificateIssuers(vaultBaseUrl, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getCertificateIssuers(vaultBaseUrl, options, optionalCallback); - } - } - - /** - * @summary Sets the specified certificate issuer. + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. * - * The SetCertificateIssuer operation adds or updates the specified certificate - * issuer. This operation requires the certificates/setissuers permission. + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. * - * @param {string} vaultBaseUrl The vault name, for example - * https://myvault.vault.azure.net. + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. * - * @param {string} issuerName The name of the issuer. + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will + * be performed by Key Vault over the lifetime of a certificate. * - * @param {string} provider The issuer provider. + * @param {object} [options.certificatePolicy.issuerParameters] Parameters for + * the issuer of the X509 component of a certificate. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.certificatePolicy.issuerParameters.name] Name of + * the referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. * - * @param {object} [options.credentials] The credentials to be used for the - * issuer. + * @param {string} [options.certificatePolicy.issuerParameters.certificateType] + * Type of certificate to be requested from the issuer provider. * - * @param {string} [options.credentials.accountId] The user name/account - * name/account id. + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. * - * @param {string} [options.credentials.password] The password/secret/account - * key. + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. * - * @param {object} [options.organizationDetails] Details of the organization as - * provided to the issuer. + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). * - * @param {string} [options.organizationDetails.id] Id of the organization. + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. * - * @param {array} [options.organizationDetails.adminDetails] Details of the - * organization administrator. + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. * - * @param {object} [options.attributes] Attributes of the issuer object. + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. * - * @param {boolean} [options.attributes.enabled] Determines whether the issuer - * is enabled. + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - setCertificateIssuerWithHttpOperationResponse(vaultBaseUrl, issuerName, provider, options) { + importCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, base64EncodedCertificate, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._setCertificateIssuer(vaultBaseUrl, issuerName, provider, options, (err, result, request, response) => { + self._importCertificate(vaultBaseUrl, certificateName, base64EncodedCertificate, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -17613,41 +20573,125 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Sets the specified certificate issuer. + * @summary Imports a certificate into a specified key vault. + * + * 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. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate. + * + * @param {string} base64EncodedCertificate Base64 encoded representation of + * the certificate object to import. This certificate needs to contain the + * private key. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.password] If the private key in + * base64EncodedCertificate is encrypted, the password used for encryption. + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate. + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] The + * media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhanced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. * - * The SetCertificateIssuer operation adds or updates the specified certificate - * issuer. This operation requires the certificates/setissuers permission. + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. * - * @param {string} vaultBaseUrl The vault name, for example - * https://myvault.vault.azure.net. + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. * - * @param {string} issuerName The name of the issuer. + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * duration that the ceritifcate is valid in months. * - * @param {string} provider The issuer provider. + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will + * be performed by Key Vault over the lifetime of a certificate. * - * @param {object} [options] Optional Parameters. + * @param {object} [options.certificatePolicy.issuerParameters] Parameters for + * the issuer of the X509 component of a certificate. * - * @param {object} [options.credentials] The credentials to be used for the - * issuer. + * @param {string} [options.certificatePolicy.issuerParameters.name] Name of + * the referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. * - * @param {string} [options.credentials.accountId] The user name/account - * name/account id. + * @param {string} [options.certificatePolicy.issuerParameters.certificateType] + * Type of certificate to be requested from the issuer provider. * - * @param {string} [options.credentials.password] The password/secret/account - * key. + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. * - * @param {object} [options.organizationDetails] Details of the organization as - * provided to the issuer. + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. * - * @param {string} [options.organizationDetails.id] Id of the organization. + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). * - * @param {array} [options.organizationDetails.adminDetails] Details of the - * organization administrator. + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. * - * @param {object} [options.attributes] Attributes of the issuer object. + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. * - * @param {boolean} [options.attributes.enabled] Determines whether the issuer - * is enabled. + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17659,7 +20703,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {IssuerBundle} - The deserialized result object. + * @resolve {CertificateBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -17668,13 +20712,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link IssuerBundle} for more information. + * See {@link CertificateBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - setCertificateIssuer(vaultBaseUrl, issuerName, provider, options, optionalCallback) { + importCertificate(vaultBaseUrl, certificateName, base64EncodedCertificate, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -17683,69 +20727,48 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._setCertificateIssuer(vaultBaseUrl, issuerName, provider, options, (err, result, request, response) => { + self._importCertificate(vaultBaseUrl, certificateName, base64EncodedCertificate, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._setCertificateIssuer(vaultBaseUrl, issuerName, provider, options, optionalCallback); + return self._importCertificate(vaultBaseUrl, certificateName, base64EncodedCertificate, options, optionalCallback); } } /** - * @summary Updates the specified certificate issuer. + * @summary List the versions of a certificate. * - * The UpdateCertificateIssuer operation performs an update on the specified - * certificate issuer entity. This operation requires the - * certificates/setissuers permission. + * The GetCertificateVersions operation returns the versions of a certificate + * in the specified key vault. This operation requires the certificates/list + * permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} issuerName The name of the issuer. + * @param {string} certificateName The name of the certificate. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.provider] The issuer provider. - * - * @param {object} [options.credentials] The credentials to be used for the - * issuer. - * - * @param {string} [options.credentials.accountId] The user name/account - * name/account id. - * - * @param {string} [options.credentials.password] The password/secret/account - * key. - * - * @param {object} [options.organizationDetails] Details of the organization as - * provided to the issuer. - * - * @param {string} [options.organizationDetails.id] Id of the organization. - * - * @param {array} [options.organizationDetails.adminDetails] Details of the - * organization administrator. - * - * @param {object} [options.attributes] Attributes of the issuer object. - * - * @param {boolean} [options.attributes.enabled] Determines whether the issuer - * is enabled. + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - updateCertificateIssuerWithHttpOperationResponse(vaultBaseUrl, issuerName, options) { + getCertificateVersionsWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._updateCertificateIssuer(vaultBaseUrl, issuerName, options, (err, result, request, response) => { + self._getCertificateVersions(vaultBaseUrl, certificateName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -17756,42 +20779,21 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Updates the specified certificate issuer. + * @summary List the versions of a certificate. * - * The UpdateCertificateIssuer operation performs an update on the specified - * certificate issuer entity. This operation requires the - * certificates/setissuers permission. + * The GetCertificateVersions operation returns the versions of a certificate + * in the specified key vault. This operation requires the certificates/list + * permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} issuerName The name of the issuer. + * @param {string} certificateName The name of the certificate. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.provider] The issuer provider. - * - * @param {object} [options.credentials] The credentials to be used for the - * issuer. - * - * @param {string} [options.credentials.accountId] The user name/account - * name/account id. - * - * @param {string} [options.credentials.password] The password/secret/account - * key. - * - * @param {object} [options.organizationDetails] Details of the organization as - * provided to the issuer. - * - * @param {string} [options.organizationDetails.id] Id of the organization. - * - * @param {array} [options.organizationDetails.adminDetails] Details of the - * organization administrator. - * - * @param {object} [options.attributes] Attributes of the issuer object. - * - * @param {boolean} [options.attributes.enabled] Determines whether the issuer - * is enabled. + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17803,7 +20805,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {IssuerBundle} - The deserialized result object. + * @resolve {CertificateListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -17812,13 +20814,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link IssuerBundle} for more information. + * See {@link CertificateListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - updateCertificateIssuer(vaultBaseUrl, issuerName, options, optionalCallback) { + getCertificateVersions(vaultBaseUrl, certificateName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -17827,28 +20829,29 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateCertificateIssuer(vaultBaseUrl, issuerName, options, (err, result, request, response) => { + self._getCertificateVersions(vaultBaseUrl, certificateName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateCertificateIssuer(vaultBaseUrl, issuerName, options, optionalCallback); + return self._getCertificateVersions(vaultBaseUrl, certificateName, options, optionalCallback); } } /** - * @summary Lists the specified certificate issuer. + * @summary Lists the policy for a certificate. * - * The GetCertificateIssuer operation returns the specified certificate issuer + * The GetCertificatePolicy operation returns the specified certificate policy * resources in the specified key vault. This operation requires the - * certificates/manageissuers/getissuers permission. + * certificates/get permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} issuerName The name of the issuer. + * @param {string} certificateName The name of the certificate in a given key + * vault. * * @param {object} [options] Optional Parameters. * @@ -17857,15 +20860,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getCertificateIssuerWithHttpOperationResponse(vaultBaseUrl, issuerName, options) { + getCertificatePolicyWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getCertificateIssuer(vaultBaseUrl, issuerName, options, (err, result, request, response) => { + self._getCertificatePolicy(vaultBaseUrl, certificateName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -17876,16 +20879,17 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Lists the specified certificate issuer. + * @summary Lists the policy for a certificate. * - * The GetCertificateIssuer operation returns the specified certificate issuer + * The GetCertificatePolicy operation returns the specified certificate policy * resources in the specified key vault. This operation requires the - * certificates/manageissuers/getissuers permission. + * certificates/get permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} issuerName The name of the issuer. + * @param {string} certificateName The name of the certificate in a given key + * vault. * * @param {object} [options] Optional Parameters. * @@ -17899,7 +20903,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {IssuerBundle} - The deserialized result object. + * @resolve {CertificatePolicy} - The deserialized result object. * * @reject {Error} - The error object. * @@ -17908,13 +20912,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link IssuerBundle} for more information. + * See {@link CertificatePolicy} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getCertificateIssuer(vaultBaseUrl, issuerName, options, optionalCallback) { + getCertificatePolicy(vaultBaseUrl, certificateName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -17923,28 +20927,116 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getCertificateIssuer(vaultBaseUrl, issuerName, options, (err, result, request, response) => { + self._getCertificatePolicy(vaultBaseUrl, certificateName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getCertificateIssuer(vaultBaseUrl, issuerName, options, optionalCallback); + return self._getCertificatePolicy(vaultBaseUrl, certificateName, options, optionalCallback); } } /** - * @summary Deletes the specified certificate issuer. + * @summary Updates the policy for a certificate. + * + * Set specified members in the certificate policy. Leave others as null. This + * operation requires the certificates/update permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in the given + * vault. + * + * @param {object} certificatePolicy The policy for the certificate. + * + * @param {object} [certificatePolicy.keyProperties] Properties of the key + * backing a certificate. + * + * @param {boolean} [certificatePolicy.keyProperties.exportable] Indicates if + * the private key can be exported. + * + * @param {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [certificatePolicy.keyProperties.keySize] The key size in + * bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if the + * same key pair will be used on certificate renewal. + * + * @param {string} [certificatePolicy.keyProperties.curve] Elliptic curve name. + * For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', + * 'P-384', 'P-521', 'P-256K' + * + * @param {object} [certificatePolicy.secretProperties] Properties of the + * secret backing a certificate. + * + * @param {string} [certificatePolicy.secretProperties.contentType] The media + * type (MIME type). + * + * @param {object} [certificatePolicy.x509CertificateProperties] Properties of + * the X509 component of a certificate. + * + * @param {string} [certificatePolicy.x509CertificateProperties.subject] The + * subject name. Should be a valid X509 distinguished Name. + * + * @param {array} [certificatePolicy.x509CertificateProperties.ekus] The + * enhanced key usage. + * + * @param {object} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} [certificatePolicy.x509CertificateProperties.keyUsage] List + * of key usages. + * + * @param {number} + * [certificatePolicy.x509CertificateProperties.validityInMonths] The duration + * that the ceritifcate is valid in months. + * + * @param {array} [certificatePolicy.lifetimeActions] Actions that will be + * performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [certificatePolicy.issuerParameters] Parameters for the + * issuer of the X509 component of a certificate. + * + * @param {string} [certificatePolicy.issuerParameters.name] Name of the + * referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. * - * The DeleteCertificateIssuer operation permanently removes the specified - * certificate issuer from the vault. This operation requires the - * certificates/manageissuers/deleteissuers permission. + * @param {string} [certificatePolicy.issuerParameters.certificateType] Type of + * certificate to be requested from the issuer provider. * - * @param {string} vaultBaseUrl The vault name, for example - * https://myvault.vault.azure.net. + * @param {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. * - * @param {string} issuerName The name of the issuer. + * @param {object} [certificatePolicy.attributes] The certificate attributes. + * + * @param {boolean} [certificatePolicy.attributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [certificatePolicy.attributes.notBefore] Not before date in + * UTC. + * + * @param {date} [certificatePolicy.attributes.expires] Expiry date in UTC. * * @param {object} [options] Optional Parameters. * @@ -17953,15 +21045,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteCertificateIssuerWithHttpOperationResponse(vaultBaseUrl, issuerName, options) { + updateCertificatePolicyWithHttpOperationResponse(vaultBaseUrl, certificateName, certificatePolicy, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deleteCertificateIssuer(vaultBaseUrl, issuerName, options, (err, result, request, response) => { + self._updateCertificatePolicy(vaultBaseUrl, certificateName, certificatePolicy, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -17972,16 +21064,104 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Deletes the specified certificate issuer. + * @summary Updates the policy for a certificate. * - * The DeleteCertificateIssuer operation permanently removes the specified - * certificate issuer from the vault. This operation requires the - * certificates/manageissuers/deleteissuers permission. + * Set specified members in the certificate policy. Leave others as null. This + * operation requires the certificates/update permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} issuerName The name of the issuer. + * @param {string} certificateName The name of the certificate in the given + * vault. + * + * @param {object} certificatePolicy The policy for the certificate. + * + * @param {object} [certificatePolicy.keyProperties] Properties of the key + * backing a certificate. + * + * @param {boolean} [certificatePolicy.keyProperties.exportable] Indicates if + * the private key can be exported. + * + * @param {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * + * @param {number} [certificatePolicy.keyProperties.keySize] The key size in + * bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if the + * same key pair will be used on certificate renewal. + * + * @param {string} [certificatePolicy.keyProperties.curve] Elliptic curve name. + * For valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', + * 'P-384', 'P-521', 'P-256K' + * + * @param {object} [certificatePolicy.secretProperties] Properties of the + * secret backing a certificate. + * + * @param {string} [certificatePolicy.secretProperties.contentType] The media + * type (MIME type). + * + * @param {object} [certificatePolicy.x509CertificateProperties] Properties of + * the X509 component of a certificate. + * + * @param {string} [certificatePolicy.x509CertificateProperties.subject] The + * subject name. Should be a valid X509 distinguished Name. + * + * @param {array} [certificatePolicy.x509CertificateProperties.ekus] The + * enhanced key usage. + * + * @param {object} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} [certificatePolicy.x509CertificateProperties.keyUsage] List + * of key usages. + * + * @param {number} + * [certificatePolicy.x509CertificateProperties.validityInMonths] The duration + * that the ceritifcate is valid in months. + * + * @param {array} [certificatePolicy.lifetimeActions] Actions that will be + * performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [certificatePolicy.issuerParameters] Parameters for the + * issuer of the X509 component of a certificate. + * + * @param {string} [certificatePolicy.issuerParameters.name] Name of the + * referenced issuer object or reserved names; for example, 'Self' or + * 'Unknown'. + * + * @param {string} [certificatePolicy.issuerParameters.certificateType] Type of + * certificate to be requested from the issuer provider. + * + * @param {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. + * + * @param {object} [certificatePolicy.attributes] The certificate attributes. + * + * @param {boolean} [certificatePolicy.attributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [certificatePolicy.attributes.notBefore] Not before date in + * UTC. + * + * @param {date} [certificatePolicy.attributes.expires] Expiry date in UTC. * * @param {object} [options] Optional Parameters. * @@ -17995,7 +21175,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {IssuerBundle} - The deserialized result object. + * @resolve {CertificatePolicy} - The deserialized result object. * * @reject {Error} - The error object. * @@ -18004,13 +21184,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link IssuerBundle} for more information. + * See {@link CertificatePolicy} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteCertificateIssuer(vaultBaseUrl, issuerName, options, optionalCallback) { + updateCertificatePolicy(vaultBaseUrl, certificateName, certificatePolicy, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -18019,27 +21199,32 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteCertificateIssuer(vaultBaseUrl, issuerName, options, (err, result, request, response) => { + self._updateCertificatePolicy(vaultBaseUrl, certificateName, certificatePolicy, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteCertificateIssuer(vaultBaseUrl, issuerName, options, optionalCallback); + return self._updateCertificatePolicy(vaultBaseUrl, certificateName, certificatePolicy, options, optionalCallback); } } /** - * @summary Creates a new certificate. + * @summary Updates the specified attributes associated with the given + * certificate. * - * If this is the first version, the certificate resource is created. This - * operation requires the certificates/create permission. + * 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. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate. + * @param {string} certificateName The name of the certificate in the given key + * vault. + * + * @param {string} certificateVersion The version of the certificate. * * @param {object} [options] Optional Parameters. * @@ -18052,8 +21237,9 @@ class KeyVaultClient extends ServiceClient { * @param {boolean} [options.certificatePolicy.keyProperties.exportable] * Indicates if the private key can be exported. * - * @param {string} [options.certificatePolicy.keyProperties.keyType] The key - * type. + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * * @param {number} [options.certificatePolicy.keyProperties.keySize] The key * size in bits. For example: 2048, 3072, or 4096 for RSA. @@ -18061,6 +21247,10 @@ class KeyVaultClient extends ServiceClient { * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] * Indicates if the same key pair will be used on certificate renewal. * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * * @param {object} [options.certificatePolicy.secretProperties] Properties of * the secret backing a certificate. * @@ -18114,6 +21304,11 @@ class KeyVaultClient extends ServiceClient { * @param {string} [options.certificatePolicy.issuerParameters.certificateType] * Type of certificate to be requested from the issuer provider. * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * * @param {object} [options.certificatePolicy.attributes] The certificate * attributes. * @@ -18136,15 +21331,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + updateCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, certificateVersion, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._createCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + self._updateCertificate(vaultBaseUrl, certificateName, certificateVersion, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -18155,15 +21350,20 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Creates a new certificate. + * @summary Updates the specified attributes associated with the given + * certificate. * - * If this is the first version, the certificate resource is created. This - * operation requires the certificates/create permission. + * 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. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate. + * @param {string} certificateName The name of the certificate in the given key + * vault. + * + * @param {string} certificateVersion The version of the certificate. * * @param {object} [options] Optional Parameters. * @@ -18176,8 +21376,9 @@ class KeyVaultClient extends ServiceClient { * @param {boolean} [options.certificatePolicy.keyProperties.exportable] * Indicates if the private key can be exported. * - * @param {string} [options.certificatePolicy.keyProperties.keyType] The key - * type. + * @param {string} [options.certificatePolicy.keyProperties.keyType] The type + * of key pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * * @param {number} [options.certificatePolicy.keyProperties.keySize] The key * size in bits. For example: 2048, 3072, or 4096 for RSA. @@ -18185,6 +21386,10 @@ class KeyVaultClient extends ServiceClient { * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] * Indicates if the same key pair will be used on certificate renewal. * + * @param {string} [options.certificatePolicy.keyProperties.curve] Elliptic + * curve name. For valid values, see JsonWebKeyCurveName. Possible values + * include: 'P-256', 'P-384', 'P-521', 'P-256K' + * * @param {object} [options.certificatePolicy.secretProperties] Properties of * the secret backing a certificate. * @@ -18238,6 +21443,11 @@ class KeyVaultClient extends ServiceClient { * @param {string} [options.certificatePolicy.issuerParameters.certificateType] * Type of certificate to be requested from the issuer provider. * + * @param {boolean} + * [options.certificatePolicy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. + * * @param {object} [options.certificatePolicy.attributes] The certificate * attributes. * @@ -18247,13 +21457,113 @@ class KeyVaultClient extends ServiceClient { * @param {boolean} [options.certificateAttributes.enabled] Determines whether * the object is enabled. * - * @param {date} [options.certificateAttributes.notBefore] Not before date in - * UTC. + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {CertificateBundle} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateCertificate(vaultBaseUrl, certificateName, certificateVersion, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updateCertificate(vaultBaseUrl, certificateName, certificateVersion, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateCertificate(vaultBaseUrl, certificateName, certificateVersion, options, optionalCallback); + } + } + + /** + * @summary Gets information about a certificate. + * + * Gets information about a specific certificate. This operation requires the + * certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in the given + * vault. + * + * @param {string} certificateVersion The version of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, certificateVersion, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getCertificate(vaultBaseUrl, certificateName, certificateVersion, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets information about a certificate. + * + * Gets information about a specific certificate. This operation requires the + * certificates/get permission. + * + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. + * + * @param {string} certificateName The name of the certificate in the given + * vault. * - * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * @param {string} certificateVersion The version of the certificate. * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -18265,7 +21575,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {CertificateOperation} - The deserialized result object. + * @resolve {CertificateBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -18274,13 +21584,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CertificateOperation} for more information. + * See {@link CertificateBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createCertificate(vaultBaseUrl, certificateName, options, optionalCallback) { + getCertificate(vaultBaseUrl, certificateName, certificateVersion, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -18289,142 +21599,47 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + self._getCertificate(vaultBaseUrl, certificateName, certificateVersion, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createCertificate(vaultBaseUrl, certificateName, options, optionalCallback); + return self._getCertificate(vaultBaseUrl, certificateName, certificateVersion, options, optionalCallback); } } /** - * @summary Imports a certificate into a specified key vault. + * @summary Updates a certificate operation. * - * 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. + * Updates a certificate creation operation that is already in progress. This + * operation requires the certificates/update permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} certificateName The name of the certificate. * - * @param {string} base64EncodedCertificate Base64 encoded representation of - * the certificate object to import. This certificate needs to contain the - * private key. + * @param {boolean} cancellationRequested Indicates if cancellation was + * requested on the certificate operation. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.password] If the private key in - * base64EncodedCertificate is encrypted, the password used for encryption. - * - * @param {object} [options.certificatePolicy] The management policy for the - * certificate. - * - * @param {object} [options.certificatePolicy.keyProperties] Properties of the - * key backing a certificate. - * - * @param {boolean} [options.certificatePolicy.keyProperties.exportable] - * Indicates if the private key can be exported. - * - * @param {string} [options.certificatePolicy.keyProperties.keyType] The key - * type. - * - * @param {number} [options.certificatePolicy.keyProperties.keySize] The key - * size in bits. For example: 2048, 3072, or 4096 for RSA. - * - * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] - * Indicates if the same key pair will be used on certificate renewal. - * - * @param {object} [options.certificatePolicy.secretProperties] Properties of - * the secret backing a certificate. - * - * @param {string} [options.certificatePolicy.secretProperties.contentType] The - * media type (MIME type). - * - * @param {object} [options.certificatePolicy.x509CertificateProperties] - * Properties of the X509 component of a certificate. - * - * @param {string} - * [options.certificatePolicy.x509CertificateProperties.subject] The subject - * name. Should be a valid X509 distinguished Name. - * - * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] - * The enhanced key usage. - * - * @param {object} - * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] - * The subject alternative names. - * - * @param {array} - * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] - * Email addresses. - * - * @param {array} - * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] - * Domain names. - * - * @param {array} - * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] - * User principal names. - * - * @param {array} - * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key - * usages. - * - * @param {number} - * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The - * duration that the ceritifcate is valid in months. - * - * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will - * be performed by Key Vault over the lifetime of a certificate. - * - * @param {object} [options.certificatePolicy.issuerParameters] Parameters for - * the issuer of the X509 component of a certificate. - * - * @param {string} [options.certificatePolicy.issuerParameters.name] Name of - * the referenced issuer object or reserved names; for example, 'Self' or - * 'Unknown'. - * - * @param {string} [options.certificatePolicy.issuerParameters.certificateType] - * Type of certificate to be requested from the issuer provider. - * - * @param {object} [options.certificatePolicy.attributes] The certificate - * attributes. - * - * @param {object} [options.certificateAttributes] The attributes of the - * certificate (optional). - * - * @param {boolean} [options.certificateAttributes.enabled] Determines whether - * the object is enabled. - * - * @param {date} [options.certificateAttributes.notBefore] Not before date in - * UTC. - * - * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. - * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - importCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, base64EncodedCertificate, options) { + updateCertificateOperationWithHttpOperationResponse(vaultBaseUrl, certificateName, cancellationRequested, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._importCertificate(vaultBaseUrl, certificateName, base64EncodedCertificate, options, (err, result, request, response) => { + self._updateCertificateOperation(vaultBaseUrl, certificateName, cancellationRequested, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -18435,115 +21650,114 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Imports a certificate into a specified key vault. + * @summary Updates a certificate operation. * - * 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. + * Updates a certificate creation operation that is already in progress. This + * operation requires the certificates/update permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} certificateName The name of the certificate. * - * @param {string} base64EncodedCertificate Base64 encoded representation of - * the certificate object to import. This certificate needs to contain the - * private key. + * @param {boolean} cancellationRequested Indicates if cancellation was + * requested on the certificate operation. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.password] If the private key in - * base64EncodedCertificate is encrypted, the password used for encryption. - * - * @param {object} [options.certificatePolicy] The management policy for the - * certificate. - * - * @param {object} [options.certificatePolicy.keyProperties] Properties of the - * key backing a certificate. - * - * @param {boolean} [options.certificatePolicy.keyProperties.exportable] - * Indicates if the private key can be exported. - * - * @param {string} [options.certificatePolicy.keyProperties.keyType] The key - * type. - * - * @param {number} [options.certificatePolicy.keyProperties.keySize] The key - * size in bits. For example: 2048, 3072, or 4096 for RSA. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] - * Indicates if the same key pair will be used on certificate renewal. + * @param {function} [optionalCallback] - The optional callback. * - * @param {object} [options.certificatePolicy.secretProperties] Properties of - * the secret backing a certificate. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {string} [options.certificatePolicy.secretProperties.contentType] The - * media type (MIME type). + * {Promise} A promise is returned * - * @param {object} [options.certificatePolicy.x509CertificateProperties] - * Properties of the X509 component of a certificate. + * @resolve {CertificateOperation} - The deserialized result object. * - * @param {string} - * [options.certificatePolicy.x509CertificateProperties.subject] The subject - * name. Should be a valid X509 distinguished Name. + * @reject {Error} - The error object. * - * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] - * The enhanced key usage. + * {function} optionalCallback(err, result, request, response) * - * @param {object} - * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] - * The subject alternative names. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {array} - * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] - * Email addresses. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateOperation} for more information. * - * @param {array} - * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] - * Domain names. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {array} - * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] - * User principal names. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateCertificateOperation(vaultBaseUrl, certificateName, cancellationRequested, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updateCertificateOperation(vaultBaseUrl, certificateName, cancellationRequested, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateCertificateOperation(vaultBaseUrl, certificateName, cancellationRequested, options, optionalCallback); + } + } + + /** + * @summary Gets the creation operation of a certificate. * - * @param {array} - * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key - * usages. + * Gets the creation operation associated with a specified certificate. This + * operation requires the certificates/get permission. * - * @param {number} - * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The - * duration that the ceritifcate is valid in months. + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. * - * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will - * be performed by Key Vault over the lifetime of a certificate. + * @param {string} certificateName The name of the certificate. * - * @param {object} [options.certificatePolicy.issuerParameters] Parameters for - * the issuer of the X509 component of a certificate. + * @param {object} [options] Optional Parameters. * - * @param {string} [options.certificatePolicy.issuerParameters.name] Name of - * the referenced issuer object or reserved names; for example, 'Self' or - * 'Unknown'. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [options.certificatePolicy.issuerParameters.certificateType] - * Type of certificate to be requested from the issuer provider. + * @returns {Promise} A promise is returned * - * @param {object} [options.certificatePolicy.attributes] The certificate - * attributes. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {object} [options.certificateAttributes] The attributes of the - * certificate (optional). + * @reject {Error} - The error object. + */ + getCertificateOperationWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getCertificateOperation(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the creation operation of a certificate. * - * @param {boolean} [options.certificateAttributes.enabled] Determines whether - * the object is enabled. + * Gets the creation operation associated with a specified certificate. This + * operation requires the certificates/get permission. * - * @param {date} [options.certificateAttributes.notBefore] Not before date in - * UTC. + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. * - * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * @param {string} certificateName The name of the certificate. * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -18555,7 +21769,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {CertificateBundle} - The deserialized result object. + * @resolve {CertificateOperation} - The deserialized result object. * * @reject {Error} - The error object. * @@ -18564,13 +21778,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CertificateBundle} for more information. + * See {@link CertificateOperation} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - importCertificate(vaultBaseUrl, certificateName, base64EncodedCertificate, options, optionalCallback) { + getCertificateOperation(vaultBaseUrl, certificateName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -18579,23 +21793,23 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._importCertificate(vaultBaseUrl, certificateName, base64EncodedCertificate, options, (err, result, request, response) => { + self._getCertificateOperation(vaultBaseUrl, certificateName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._importCertificate(vaultBaseUrl, certificateName, base64EncodedCertificate, options, optionalCallback); + return self._getCertificateOperation(vaultBaseUrl, certificateName, options, optionalCallback); } } /** - * @summary List the versions of a certificate. + * @summary Deletes the creation operation for a specific certificate. * - * The GetCertificateVersions operation returns the versions of a certificate - * in the specified key vault. This operation requires the certificates/list - * permission. + * 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 {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. @@ -18604,23 +21818,20 @@ class KeyVaultClient extends ServiceClient { * * @param {object} [options] Optional Parameters. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getCertificateVersionsWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + deleteCertificateOperationWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getCertificateVersions(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + self._deleteCertificateOperation(vaultBaseUrl, certificateName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -18631,11 +21842,11 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary List the versions of a certificate. + * @summary Deletes the creation operation for a specific certificate. * - * The GetCertificateVersions operation returns the versions of a certificate - * in the specified key vault. This operation requires the certificates/list - * permission. + * 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 {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. @@ -18644,9 +21855,6 @@ class KeyVaultClient extends ServiceClient { * * @param {object} [options] Optional Parameters. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -18657,7 +21865,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {CertificateListResult} - The deserialized result object. + * @resolve {CertificateOperation} - The deserialized result object. * * @reject {Error} - The error object. * @@ -18666,13 +21874,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CertificateListResult} for more information. + * See {@link CertificateOperation} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getCertificateVersions(vaultBaseUrl, certificateName, options, optionalCallback) { + deleteCertificateOperation(vaultBaseUrl, certificateName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -18681,46 +21889,63 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getCertificateVersions(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + self._deleteCertificateOperation(vaultBaseUrl, certificateName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getCertificateVersions(vaultBaseUrl, certificateName, options, optionalCallback); + return self._deleteCertificateOperation(vaultBaseUrl, certificateName, options, optionalCallback); } } /** - * @summary Lists the policy for a certificate. + * @summary Merges a certificate or a certificate chain with a key pair + * existing on the server. * - * The GetCertificatePolicy operation returns the specified certificate policy - * resources in the specified key vault. This operation requires the - * certificates/get permission. + * 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 {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate in a given key - * vault. + * @param {string} certificateName The name of the certificate. + * + * @param {array} x509Certificates The certificate or the certificate chain to + * merge. * * @param {object} [options] Optional Parameters. * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getCertificatePolicyWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + mergeCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, x509Certificates, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getCertificatePolicy(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + self._mergeCertificate(vaultBaseUrl, certificateName, x509Certificates, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -18731,20 +21956,37 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Lists the policy for a certificate. + * @summary Merges a certificate or a certificate chain with a key pair + * existing on the server. * - * The GetCertificatePolicy operation returns the specified certificate policy - * resources in the specified key vault. This operation requires the - * certificates/get permission. + * 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 {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate in a given key - * vault. + * @param {string} certificateName The name of the certificate. + * + * @param {array} x509Certificates The certificate or the certificate chain to + * merge. * * @param {object} [options] Optional Parameters. * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional). + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled. + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC. + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -18755,7 +21997,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {CertificatePolicy} - The deserialized result object. + * @resolve {CertificateBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -18764,13 +22006,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CertificatePolicy} for more information. + * See {@link CertificateBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getCertificatePolicy(vaultBaseUrl, certificateName, options, optionalCallback) { + mergeCertificate(vaultBaseUrl, certificateName, x509Certificates, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -18779,105 +22021,125 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getCertificatePolicy(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + self._mergeCertificate(vaultBaseUrl, certificateName, x509Certificates, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getCertificatePolicy(vaultBaseUrl, certificateName, options, optionalCallback); + return self._mergeCertificate(vaultBaseUrl, certificateName, x509Certificates, options, optionalCallback); } } /** - * @summary Updates the policy for a certificate. + * @summary Backs up the specified certificate. * - * Set specified members in the certificate policy. Leave others as null. This - * operation requires the certificates/update permission. + * 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 {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate in the given - * vault. - * - * @param {object} certificatePolicy The policy for the certificate. - * - * @param {object} [certificatePolicy.keyProperties] Properties of the key - * backing a certificate. + * @param {string} certificateName The name of the certificate. * - * @param {boolean} [certificatePolicy.keyProperties.exportable] Indicates if - * the private key can be exported. + * @param {object} [options] Optional Parameters. * - * @param {string} [certificatePolicy.keyProperties.keyType] The key type. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} [certificatePolicy.keyProperties.keySize] The key size in - * bits. For example: 2048, 3072, or 4096 for RSA. + * @returns {Promise} A promise is returned * - * @param {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if the - * same key pair will be used on certificate renewal. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {object} [certificatePolicy.secretProperties] Properties of the - * secret backing a certificate. + * @reject {Error} - The error object. + */ + backupCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._backupCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Backs up the specified certificate. * - * @param {string} [certificatePolicy.secretProperties.contentType] The media - * type (MIME type). + * 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 {object} [certificatePolicy.x509CertificateProperties] Properties of - * the X509 component of a certificate. + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. * - * @param {string} [certificatePolicy.x509CertificateProperties.subject] The - * subject name. Should be a valid X509 distinguished Name. + * @param {string} certificateName The name of the certificate. * - * @param {array} [certificatePolicy.x509CertificateProperties.ekus] The - * enhanced key usage. + * @param {object} [options] Optional Parameters. * - * @param {object} - * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The - * subject alternative names. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} - * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] - * Email addresses. + * @param {function} [optionalCallback] - The optional callback. * - * @param {array} - * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] - * Domain names. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {array} - * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] - * User principal names. + * {Promise} A promise is returned * - * @param {array} [certificatePolicy.x509CertificateProperties.keyUsage] List - * of key usages. + * @resolve {BackupCertificateResult} - The deserialized result object. * - * @param {number} - * [certificatePolicy.x509CertificateProperties.validityInMonths] The duration - * that the ceritifcate is valid in months. + * @reject {Error} - The error object. * - * @param {array} [certificatePolicy.lifetimeActions] Actions that will be - * performed by Key Vault over the lifetime of a certificate. + * {function} optionalCallback(err, result, request, response) * - * @param {object} [certificatePolicy.issuerParameters] Parameters for the - * issuer of the X509 component of a certificate. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} [certificatePolicy.issuerParameters.name] Name of the - * referenced issuer object or reserved names; for example, 'Self' or - * 'Unknown'. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupCertificateResult} for more + * information. * - * @param {string} [certificatePolicy.issuerParameters.certificateType] Type of - * certificate to be requested from the issuer provider. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [certificatePolicy.attributes] The certificate attributes. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + backupCertificate(vaultBaseUrl, certificateName, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._backupCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._backupCertificate(vaultBaseUrl, certificateName, options, optionalCallback); + } + } + + /** + * @summary Restores a backed up certificate to a vault. * - * @param {boolean} [certificatePolicy.attributes.enabled] Determines whether - * the object is enabled. + * Restores a backed up certificate, and all its versions, to a vault. This + * operation requires the certificates/restore permission. * - * @param {date} [certificatePolicy.attributes.notBefore] Not before date in - * UTC. + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. * - * @param {date} [certificatePolicy.attributes.expires] Expiry date in UTC. + * @param {buffer} certificateBundleBackup The backup blob associated with a + * certificate bundle. * * @param {object} [options] Optional Parameters. * @@ -18886,15 +22148,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - updateCertificatePolicyWithHttpOperationResponse(vaultBaseUrl, certificateName, certificatePolicy, options) { + restoreCertificateWithHttpOperationResponse(vaultBaseUrl, certificateBundleBackup, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._updateCertificatePolicy(vaultBaseUrl, certificateName, certificatePolicy, options, (err, result, request, response) => { + self._restoreCertificate(vaultBaseUrl, certificateBundleBackup, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -18905,95 +22167,128 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Updates the policy for a certificate. + * @summary Restores a backed up certificate to a vault. * - * Set specified members in the certificate policy. Leave others as null. This - * operation requires the certificates/update permission. + * Restores a backed up certificate, and all its versions, to a vault. This + * operation requires the certificates/restore permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate in the given - * vault. + * @param {buffer} certificateBundleBackup The backup blob associated with a + * certificate bundle. * - * @param {object} certificatePolicy The policy for the certificate. + * @param {object} [options] Optional Parameters. * - * @param {object} [certificatePolicy.keyProperties] Properties of the key - * backing a certificate. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [certificatePolicy.keyProperties.exportable] Indicates if - * the private key can be exported. + * @param {function} [optionalCallback] - The optional callback. * - * @param {string} [certificatePolicy.keyProperties.keyType] The key type. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {number} [certificatePolicy.keyProperties.keySize] The key size in - * bits. For example: 2048, 3072, or 4096 for RSA. + * {Promise} A promise is returned * - * @param {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if the - * same key pair will be used on certificate renewal. + * @resolve {CertificateBundle} - The deserialized result object. * - * @param {object} [certificatePolicy.secretProperties] Properties of the - * secret backing a certificate. + * @reject {Error} - The error object. * - * @param {string} [certificatePolicy.secretProperties.contentType] The media - * type (MIME type). + * {function} optionalCallback(err, result, request, response) * - * @param {object} [certificatePolicy.x509CertificateProperties] Properties of - * the X509 component of a certificate. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} [certificatePolicy.x509CertificateProperties.subject] The - * subject name. Should be a valid X509 distinguished Name. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateBundle} for more information. * - * @param {array} [certificatePolicy.x509CertificateProperties.ekus] The - * enhanced key usage. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {object} - * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The - * subject alternative names. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + restoreCertificate(vaultBaseUrl, certificateBundleBackup, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._restoreCertificate(vaultBaseUrl, certificateBundleBackup, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restoreCertificate(vaultBaseUrl, certificateBundleBackup, options, optionalCallback); + } + } + + /** + * @summary Lists the deleted certificates in the specified vault currently + * available for recovery. * - * @param {array} - * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] - * Email addresses. + * 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 {array} - * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] - * Domain names. + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. * - * @param {array} - * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] - * User principal names. + * @param {object} [options] Optional Parameters. * - * @param {array} [certificatePolicy.x509CertificateProperties.keyUsage] List - * of key usages. + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. * - * @param {number} - * [certificatePolicy.x509CertificateProperties.validityInMonths] The duration - * that the ceritifcate is valid in months. + * @param {boolean} [options.includePending] Specifies whether to include + * certificates which are not completely provisioned. * - * @param {array} [certificatePolicy.lifetimeActions] Actions that will be - * performed by Key Vault over the lifetime of a certificate. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [certificatePolicy.issuerParameters] Parameters for the - * issuer of the X509 component of a certificate. + * @returns {Promise} A promise is returned * - * @param {string} [certificatePolicy.issuerParameters.name] Name of the - * referenced issuer object or reserved names; for example, 'Self' or - * 'Unknown'. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [certificatePolicy.issuerParameters.certificateType] Type of - * certificate to be requested from the issuer provider. + * @reject {Error} - The error object. + */ + getDeletedCertificatesWithHttpOperationResponse(vaultBaseUrl, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeletedCertificates(vaultBaseUrl, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Lists the deleted certificates in the specified vault currently + * available for recovery. * - * @param {object} [certificatePolicy.attributes] The certificate attributes. + * 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 {boolean} [certificatePolicy.attributes.enabled] Determines whether - * the object is enabled. + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. * - * @param {date} [certificatePolicy.attributes.notBefore] Not before date in - * UTC. + * @param {object} [options] Optional Parameters. * - * @param {date} [certificatePolicy.attributes.expires] Expiry date in UTC. + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. * - * @param {object} [options] Optional Parameters. + * @param {boolean} [options.includePending] Specifies whether to include + * certificates which are not completely provisioned. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -19005,7 +22300,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {CertificatePolicy} - The deserialized result object. + * @resolve {DeletedCertificateListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -19014,13 +22309,14 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CertificatePolicy} for more information. + * See {@link DeletedCertificateListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - updateCertificatePolicy(vaultBaseUrl, certificateName, certificatePolicy, options, optionalCallback) { + getDeletedCertificates(vaultBaseUrl, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -19029,137 +22325,145 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateCertificatePolicy(vaultBaseUrl, certificateName, certificatePolicy, options, (err, result, request, response) => { + self._getDeletedCertificates(vaultBaseUrl, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateCertificatePolicy(vaultBaseUrl, certificateName, certificatePolicy, options, optionalCallback); + return self._getDeletedCertificates(vaultBaseUrl, options, optionalCallback); } } /** - * @summary Updates the specified attributes associated with the given - * certificate. + * @summary Retrieves information about the specified deleted certificate. * - * 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. + * 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. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate in the given key - * vault. - * - * @param {string} certificateVersion The version of the certificate. + * @param {string} certificateName The name of the certificate * * @param {object} [options] Optional Parameters. * - * @param {object} [options.certificatePolicy] The management policy for the - * certificate. - * - * @param {object} [options.certificatePolicy.keyProperties] Properties of the - * key backing a certificate. - * - * @param {boolean} [options.certificatePolicy.keyProperties.exportable] - * Indicates if the private key can be exported. - * - * @param {string} [options.certificatePolicy.keyProperties.keyType] The key - * type. - * - * @param {number} [options.certificatePolicy.keyProperties.keySize] The key - * size in bits. For example: 2048, 3072, or 4096 for RSA. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] - * Indicates if the same key pair will be used on certificate renewal. + * @returns {Promise} A promise is returned * - * @param {object} [options.certificatePolicy.secretProperties] Properties of - * the secret backing a certificate. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [options.certificatePolicy.secretProperties.contentType] The - * media type (MIME type). + * @reject {Error} - The error object. + */ + getDeletedCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeletedCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Retrieves information about the specified deleted certificate. * - * @param {object} [options.certificatePolicy.x509CertificateProperties] - * Properties of the X509 component of a certificate. + * 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. * - * @param {string} - * [options.certificatePolicy.x509CertificateProperties.subject] The subject - * name. Should be a valid X509 distinguished Name. + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. * - * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] - * The enhanced key usage. + * @param {string} certificateName The name of the certificate * - * @param {object} - * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] - * The subject alternative names. + * @param {object} [options] Optional Parameters. * - * @param {array} - * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] - * Email addresses. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} - * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] - * Domain names. + * @param {function} [optionalCallback] - The optional callback. * - * @param {array} - * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] - * User principal names. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {array} - * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key - * usages. + * {Promise} A promise is returned * - * @param {number} - * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The - * duration that the ceritifcate is valid in months. + * @resolve {DeletedCertificateBundle} - The deserialized result object. * - * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will - * be performed by Key Vault over the lifetime of a certificate. + * @reject {Error} - The error object. * - * @param {object} [options.certificatePolicy.issuerParameters] Parameters for - * the issuer of the X509 component of a certificate. + * {function} optionalCallback(err, result, request, response) * - * @param {string} [options.certificatePolicy.issuerParameters.name] Name of - * the referenced issuer object or reserved names; for example, 'Self' or - * 'Unknown'. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} [options.certificatePolicy.issuerParameters.certificateType] - * Type of certificate to be requested from the issuer provider. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedCertificateBundle} for more + * information. * - * @param {object} [options.certificatePolicy.attributes] The certificate - * attributes. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [options.certificateAttributes] The attributes of the - * certificate (optional). + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedCertificate(vaultBaseUrl, certificateName, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getDeletedCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeletedCertificate(vaultBaseUrl, certificateName, options, optionalCallback); + } + } + + /** + * @summary Permanently deletes the specified deleted certificate. * - * @param {boolean} [options.certificateAttributes.enabled] Determines whether - * the object is enabled. + * 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. * - * @param {date} [options.certificateAttributes.notBefore] Not before date in - * UTC. + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. * - * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * @param {string} certificateName The name of the certificate * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - updateCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, certificateVersion, options) { + purgeDeletedCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._updateCertificate(vaultBaseUrl, certificateName, certificateVersion, options, (err, result, request, response) => { + self._purgeDeletedCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -19170,110 +22474,120 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Updates the specified attributes associated with the given - * certificate. + * @summary Permanently deletes the specified deleted certificate. * - * 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. + * 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. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate in the given key - * vault. - * - * @param {string} certificateVersion The version of the certificate. + * @param {string} certificateName The name of the certificate * * @param {object} [options] Optional Parameters. * - * @param {object} [options.certificatePolicy] The management policy for the - * certificate. - * - * @param {object} [options.certificatePolicy.keyProperties] Properties of the - * key backing a certificate. - * - * @param {boolean} [options.certificatePolicy.keyProperties.exportable] - * Indicates if the private key can be exported. - * - * @param {string} [options.certificatePolicy.keyProperties.keyType] The key - * type. - * - * @param {number} [options.certificatePolicy.keyProperties.keySize] The key - * size in bits. For example: 2048, 3072, or 4096 for RSA. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] - * Indicates if the same key pair will be used on certificate renewal. + * @param {function} [optionalCallback] - The optional callback. * - * @param {object} [options.certificatePolicy.secretProperties] Properties of - * the secret backing a certificate. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {string} [options.certificatePolicy.secretProperties.contentType] The - * media type (MIME type). + * {Promise} A promise is returned * - * @param {object} [options.certificatePolicy.x509CertificateProperties] - * Properties of the X509 component of a certificate. + * @resolve {null} - The deserialized result object. * - * @param {string} - * [options.certificatePolicy.x509CertificateProperties.subject] The subject - * name. Should be a valid X509 distinguished Name. + * @reject {Error} - The error object. * - * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] - * The enhanced key usage. + * {function} optionalCallback(err, result, request, response) * - * @param {object} - * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] - * The subject alternative names. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {array} - * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] - * Email addresses. + * {null} [result] - The deserialized result object if an error did not occur. * - * @param {array} - * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] - * Domain names. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {array} - * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] - * User principal names. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + purgeDeletedCertificate(vaultBaseUrl, certificateName, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._purgeDeletedCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._purgeDeletedCertificate(vaultBaseUrl, certificateName, options, optionalCallback); + } + } + + /** + * @summary Recovers the deleted certificate back to its current version under + * /certificates. * - * @param {array} - * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key - * usages. + * 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 {number} - * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The - * duration that the ceritifcate is valid in months. + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. * - * @param {array} [options.certificatePolicy.lifetimeActions] Actions that will - * be performed by Key Vault over the lifetime of a certificate. + * @param {string} certificateName The name of the deleted certificate * - * @param {object} [options.certificatePolicy.issuerParameters] Parameters for - * the issuer of the X509 component of a certificate. + * @param {object} [options] Optional Parameters. * - * @param {string} [options.certificatePolicy.issuerParameters.name] Name of - * the referenced issuer object or reserved names; for example, 'Self' or - * 'Unknown'. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [options.certificatePolicy.issuerParameters.certificateType] - * Type of certificate to be requested from the issuer provider. + * @returns {Promise} A promise is returned * - * @param {object} [options.certificatePolicy.attributes] The certificate - * attributes. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {object} [options.certificateAttributes] The attributes of the - * certificate (optional). + * @reject {Error} - The error object. + */ + recoverDeletedCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._recoverDeletedCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Recovers the deleted certificate back to its current version under + * /certificates. * - * @param {boolean} [options.certificateAttributes.enabled] Determines whether - * the object is enabled. + * 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 {date} [options.certificateAttributes.notBefore] Not before date in - * UTC. + * @param {string} vaultBaseUrl The vault name, for example + * https://myvault.vault.azure.net. * - * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. + * @param {string} certificateName The name of the deleted certificate * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -19300,7 +22614,7 @@ class KeyVaultClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - updateCertificate(vaultBaseUrl, certificateName, certificateVersion, options, optionalCallback) { + recoverDeletedCertificate(vaultBaseUrl, certificateName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -19309,47 +22623,43 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateCertificate(vaultBaseUrl, certificateName, certificateVersion, options, (err, result, request, response) => { + self._recoverDeletedCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateCertificate(vaultBaseUrl, certificateName, certificateVersion, options, optionalCallback); + return self._recoverDeletedCertificate(vaultBaseUrl, certificateName, options, optionalCallback); } } /** - * @summary Gets information about a certificate. - * - * Gets information about a specific certificate. This operation requires the - * certificates/get permission. + * List storage accounts managed by the specified key vault. This operation + * requires the storage/list permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate in the given - * vault. - * - * @param {string} certificateVersion The version of the certificate. - * * @param {object} [options] Optional Parameters. * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, certificateVersion, options) { + getStorageAccountsWithHttpOperationResponse(vaultBaseUrl, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getCertificate(vaultBaseUrl, certificateName, certificateVersion, options, (err, result, request, response) => { + self._getStorageAccounts(vaultBaseUrl, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -19360,21 +22670,17 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Gets information about a certificate. - * - * Gets information about a specific certificate. This operation requires the - * certificates/get permission. + * List storage accounts managed by the specified key vault. This operation + * requires the storage/list permission. * * @param {string} vaultBaseUrl The vault name, for example - * https://myvault.vault.azure.net. - * - * @param {string} certificateName The name of the certificate in the given - * vault. - * - * @param {string} certificateVersion The version of the certificate. + * https://myvault.vault.azure.net. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -19385,7 +22691,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {CertificateBundle} - The deserialized result object. + * @resolve {StorageListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -19394,13 +22700,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CertificateBundle} for more information. + * See {@link StorageListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getCertificate(vaultBaseUrl, certificateName, certificateVersion, options, optionalCallback) { + getStorageAccounts(vaultBaseUrl, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -19409,47 +22715,46 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getCertificate(vaultBaseUrl, certificateName, certificateVersion, options, (err, result, request, response) => { + self._getStorageAccounts(vaultBaseUrl, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getCertificate(vaultBaseUrl, certificateName, certificateVersion, options, optionalCallback); + return self._getStorageAccounts(vaultBaseUrl, options, optionalCallback); } } /** - * @summary Updates a certificate operation. + * @summary Lists deleted storage accounts for the specified vault. * - * Updates a certificate creation operation that is already in progress. This - * operation requires the certificates/update permission. + * The Get Deleted Storage Accounts operation returns the storage accounts that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/list permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate. - * - * @param {boolean} cancellationRequested Indicates if cancellation was - * requested on the certificate operation. - * * @param {object} [options] Optional Parameters. * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - updateCertificateOperationWithHttpOperationResponse(vaultBaseUrl, certificateName, cancellationRequested, options) { + getDeletedStorageAccountsWithHttpOperationResponse(vaultBaseUrl, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._updateCertificateOperation(vaultBaseUrl, certificateName, cancellationRequested, options, (err, result, request, response) => { + self._getDeletedStorageAccounts(vaultBaseUrl, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -19460,21 +22765,20 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Updates a certificate operation. + * @summary Lists deleted storage accounts for the specified vault. * - * Updates a certificate creation operation that is already in progress. This - * operation requires the certificates/update permission. + * The Get Deleted Storage Accounts operation returns the storage accounts that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/list permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate. - * - * @param {boolean} cancellationRequested Indicates if cancellation was - * requested on the certificate operation. - * * @param {object} [options] Optional Parameters. * + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -19485,7 +22789,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {CertificateOperation} - The deserialized result object. + * @resolve {DeletedStorageListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -19494,13 +22798,14 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CertificateOperation} for more information. + * See {@link DeletedStorageListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - updateCertificateOperation(vaultBaseUrl, certificateName, cancellationRequested, options, optionalCallback) { + getDeletedStorageAccounts(vaultBaseUrl, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -19509,27 +22814,28 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateCertificateOperation(vaultBaseUrl, certificateName, cancellationRequested, options, (err, result, request, response) => { + self._getDeletedStorageAccounts(vaultBaseUrl, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateCertificateOperation(vaultBaseUrl, certificateName, cancellationRequested, options, optionalCallback); + return self._getDeletedStorageAccounts(vaultBaseUrl, options, optionalCallback); } } /** - * @summary Gets the creation operation of a certificate. + * @summary Gets the specified deleted storage account. * - * Gets the creation operation associated with a specified certificate. This - * operation requires the certificates/get permission. + * The Get Deleted Storage Account operation returns the specified deleted + * storage account along with its attributes. This operation requires the + * storage/get permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate. + * @param {string} storageAccountName The name of the storage account. * * @param {object} [options] Optional Parameters. * @@ -19538,15 +22844,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getCertificateOperationWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + getDeletedStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getCertificateOperation(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + self._getDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -19557,15 +22863,16 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Gets the creation operation of a certificate. + * @summary Gets the specified deleted storage account. * - * Gets the creation operation associated with a specified certificate. This - * operation requires the certificates/get permission. + * The Get Deleted Storage Account operation returns the specified deleted + * storage account along with its attributes. This operation requires the + * storage/get permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate. + * @param {string} storageAccountName The name of the storage account. * * @param {object} [options] Optional Parameters. * @@ -19579,7 +22886,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {CertificateOperation} - The deserialized result object. + * @resolve {DeletedStorageBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -19588,13 +22895,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CertificateOperation} for more information. + * See {@link DeletedStorageBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getCertificateOperation(vaultBaseUrl, certificateName, options, optionalCallback) { + getDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -19603,28 +22910,29 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getCertificateOperation(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + self._getDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getCertificateOperation(vaultBaseUrl, certificateName, options, optionalCallback); + return self._getDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback); } } /** - * @summary Deletes the creation operation for a specific certificate. + * @summary Permanently deletes the specified storage account. * - * 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. + * The purge deleted storage account operation removes the secret permanently, + * without the possibility of recovery. This operation can only be performed on + * a soft-delete enabled vault. This operation requires the storage/purge + * permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate. + * @param {string} storageAccountName The name of the storage account. * * @param {object} [options] Optional Parameters. * @@ -19633,15 +22941,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteCertificateOperationWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + purgeDeletedStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deleteCertificateOperation(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + self._purgeDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -19652,16 +22960,17 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Deletes the creation operation for a specific certificate. + * @summary Permanently deletes the specified storage account. * - * 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. + * The purge deleted storage account operation removes the secret permanently, + * without the possibility of recovery. This operation can only be performed on + * a soft-delete enabled vault. This operation requires the storage/purge + * permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate. + * @param {string} storageAccountName The name of the storage account. * * @param {object} [options] Optional Parameters. * @@ -19675,7 +22984,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {CertificateOperation} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -19683,14 +22992,13 @@ class KeyVaultClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CertificateOperation} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteCertificateOperation(vaultBaseUrl, certificateName, options, optionalCallback) { + purgeDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -19699,63 +23007,45 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteCertificateOperation(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + self._purgeDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteCertificateOperation(vaultBaseUrl, certificateName, options, optionalCallback); + return self._purgeDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback); } } /** - * @summary Merges a certificate or a certificate chain with a key pair - * existing on the server. + * @summary Recovers the deleted storage account. * - * 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. + * Recovers the deleted storage account in the specified vault. This operation + * can only be performed on a soft-delete enabled vault. This operation + * requires the storage/recover permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate. - * - * @param {array} x509Certificates The certificate or the certificate chain to - * merge. + * @param {string} storageAccountName The name of the storage account. * * @param {object} [options] Optional Parameters. * - * @param {object} [options.certificateAttributes] The attributes of the - * certificate (optional). - * - * @param {boolean} [options.certificateAttributes.enabled] Determines whether - * the object is enabled. - * - * @param {date} [options.certificateAttributes.notBefore] Not before date in - * UTC. - * - * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. - * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - mergeCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, x509Certificates, options) { + recoverDeletedStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._mergeCertificate(vaultBaseUrl, certificateName, x509Certificates, options, (err, result, request, response) => { + self._recoverDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -19766,37 +23056,19 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Merges a certificate or a certificate chain with a key pair - * existing on the server. + * @summary Recovers the deleted storage account. * - * 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. + * Recovers the deleted storage account in the specified vault. This operation + * can only be performed on a soft-delete enabled vault. This operation + * requires the storage/recover permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate. - * - * @param {array} x509Certificates The certificate or the certificate chain to - * merge. + * @param {string} storageAccountName The name of the storage account. * * @param {object} [options] Optional Parameters. * - * @param {object} [options.certificateAttributes] The attributes of the - * certificate (optional). - * - * @param {boolean} [options.certificateAttributes.enabled] Determines whether - * the object is enabled. - * - * @param {date} [options.certificateAttributes.notBefore] Not before date in - * UTC. - * - * @param {date} [options.certificateAttributes.expires] Expiry date in UTC. - * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -19807,7 +23079,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {CertificateBundle} - The deserialized result object. + * @resolve {StorageBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -19816,13 +23088,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CertificateBundle} for more information. + * See {@link StorageBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - mergeCertificate(vaultBaseUrl, certificateName, x509Certificates, options, optionalCallback) { + recoverDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -19831,49 +23103,44 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._mergeCertificate(vaultBaseUrl, certificateName, x509Certificates, options, (err, result, request, response) => { + self._recoverDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._mergeCertificate(vaultBaseUrl, certificateName, x509Certificates, options, optionalCallback); + return self._recoverDeletedStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback); } } /** - * @summary Lists the deleted certificates in the specified vault currently - * available for recovery. + * @summary Backs up the specified storage account. * - * 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. + * Requests that a backup of the specified storage account be downloaded to the + * client. This operation requires the storage/backup permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {object} [options] Optional Parameters. + * @param {string} storageAccountName The name of the storage account. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeletedCertificatesWithHttpOperationResponse(vaultBaseUrl, options) { + backupStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeletedCertificates(vaultBaseUrl, options, (err, result, request, response) => { + self._backupStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -19884,22 +23151,17 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Lists the deleted certificates in the specified vault currently - * available for recovery. + * @summary Backs up the specified storage account. * - * 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. + * Requests that a backup of the specified storage account be downloaded to the + * client. This operation requires the storage/backup permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {object} [options] Optional Parameters. + * @param {string} storageAccountName The name of the storage account. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -19911,7 +23173,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {DeletedCertificateListResult} - The deserialized result object. + * @resolve {BackupStorageResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -19920,14 +23182,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeletedCertificateListResult} for more - * information. + * See {@link BackupStorageResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getDeletedCertificates(vaultBaseUrl, options, optionalCallback) { + backupStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -19936,29 +23197,28 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeletedCertificates(vaultBaseUrl, options, (err, result, request, response) => { + self._backupStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeletedCertificates(vaultBaseUrl, options, optionalCallback); + return self._backupStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback); } } /** - * @summary Retrieves information about the specified deleted certificate. + * @summary Restores a backed up storage account to a vault. * - * 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. + * Restores a backed up storage account to a vault. This operation requires the + * storage/restore permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate + * @param {buffer} storageBundleBackup The backup blob associated with a + * storage account. * * @param {object} [options] Optional Parameters. * @@ -19967,15 +23227,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getDeletedCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + restoreStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageBundleBackup, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getDeletedCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + self._restoreStorageAccount(vaultBaseUrl, storageBundleBackup, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -19986,17 +23246,16 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Retrieves information about the specified deleted certificate. + * @summary Restores a backed up storage account to a vault. * - * 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. + * Restores a backed up storage account to a vault. This operation requires the + * storage/restore permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate + * @param {buffer} storageBundleBackup The backup blob associated with a + * storage account. * * @param {object} [options] Optional Parameters. * @@ -20010,7 +23269,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {DeletedCertificateBundle} - The deserialized result object. + * @resolve {StorageBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -20019,14 +23278,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeletedCertificateBundle} for more - * information. + * See {@link StorageBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getDeletedCertificate(vaultBaseUrl, certificateName, options, optionalCallback) { + restoreStorageAccount(vaultBaseUrl, storageBundleBackup, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -20035,29 +23293,25 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeletedCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + self._restoreStorageAccount(vaultBaseUrl, storageBundleBackup, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeletedCertificate(vaultBaseUrl, certificateName, options, optionalCallback); + return self._restoreStorageAccount(vaultBaseUrl, storageBundleBackup, options, optionalCallback); } } /** - * @summary Permanently deletes the specified deleted certificate. - * - * 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. + * Deletes a storage account. This operation requires the storage/delete + * permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate + * @param {string} storageAccountName The name of the storage account. * * @param {object} [options] Optional Parameters. * @@ -20066,15 +23320,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - purgeDeletedCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + deleteStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._purgeDeletedCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + self._deleteStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -20085,17 +23339,13 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Permanently deletes the specified deleted certificate. - * - * 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. + * Deletes a storage account. This operation requires the storage/delete + * permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the certificate + * @param {string} storageAccountName The name of the storage account. * * @param {object} [options] Optional Parameters. * @@ -20109,7 +23359,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {DeletedStorageBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -20117,13 +23367,14 @@ class KeyVaultClient extends ServiceClient { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedStorageBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - purgeDeletedCertificate(vaultBaseUrl, certificateName, options, optionalCallback) { + deleteStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -20132,31 +23383,25 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._purgeDeletedCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + self._deleteStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._purgeDeletedCertificate(vaultBaseUrl, certificateName, options, optionalCallback); + return self._deleteStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback); } } /** - * @summary Recovers the deleted certificate back to its current version under - * /certificates. - * - * 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. + * Gets information about a specified storage account. This operation requires + * the storage/get permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the deleted certificate + * @param {string} storageAccountName The name of the storage account. * * @param {object} [options] Optional Parameters. * @@ -20165,15 +23410,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - recoverDeletedCertificateWithHttpOperationResponse(vaultBaseUrl, certificateName, options) { + getStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._recoverDeletedCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + self._getStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -20184,19 +23429,13 @@ class KeyVaultClient extends ServiceClient { } /** - * @summary Recovers the deleted certificate back to its current version under - * /certificates. - * - * 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. + * Gets information about a specified storage account. This operation requires + * the storage/get permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * - * @param {string} certificateName The name of the deleted certificate + * @param {string} storageAccountName The name of the storage account. * * @param {object} [options] Optional Parameters. * @@ -20210,7 +23449,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {CertificateBundle} - The deserialized result object. + * @resolve {StorageBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -20219,13 +23458,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CertificateBundle} for more information. + * See {@link StorageBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - recoverDeletedCertificate(vaultBaseUrl, certificateName, options, optionalCallback) { + getStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -20234,43 +23473,61 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._recoverDeletedCertificate(vaultBaseUrl, certificateName, options, (err, result, request, response) => { + self._getStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._recoverDeletedCertificate(vaultBaseUrl, certificateName, options, optionalCallback); + return self._getStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback); } } /** - * List storage accounts managed by the specified key vault. This operation - * requires the storage/list permission. + * Creates or updates a new storage account. This operation requires the + * storage/set permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} resourceId Storage account resource id. + * + * @param {string} activeKeyName Current active storage account key name. + * + * @param {boolean} autoRegenerateKey whether keyvault should manage the + * storage account for the user. + * * @param {object} [options] Optional Parameters. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. + * @param {string} [options.regenerationPeriod] The key regeneration time + * duration specified in ISO-8601 format. + * + * @param {object} [options.storageAccountAttributes] The attributes of the + * storage account. + * + * @param {boolean} [options.storageAccountAttributes.enabled] the enabled + * state of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getStorageAccountsWithHttpOperationResponse(vaultBaseUrl, options) { + setStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getStorageAccounts(vaultBaseUrl, options, (err, result, request, response) => { + self._setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -20281,16 +23538,34 @@ class KeyVaultClient extends ServiceClient { } /** - * List storage accounts managed by the specified key vault. This operation - * requires the storage/list permission. + * Creates or updates a new storage account. This operation requires the + * storage/set permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * + * @param {string} storageAccountName The name of the storage account. + * + * @param {string} resourceId Storage account resource id. + * + * @param {string} activeKeyName Current active storage account key name. + * + * @param {boolean} autoRegenerateKey whether keyvault should manage the + * storage account for the user. + * * @param {object} [options] Optional Parameters. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. + * @param {string} [options.regenerationPeriod] The key regeneration time + * duration specified in ISO-8601 format. + * + * @param {object} [options.storageAccountAttributes] The attributes of the + * storage account. + * + * @param {boolean} [options.storageAccountAttributes.enabled] the enabled + * state of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -20302,7 +23577,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {StorageListResult} - The deserialized result object. + * @resolve {StorageBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -20311,13 +23586,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link StorageListResult} for more information. + * See {@link StorageBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getStorageAccounts(vaultBaseUrl, options, optionalCallback) { + setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -20326,20 +23601,20 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getStorageAccounts(vaultBaseUrl, options, (err, result, request, response) => { + self._setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getStorageAccounts(vaultBaseUrl, options, optionalCallback); + return self._setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, options, optionalCallback); } } /** - * Deletes a storage account. This operation requires the storage/delete - * permission. + * Updates the specified attributes associated with the given storage account. + * This operation requires the storage/set/update permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. @@ -20348,6 +23623,24 @@ class KeyVaultClient extends ServiceClient { * * @param {object} [options] Optional Parameters. * + * @param {string} [options.activeKeyName] The current active storage account + * key name. + * + * @param {boolean} [options.autoRegenerateKey] whether keyvault should manage + * the storage account for the user. + * + * @param {string} [options.regenerationPeriod] The key regeneration time + * duration specified in ISO-8601 format. + * + * @param {object} [options.storageAccountAttributes] The attributes of the + * storage account. + * + * @param {boolean} [options.storageAccountAttributes.enabled] the enabled + * state of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -20357,11 +23650,11 @@ class KeyVaultClient extends ServiceClient { * * @reject {Error} - The error object. */ - deleteStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { + updateStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._deleteStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + self._updateStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -20372,8 +23665,8 @@ class KeyVaultClient extends ServiceClient { } /** - * Deletes a storage account. This operation requires the storage/delete - * permission. + * Updates the specified attributes associated with the given storage account. + * This operation requires the storage/set/update permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. @@ -20382,6 +23675,24 @@ class KeyVaultClient extends ServiceClient { * * @param {object} [options] Optional Parameters. * + * @param {string} [options.activeKeyName] The current active storage account + * key name. + * + * @param {boolean} [options.autoRegenerateKey] whether keyvault should manage + * the storage account for the user. + * + * @param {string} [options.regenerationPeriod] The key regeneration time + * duration specified in ISO-8601 format. + * + * @param {object} [options.storageAccountAttributes] The attributes of the + * storage account. + * + * @param {boolean} [options.storageAccountAttributes.enabled] the enabled + * state of the object. + * + * @param {object} [options.tags] Application specific metadata in the form of + * key-value pairs. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -20407,7 +23718,7 @@ class KeyVaultClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback) { + updateStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -20416,26 +23727,28 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + self._updateStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback); + return self._updateStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback); } } /** - * Gets information about a specified storage account. This operation requires - * the storage/get permission. + * Regenerates the specified key value for the given storage account. This + * operation requires the storage/regeneratekey permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} storageAccountName The name of the storage account. * + * @param {string} keyName The storage account key name. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -20447,11 +23760,11 @@ class KeyVaultClient extends ServiceClient { * * @reject {Error} - The error object. */ - getStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { + regenerateStorageAccountKeyWithHttpOperationResponse(vaultBaseUrl, storageAccountName, keyName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + self._regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -20462,14 +23775,16 @@ class KeyVaultClient extends ServiceClient { } /** - * Gets information about a specified storage account. This operation requires - * the storage/get permission. + * Regenerates the specified key value for the given storage account. This + * operation requires the storage/regeneratekey permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} storageAccountName The name of the storage account. * + * @param {string} keyName The storage account key name. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -20497,7 +23812,7 @@ class KeyVaultClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback) { + regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -20506,61 +23821,45 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + self._regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback); + return self._regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, options, optionalCallback); } } /** - * Creates or updates a new storage account. This operation requires the - * storage/set permission. + * List storage SAS definitions for the given storage account. This operation + * requires the storage/listsas permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} storageAccountName The name of the storage account. * - * @param {string} resourceId Storage account resource id. - * - * @param {string} activeKeyName Current active storage account key name. - * - * @param {boolean} autoRegenerateKey whether keyvault should manage the - * storage account for the user. - * * @param {object} [options] Optional Parameters. * - * @param {string} [options.regenerationPeriod] The key regeneration time - * duration specified in ISO-8601 format. - * - * @param {object} [options.storageAccountAttributes] The attributes of the - * storage account. - * - * @param {boolean} [options.storageAccountAttributes.enabled] the enabled - * state of the object. - * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - setStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, options) { + getSasDefinitionsWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, options, (err, result, request, response) => { + self._getSasDefinitions(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -20571,34 +23870,18 @@ class KeyVaultClient extends ServiceClient { } /** - * Creates or updates a new storage account. This operation requires the - * storage/set permission. + * List storage SAS definitions for the given storage account. This operation + * requires the storage/listsas permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} storageAccountName The name of the storage account. * - * @param {string} resourceId Storage account resource id. - * - * @param {string} activeKeyName Current active storage account key name. - * - * @param {boolean} autoRegenerateKey whether keyvault should manage the - * storage account for the user. - * * @param {object} [options] Optional Parameters. * - * @param {string} [options.regenerationPeriod] The key regeneration time - * duration specified in ISO-8601 format. - * - * @param {object} [options.storageAccountAttributes] The attributes of the - * storage account. - * - * @param {boolean} [options.storageAccountAttributes.enabled] the enabled - * state of the object. - * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -20610,7 +23893,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {StorageBundle} - The deserialized result object. + * @resolve {SasDefinitionListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -20619,13 +23902,14 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link StorageBundle} for more information. + * See {@link SasDefinitionListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, options, optionalCallback) { + getSasDefinitions(vaultBaseUrl, storageAccountName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -20634,60 +23918,49 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, options, (err, result, request, response) => { + self._getSasDefinitions(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._setStorageAccount(vaultBaseUrl, storageAccountName, resourceId, activeKeyName, autoRegenerateKey, options, optionalCallback); + return self._getSasDefinitions(vaultBaseUrl, storageAccountName, options, optionalCallback); } } /** - * Updates the specified attributes associated with the given storage account. - * This operation requires the storage/set/update permission. + * @summary Lists deleted SAS definitions for the specified vault and storage + * account. + * + * The Get Deleted Sas Definitions operation returns the SAS definitions that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/listsas permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} storageAccountName The name of the storage account. * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.activeKeyName] The current active storage account - * key name. - * - * @param {boolean} [options.autoRegenerateKey] whether keyvault should manage - * the storage account for the user. - * - * @param {string} [options.regenerationPeriod] The key regeneration time - * duration specified in ISO-8601 format. - * - * @param {object} [options.storageAccountAttributes] The attributes of the - * storage account. - * - * @param {boolean} [options.storageAccountAttributes.enabled] the enabled - * state of the object. + * @param {object} [options] Optional Parameters. * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - updateStorageAccountWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { + getDeletedSasDefinitionsWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._updateStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + self._getDeletedSasDefinitions(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -20698,8 +23971,12 @@ class KeyVaultClient extends ServiceClient { } /** - * Updates the specified attributes associated with the given storage account. - * This operation requires the storage/set/update permission. + * @summary Lists deleted SAS definitions for the specified vault and storage + * account. + * + * The Get Deleted Sas Definitions operation returns the SAS definitions that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/listsas permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. @@ -20708,23 +23985,8 @@ class KeyVaultClient extends ServiceClient { * * @param {object} [options] Optional Parameters. * - * @param {string} [options.activeKeyName] The current active storage account - * key name. - * - * @param {boolean} [options.autoRegenerateKey] whether keyvault should manage - * the storage account for the user. - * - * @param {string} [options.regenerationPeriod] The key regeneration time - * duration specified in ISO-8601 format. - * - * @param {object} [options.storageAccountAttributes] The attributes of the - * storage account. - * - * @param {boolean} [options.storageAccountAttributes.enabled] the enabled - * state of the object. - * - * @param {object} [options.tags] Application specific metadata in the form of - * key-value pairs. + * @param {number} [options.maxresults] Maximum number of results to return in + * a page. If not specified the service will return up to 25 results. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -20736,7 +23998,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {StorageBundle} - The deserialized result object. + * @resolve {DeletedSasDefinitionListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -20745,13 +24007,14 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link StorageBundle} for more information. + * See {@link DeletedSasDefinitionListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - updateStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback) { + getDeletedSasDefinitions(vaultBaseUrl, storageAccountName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -20760,27 +24023,30 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateStorageAccount(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + self._getDeletedSasDefinitions(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateStorageAccount(vaultBaseUrl, storageAccountName, options, optionalCallback); + return self._getDeletedSasDefinitions(vaultBaseUrl, storageAccountName, options, optionalCallback); } } /** - * Regenerates the specified key value for the given storage account. This - * operation requires the storage/regeneratekey permission. + * @summary Gets the specified deleted sas definition. + * + * The Get Deleted SAS Definition operation returns the specified deleted SAS + * definition along with its attributes. This operation requires the + * storage/getsas permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} storageAccountName The name of the storage account. * - * @param {string} keyName The storage account key name. + * @param {string} sasDefinitionName The name of the SAS definition. * * @param {object} [options] Optional Parameters. * @@ -20789,15 +24055,15 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - regenerateStorageAccountKeyWithHttpOperationResponse(vaultBaseUrl, storageAccountName, keyName, options) { + getDeletedSasDefinitionWithHttpOperationResponse(vaultBaseUrl, storageAccountName, sasDefinitionName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, options, (err, result, request, response) => { + self._getDeletedSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -20808,15 +24074,18 @@ class KeyVaultClient extends ServiceClient { } /** - * Regenerates the specified key value for the given storage account. This - * operation requires the storage/regeneratekey permission. + * @summary Gets the specified deleted sas definition. + * + * The Get Deleted SAS Definition operation returns the specified deleted SAS + * definition along with its attributes. This operation requires the + * storage/getsas permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} storageAccountName The name of the storage account. * - * @param {string} keyName The storage account key name. + * @param {string} sasDefinitionName The name of the SAS definition. * * @param {object} [options] Optional Parameters. * @@ -20830,7 +24099,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {StorageBundle} - The deserialized result object. + * @resolve {DeletedSasDefinitionBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -20839,13 +24108,14 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link StorageBundle} for more information. + * See {@link DeletedSasDefinitionBundle} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, options, optionalCallback) { + getDeletedSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -20854,45 +24124,47 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, options, (err, result, request, response) => { + self._getDeletedSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._regenerateStorageAccountKey(vaultBaseUrl, storageAccountName, keyName, options, optionalCallback); + return self._getDeletedSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, optionalCallback); } } /** - * List storage SAS definitions for the given storage account. This operation - * requires the storage/listsas permission. + * @summary Recovers the deleted SAS definition. + * + * Recovers the deleted SAS definition for the specified storage account. This + * operation can only be performed on a soft-delete enabled vault. This + * operation requires the storage/recover permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} storageAccountName The name of the storage account. * - * @param {object} [options] Optional Parameters. + * @param {string} sasDefinitionName The name of the SAS definition. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getSasDefinitionsWithHttpOperationResponse(vaultBaseUrl, storageAccountName, options) { + recoverDeletedSasDefinitionWithHttpOperationResponse(vaultBaseUrl, storageAccountName, sasDefinitionName, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._getSasDefinitions(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + self._recoverDeletedSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -20903,18 +24175,20 @@ class KeyVaultClient extends ServiceClient { } /** - * List storage SAS definitions for the given storage account. This operation - * requires the storage/listsas permission. + * @summary Recovers the deleted SAS definition. + * + * Recovers the deleted SAS definition for the specified storage account. This + * operation can only be performed on a soft-delete enabled vault. This + * operation requires the storage/recover permission. * * @param {string} vaultBaseUrl The vault name, for example * https://myvault.vault.azure.net. * * @param {string} storageAccountName The name of the storage account. * - * @param {object} [options] Optional Parameters. + * @param {string} sasDefinitionName The name of the SAS definition. * - * @param {number} [options.maxresults] Maximum number of results to return in - * a page. If not specified the service will return up to 25 results. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -20926,7 +24200,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {SasDefinitionListResult} - The deserialized result object. + * @resolve {SasDefinitionBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -20935,14 +24209,13 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SasDefinitionListResult} for more - * information. + * See {@link SasDefinitionBundle} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getSasDefinitions(vaultBaseUrl, storageAccountName, options, optionalCallback) { + recoverDeletedSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -20951,14 +24224,14 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getSasDefinitions(vaultBaseUrl, storageAccountName, options, (err, result, request, response) => { + self._recoverDeletedSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getSasDefinitions(vaultBaseUrl, storageAccountName, options, optionalCallback); + return self._recoverDeletedSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, options, optionalCallback); } } @@ -20980,7 +24253,7 @@ class KeyVaultClient extends ServiceClient { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -21021,7 +24294,7 @@ class KeyVaultClient extends ServiceClient { * * {Promise} A promise is returned * - * @resolve {SasDefinitionBundle} - The deserialized result object. + * @resolve {DeletedSasDefinitionBundle} - The deserialized result object. * * @reject {Error} - The error object. * @@ -21030,7 +24303,8 @@ class KeyVaultClient extends ServiceClient { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SasDefinitionBundle} for more information. + * See {@link DeletedSasDefinitionBundle} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -21161,8 +24435,15 @@ class KeyVaultClient extends ServiceClient { * * @param {string} sasDefinitionName The name of the SAS definition. * - * @param {object} parameters Sas definition creation metadata in the form of - * key-value pairs. + * @param {string} templateUri The SAS definition token template signed with an + * arbitrary key. Tokens created according to the SAS definition will have the + * same properties as the template. + * + * @param {string} sasType The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * + * @param {string} validityPeriod The validity period of SAS tokens created + * according to the SAS definition. * * @param {object} [options] Optional Parameters. * @@ -21184,11 +24465,11 @@ class KeyVaultClient extends ServiceClient { * * @reject {Error} - The error object. */ - setSasDefinitionWithHttpOperationResponse(vaultBaseUrl, storageAccountName, sasDefinitionName, parameters, options) { + setSasDefinitionWithHttpOperationResponse(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod, options) { let client = this; let self = this; return new Promise((resolve, reject) => { - self._setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, parameters, options, (err, result, request, response) => { + self._setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -21209,8 +24490,15 @@ class KeyVaultClient extends ServiceClient { * * @param {string} sasDefinitionName The name of the SAS definition. * - * @param {object} parameters Sas definition creation metadata in the form of - * key-value pairs. + * @param {string} templateUri The SAS definition token template signed with an + * arbitrary key. Tokens created according to the SAS definition will have the + * same properties as the template. + * + * @param {string} sasType The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * + * @param {string} validityPeriod The validity period of SAS tokens created + * according to the SAS definition. * * @param {object} [options] Optional Parameters. * @@ -21248,7 +24536,7 @@ class KeyVaultClient extends ServiceClient { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, parameters, options, optionalCallback) { + setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod, options, optionalCallback) { let client = this; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -21257,14 +24545,14 @@ class KeyVaultClient extends ServiceClient { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, parameters, options, (err, result, request, response) => { + self._setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, parameters, options, optionalCallback); + return self._setSasDefinition(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, validityPeriod, options, optionalCallback); } } @@ -21281,8 +24569,15 @@ class KeyVaultClient extends ServiceClient { * * @param {object} [options] Optional Parameters. * - * @param {object} [options.parameters] Sas definition update metadata in the - * form of key-value pairs. + * @param {string} [options.templateUri] The SAS definition token template + * signed with an arbitrary key. Tokens created according to the SAS + * definition will have the same properties as the template. + * + * @param {string} [options.sasType] The type of SAS token the SAS definition + * will create. Possible values include: 'account', 'service' + * + * @param {string} [options.validityPeriod] The validity period of SAS tokens + * created according to the SAS definition. * * @param {object} [options.sasDefinitionAttributes] The attributes of the SAS * definition. @@ -21329,8 +24624,15 @@ class KeyVaultClient extends ServiceClient { * * @param {object} [options] Optional Parameters. * - * @param {object} [options.parameters] Sas definition update metadata in the - * form of key-value pairs. + * @param {string} [options.templateUri] The SAS definition token template + * signed with an arbitrary key. Tokens created according to the SAS + * definition will have the same properties as the template. + * + * @param {string} [options.sasType] The type of SAS token the SAS definition + * will create. Possible values include: 'account', 'service' + * + * @param {string} [options.validityPeriod] The validity period of SAS tokens + * created according to the SAS definition. * * @param {object} [options.sasDefinitionAttributes] The attributes of the SAS * definition. @@ -22413,6 +25715,99 @@ class KeyVaultClient extends ServiceClient { } } + /** + * @summary Lists deleted storage accounts for the specified vault. + * + * The Get Deleted Storage Accounts operation returns the storage accounts that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getDeletedStorageAccountsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeletedStorageAccountsNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Lists deleted storage accounts for the specified vault. + * + * The Get Deleted Storage Accounts operation returns the storage accounts that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/list permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeletedStorageListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedStorageListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedStorageAccountsNext(nextPageLink, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getDeletedStorageAccountsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeletedStorageAccountsNext(nextPageLink, options, optionalCallback); + } + } + /** * List storage SAS definitions for the given storage account. This operation * requires the storage/listsas permission. @@ -22500,6 +25895,101 @@ class KeyVaultClient extends ServiceClient { } } + /** + * @summary Lists deleted SAS definitions for the specified vault and storage + * account. + * + * The Get Deleted Sas Definitions operation returns the SAS definitions that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/listsas permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getDeletedSasDefinitionsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getDeletedSasDefinitionsNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Lists deleted SAS definitions for the specified vault and storage + * account. + * + * The Get Deleted Sas Definitions operation returns the SAS definitions that + * have been deleted for a vault enabled for soft-delete. This operation + * requires the storage/listsas permission. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DeletedSasDefinitionListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedSasDefinitionListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getDeletedSasDefinitionsNext(nextPageLink, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getDeletedSasDefinitionsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeletedSasDefinitionsNext(nextPageLink, options, optionalCallback); + } + } + } module.exports = KeyVaultClient; diff --git a/lib/services/keyvault/lib/models/backupCertificateResult.js b/lib/services/keyvault/lib/models/backupCertificateResult.js new file mode 100644 index 0000000000..6d4205ce72 --- /dev/null +++ b/lib/services/keyvault/lib/models/backupCertificateResult.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The backup certificate result, containing the backup blob. + * + */ +class BackupCertificateResult { + /** + * Create a BackupCertificateResult. + * @member {buffer} [value] The backup blob containing the backed up + * certificate. + */ + constructor() { + } + + /** + * Defines the metadata of BackupCertificateResult + * + * @returns {object} metadata of BackupCertificateResult + * + */ + mapper() { + return { + required: false, + serializedName: 'BackupCertificateResult', + type: { + name: 'Composite', + className: 'BackupCertificateResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; + } +} + +module.exports = BackupCertificateResult; diff --git a/lib/services/keyvault/lib/models/backupStorageResult.js b/lib/services/keyvault/lib/models/backupStorageResult.js new file mode 100644 index 0000000000..c39af99c8c --- /dev/null +++ b/lib/services/keyvault/lib/models/backupStorageResult.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The backup storage result, containing the backup blob. + * + */ +class BackupStorageResult { + /** + * Create a BackupStorageResult. + * @member {buffer} [value] The backup blob containing the backed up storage + * account. + */ + constructor() { + } + + /** + * Defines the metadata of BackupStorageResult + * + * @returns {object} metadata of BackupStorageResult + * + */ + mapper() { + return { + required: false, + serializedName: 'BackupStorageResult', + type: { + name: 'Composite', + className: 'BackupStorageResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; + } +} + +module.exports = BackupStorageResult; diff --git a/lib/services/keyvault/lib/models/certificateAttributes.js b/lib/services/keyvault/lib/models/certificateAttributes.js index 3a38f379c4..58468fdeca 100644 --- a/lib/services/keyvault/lib/models/certificateAttributes.js +++ b/lib/services/keyvault/lib/models/certificateAttributes.js @@ -85,6 +85,7 @@ class CertificateAttributes extends models['Attributes'] { }, recoveryLevel: { required: false, + nullable: false, readOnly: true, serializedName: 'recoveryLevel', type: { diff --git a/lib/services/keyvault/lib/models/certificateBundle.js b/lib/services/keyvault/lib/models/certificateBundle.js index b5c0a548d6..a83d21eeac 100644 --- a/lib/services/keyvault/lib/models/certificateBundle.js +++ b/lib/services/keyvault/lib/models/certificateBundle.js @@ -29,11 +29,16 @@ class CertificateBundle { * certificate. * @member {boolean} [policy.keyProperties.exportable] Indicates if the * private key can be exported. - * @member {string} [policy.keyProperties.keyType] The key type. + * @member {string} [policy.keyProperties.keyType] The type of key pair to be + * used for the certificate. Possible values include: 'EC', 'EC-HSM', 'RSA', + * 'RSA-HSM', 'oct' * @member {number} [policy.keyProperties.keySize] The key size in bits. For * example: 2048, 3072, or 4096 for RSA. * @member {boolean} [policy.keyProperties.reuseKey] Indicates if the same * key pair will be used on certificate renewal. + * @member {string} [policy.keyProperties.curve] Elliptic curve name. For + * valid values, see JsonWebKeyCurveName. Possible values include: 'P-256', + * 'P-384', 'P-521', 'P-256K' * @member {object} [policy.secretProperties] Properties of the secret * backing a certificate. * @member {string} [policy.secretProperties.contentType] The media type @@ -68,6 +73,9 @@ class CertificateBundle { * issuer object or reserved names; for example, 'Self' or 'Unknown'. * @member {string} [policy.issuerParameters.certificateType] Type of * certificate to be requested from the issuer provider. + * @member {boolean} [policy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. * @member {object} [policy.attributes] The certificate attributes. * @member {string} [policy.attributes.recoveryLevel] Reflects the deletion * recovery level currently in effect for certificates in the current vault. diff --git a/lib/services/keyvault/lib/models/certificateCreateParameters.js b/lib/services/keyvault/lib/models/certificateCreateParameters.js index 3c6ae7ad8f..1346ee7e6b 100644 --- a/lib/services/keyvault/lib/models/certificateCreateParameters.js +++ b/lib/services/keyvault/lib/models/certificateCreateParameters.js @@ -26,11 +26,16 @@ class CertificateCreateParameters { * backing a certificate. * @member {boolean} [certificatePolicy.keyProperties.exportable] Indicates * if the private key can be exported. - * @member {string} [certificatePolicy.keyProperties.keyType] The key type. + * @member {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * @member {number} [certificatePolicy.keyProperties.keySize] The key size in * bits. For example: 2048, 3072, or 4096 for RSA. * @member {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if * the same key pair will be used on certificate renewal. + * @member {string} [certificatePolicy.keyProperties.curve] Elliptic curve + * name. For valid values, see JsonWebKeyCurveName. Possible values include: + * 'P-256', 'P-384', 'P-521', 'P-256K' * @member {object} [certificatePolicy.secretProperties] Properties of the * secret backing a certificate. * @member {string} [certificatePolicy.secretProperties.contentType] The @@ -67,6 +72,10 @@ class CertificateCreateParameters { * 'Unknown'. * @member {string} [certificatePolicy.issuerParameters.certificateType] Type * of certificate to be requested from the issuer provider. + * @member {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. * @member {object} [certificatePolicy.attributes] The certificate * attributes. * @member {string} [certificatePolicy.attributes.recoveryLevel] Reflects the diff --git a/lib/services/keyvault/lib/models/certificateImportParameters.js b/lib/services/keyvault/lib/models/certificateImportParameters.js index a67709fab2..e44f238095 100644 --- a/lib/services/keyvault/lib/models/certificateImportParameters.js +++ b/lib/services/keyvault/lib/models/certificateImportParameters.js @@ -31,11 +31,16 @@ class CertificateImportParameters { * backing a certificate. * @member {boolean} [certificatePolicy.keyProperties.exportable] Indicates * if the private key can be exported. - * @member {string} [certificatePolicy.keyProperties.keyType] The key type. + * @member {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * @member {number} [certificatePolicy.keyProperties.keySize] The key size in * bits. For example: 2048, 3072, or 4096 for RSA. * @member {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if * the same key pair will be used on certificate renewal. + * @member {string} [certificatePolicy.keyProperties.curve] Elliptic curve + * name. For valid values, see JsonWebKeyCurveName. Possible values include: + * 'P-256', 'P-384', 'P-521', 'P-256K' * @member {object} [certificatePolicy.secretProperties] Properties of the * secret backing a certificate. * @member {string} [certificatePolicy.secretProperties.contentType] The @@ -72,6 +77,10 @@ class CertificateImportParameters { * 'Unknown'. * @member {string} [certificatePolicy.issuerParameters.certificateType] Type * of certificate to be requested from the issuer provider. + * @member {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. * @member {object} [certificatePolicy.attributes] The certificate * attributes. * @member {string} [certificatePolicy.attributes.recoveryLevel] Reflects the diff --git a/lib/services/keyvault/lib/models/certificateOperation.js b/lib/services/keyvault/lib/models/certificateOperation.js index d19688184f..c801065808 100644 --- a/lib/services/keyvault/lib/models/certificateOperation.js +++ b/lib/services/keyvault/lib/models/certificateOperation.js @@ -26,6 +26,9 @@ class CertificateOperation { * object or reserved names; for example, 'Self' or 'Unknown'. * @member {string} [issuerParameters.certificateType] Type of certificate to * be requested from the issuer provider. + * @member {boolean} [issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. * @member {buffer} [csr] The certificate signing request (CSR) that is being * used in the certificate operation. * @member {boolean} [cancellationRequested] Indicates if cancellation was diff --git a/lib/services/keyvault/lib/models/certificatePolicy.js b/lib/services/keyvault/lib/models/certificatePolicy.js index 65f58e387c..45829f2df7 100644 --- a/lib/services/keyvault/lib/models/certificatePolicy.js +++ b/lib/services/keyvault/lib/models/certificatePolicy.js @@ -24,11 +24,16 @@ class CertificatePolicy { * certificate. * @member {boolean} [keyProperties.exportable] Indicates if the private key * can be exported. - * @member {string} [keyProperties.keyType] The key type. + * @member {string} [keyProperties.keyType] The type of key pair to be used + * for the certificate. Possible values include: 'EC', 'EC-HSM', 'RSA', + * 'RSA-HSM', 'oct' * @member {number} [keyProperties.keySize] The key size in bits. For * example: 2048, 3072, or 4096 for RSA. * @member {boolean} [keyProperties.reuseKey] Indicates if the same key pair * will be used on certificate renewal. + * @member {string} [keyProperties.curve] Elliptic curve name. For valid + * values, see JsonWebKeyCurveName. Possible values include: 'P-256', + * 'P-384', 'P-521', 'P-256K' * @member {object} [secretProperties] Properties of the secret backing a * certificate. * @member {string} [secretProperties.contentType] The media type (MIME @@ -57,6 +62,9 @@ class CertificatePolicy { * object or reserved names; for example, 'Self' or 'Unknown'. * @member {string} [issuerParameters.certificateType] Type of certificate to * be requested from the issuer provider. + * @member {boolean} [issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. * @member {object} [attributes] The certificate attributes. * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery * level currently in effect for certificates in the current vault. If it diff --git a/lib/services/keyvault/lib/models/certificateRestoreParameters.js b/lib/services/keyvault/lib/models/certificateRestoreParameters.js new file mode 100644 index 0000000000..01e1073478 --- /dev/null +++ b/lib/services/keyvault/lib/models/certificateRestoreParameters.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The certificate restore parameters. + * + */ +class CertificateRestoreParameters { + /** + * Create a CertificateRestoreParameters. + * @member {buffer} certificateBundleBackup The backup blob associated with a + * certificate bundle. + */ + constructor() { + } + + /** + * Defines the metadata of CertificateRestoreParameters + * + * @returns {object} metadata of CertificateRestoreParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificateRestoreParameters', + type: { + name: 'Composite', + className: 'CertificateRestoreParameters', + modelProperties: { + certificateBundleBackup: { + required: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; + } +} + +module.exports = CertificateRestoreParameters; diff --git a/lib/services/keyvault/lib/models/certificateUpdateParameters.js b/lib/services/keyvault/lib/models/certificateUpdateParameters.js index 088322c784..002cb377c0 100644 --- a/lib/services/keyvault/lib/models/certificateUpdateParameters.js +++ b/lib/services/keyvault/lib/models/certificateUpdateParameters.js @@ -26,11 +26,16 @@ class CertificateUpdateParameters { * backing a certificate. * @member {boolean} [certificatePolicy.keyProperties.exportable] Indicates * if the private key can be exported. - * @member {string} [certificatePolicy.keyProperties.keyType] The key type. + * @member {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * @member {number} [certificatePolicy.keyProperties.keySize] The key size in * bits. For example: 2048, 3072, or 4096 for RSA. * @member {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if * the same key pair will be used on certificate renewal. + * @member {string} [certificatePolicy.keyProperties.curve] Elliptic curve + * name. For valid values, see JsonWebKeyCurveName. Possible values include: + * 'P-256', 'P-384', 'P-521', 'P-256K' * @member {object} [certificatePolicy.secretProperties] Properties of the * secret backing a certificate. * @member {string} [certificatePolicy.secretProperties.contentType] The @@ -67,6 +72,10 @@ class CertificateUpdateParameters { * 'Unknown'. * @member {string} [certificatePolicy.issuerParameters.certificateType] Type * of certificate to be requested from the issuer provider. + * @member {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. * @member {object} [certificatePolicy.attributes] The certificate * attributes. * @member {string} [certificatePolicy.attributes.recoveryLevel] Reflects the diff --git a/lib/services/keyvault/lib/models/deletedSasDefinitionBundle.js b/lib/services/keyvault/lib/models/deletedSasDefinitionBundle.js new file mode 100644 index 0000000000..1d179fa87c --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedSasDefinitionBundle.js @@ -0,0 +1,142 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A deleted SAS definition bundle consisting of its previous id, attributes + * and its tags, as well as information on when it will be purged. + * + * @extends models['SasDefinitionBundle'] + */ +class DeletedSasDefinitionBundle extends models['SasDefinitionBundle'] { + /** + * Create a DeletedSasDefinitionBundle. + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted SAS definition. + * @member {date} [scheduledPurgeDate] The time when the SAS definition is + * scheduled to be purged, in UTC + * @member {date} [deletedDate] The time when the SAS definition was deleted, + * in UTC + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedSasDefinitionBundle + * + * @returns {object} metadata of DeletedSasDefinitionBundle + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedSasDefinitionBundle', + type: { + name: 'Composite', + className: 'DeletedSasDefinitionBundle', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + secretId: { + required: false, + readOnly: true, + serializedName: 'sid', + type: { + name: 'String' + } + }, + templateUri: { + required: false, + readOnly: true, + serializedName: 'templateUri', + type: { + name: 'String' + } + }, + sasType: { + required: false, + readOnly: true, + serializedName: 'sasType', + type: { + name: 'String' + } + }, + validityPeriod: { + required: false, + readOnly: true, + serializedName: 'validityPeriod', + type: { + name: 'String' + } + }, + attributes: { + required: false, + readOnly: true, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'SasDefinitionAttributes' + } + }, + tags: { + required: false, + readOnly: true, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + recoveryId: { + required: false, + serializedName: 'recoveryId', + type: { + name: 'String' + } + }, + scheduledPurgeDate: { + required: false, + readOnly: true, + serializedName: 'scheduledPurgeDate', + type: { + name: 'UnixTime' + } + }, + deletedDate: { + required: false, + readOnly: true, + serializedName: 'deletedDate', + type: { + name: 'UnixTime' + } + } + } + } + }; + } +} + +module.exports = DeletedSasDefinitionBundle; diff --git a/lib/services/keyvault/lib/models/deletedSasDefinitionItem.js b/lib/services/keyvault/lib/models/deletedSasDefinitionItem.js new file mode 100644 index 0000000000..67a6cec662 --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedSasDefinitionItem.js @@ -0,0 +1,118 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The deleted SAS definition item containing metadata about the deleted SAS + * definition. + * + * @extends models['SasDefinitionItem'] + */ +class DeletedSasDefinitionItem extends models['SasDefinitionItem'] { + /** + * Create a DeletedSasDefinitionItem. + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted SAS definition. + * @member {date} [scheduledPurgeDate] The time when the SAS definition is + * scheduled to be purged, in UTC + * @member {date} [deletedDate] The time when the SAS definition was deleted, + * in UTC + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedSasDefinitionItem + * + * @returns {object} metadata of DeletedSasDefinitionItem + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedSasDefinitionItem', + type: { + name: 'Composite', + className: 'DeletedSasDefinitionItem', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + secretId: { + required: false, + readOnly: true, + serializedName: 'sid', + type: { + name: 'String' + } + }, + attributes: { + required: false, + readOnly: true, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'SasDefinitionAttributes' + } + }, + tags: { + required: false, + readOnly: true, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + recoveryId: { + required: false, + serializedName: 'recoveryId', + type: { + name: 'String' + } + }, + scheduledPurgeDate: { + required: false, + readOnly: true, + serializedName: 'scheduledPurgeDate', + type: { + name: 'UnixTime' + } + }, + deletedDate: { + required: false, + readOnly: true, + serializedName: 'deletedDate', + type: { + name: 'UnixTime' + } + } + } + } + }; + } +} + +module.exports = DeletedSasDefinitionItem; diff --git a/lib/services/keyvault/lib/models/deletedSasDefinitionListResult.js b/lib/services/keyvault/lib/models/deletedSasDefinitionListResult.js new file mode 100644 index 0000000000..ce7274df6b --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedSasDefinitionListResult.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The deleted SAS definition list result + */ +class DeletedSasDefinitionListResult extends Array { + /** + * Create a DeletedSasDefinitionListResult. + * @member {string} [nextLink] The URL to get the next set of deleted SAS + * definitions. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedSasDefinitionListResult + * + * @returns {object} metadata of DeletedSasDefinitionListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedSasDefinitionListResult', + type: { + name: 'Composite', + className: 'DeletedSasDefinitionListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DeletedSasDefinitionItemElementType', + type: { + name: 'Composite', + className: 'DeletedSasDefinitionItem' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DeletedSasDefinitionListResult; diff --git a/lib/services/keyvault/lib/models/deletedStorageAccountItem.js b/lib/services/keyvault/lib/models/deletedStorageAccountItem.js new file mode 100644 index 0000000000..1dbc8e68c2 --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedStorageAccountItem.js @@ -0,0 +1,118 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The deleted storage account item containing metadata about the deleted + * storage account. + * + * @extends models['StorageAccountItem'] + */ +class DeletedStorageAccountItem extends models['StorageAccountItem'] { + /** + * Create a DeletedStorageAccountItem. + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted storage account. + * @member {date} [scheduledPurgeDate] The time when the storage account is + * scheduled to be purged, in UTC + * @member {date} [deletedDate] The time when the storage account was + * deleted, in UTC + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedStorageAccountItem + * + * @returns {object} metadata of DeletedStorageAccountItem + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedStorageAccountItem', + type: { + name: 'Composite', + className: 'DeletedStorageAccountItem', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resourceId: { + required: false, + readOnly: true, + serializedName: 'resourceId', + type: { + name: 'String' + } + }, + attributes: { + required: false, + readOnly: true, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'StorageAccountAttributes' + } + }, + tags: { + required: false, + readOnly: true, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + recoveryId: { + required: false, + serializedName: 'recoveryId', + type: { + name: 'String' + } + }, + scheduledPurgeDate: { + required: false, + readOnly: true, + serializedName: 'scheduledPurgeDate', + type: { + name: 'UnixTime' + } + }, + deletedDate: { + required: false, + readOnly: true, + serializedName: 'deletedDate', + type: { + name: 'UnixTime' + } + } + } + } + }; + } +} + +module.exports = DeletedStorageAccountItem; diff --git a/lib/services/keyvault/lib/models/deletedStorageBundle.js b/lib/services/keyvault/lib/models/deletedStorageBundle.js new file mode 100644 index 0000000000..9c25a84c6c --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedStorageBundle.js @@ -0,0 +1,142 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A deleted storage account bundle consisting of its previous id, attributes + * and its tags, as well as information on when it will be purged. + * + * @extends models['StorageBundle'] + */ +class DeletedStorageBundle extends models['StorageBundle'] { + /** + * Create a DeletedStorageBundle. + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted storage account. + * @member {date} [scheduledPurgeDate] The time when the storage account is + * scheduled to be purged, in UTC + * @member {date} [deletedDate] The time when the storage account was + * deleted, in UTC + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedStorageBundle + * + * @returns {object} metadata of DeletedStorageBundle + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedStorageBundle', + type: { + name: 'Composite', + className: 'DeletedStorageBundle', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resourceId: { + required: false, + readOnly: true, + serializedName: 'resourceId', + type: { + name: 'String' + } + }, + activeKeyName: { + required: false, + readOnly: true, + serializedName: 'activeKeyName', + type: { + name: 'String' + } + }, + autoRegenerateKey: { + required: false, + readOnly: true, + serializedName: 'autoRegenerateKey', + type: { + name: 'Boolean' + } + }, + regenerationPeriod: { + required: false, + readOnly: true, + serializedName: 'regenerationPeriod', + type: { + name: 'String' + } + }, + attributes: { + required: false, + readOnly: true, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'StorageAccountAttributes' + } + }, + tags: { + required: false, + readOnly: true, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + recoveryId: { + required: false, + serializedName: 'recoveryId', + type: { + name: 'String' + } + }, + scheduledPurgeDate: { + required: false, + readOnly: true, + serializedName: 'scheduledPurgeDate', + type: { + name: 'UnixTime' + } + }, + deletedDate: { + required: false, + readOnly: true, + serializedName: 'deletedDate', + type: { + name: 'UnixTime' + } + } + } + } + }; + } +} + +module.exports = DeletedStorageBundle; diff --git a/lib/services/keyvault/lib/models/deletedStorageListResult.js b/lib/services/keyvault/lib/models/deletedStorageListResult.js new file mode 100644 index 0000000000..1552959951 --- /dev/null +++ b/lib/services/keyvault/lib/models/deletedStorageListResult.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The deleted storage account list result + */ +class DeletedStorageListResult extends Array { + /** + * Create a DeletedStorageListResult. + * @member {string} [nextLink] The URL to get the next set of deleted storage + * accounts. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedStorageListResult + * + * @returns {object} metadata of DeletedStorageListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedStorageListResult', + type: { + name: 'Composite', + className: 'DeletedStorageListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DeletedStorageAccountItemElementType', + type: { + name: 'Composite', + className: 'DeletedStorageAccountItem' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DeletedStorageListResult; diff --git a/lib/services/keyvault/lib/models/index.d.ts b/lib/services/keyvault/lib/models/index.d.ts index b3d6a9887e..9703d0227b 100644 --- a/lib/services/keyvault/lib/models/index.d.ts +++ b/lib/services/keyvault/lib/models/index.d.ts @@ -43,8 +43,9 @@ export interface Attributes { * As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18 * * @member {string} [kid] Key identifier. - * @member {string} [kty] JsonWebKey key type (kty). Possible values include: - * 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @member {string} [kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible + * values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * @member {array} [keyOps] * @member {buffer} [n] RSA modulus. * @member {buffer} [e] RSA public exponent. @@ -59,7 +60,7 @@ export interface Attributes { * @member {buffer} [t] HSM Token, used with 'Bring Your Own Key'. * @member {string} [crv] Elliptic curve name. For valid values, see * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', - * 'SECP256K1' + * 'P-256K' * @member {buffer} [x] X component of an EC public key. * @member {buffer} [y] Y component of an EC public key. */ @@ -107,8 +108,9 @@ export interface KeyAttributes extends Attributes { * * @member {object} [key] The Json web key. * @member {string} [key.kid] Key identifier. - * @member {string} [key.kty] JsonWebKey key type (kty). Possible values - * include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @member {string} [key.kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible + * values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * @member {array} [key.keyOps] * @member {buffer} [key.n] RSA modulus. * @member {buffer} [key.e] RSA public exponent. @@ -123,7 +125,7 @@ export interface KeyAttributes extends Attributes { * @member {buffer} [key.t] HSM Token, used with 'Bring Your Own Key'. * @member {string} [key.crv] Elliptic curve name. For valid values, see * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', - * 'SECP256K1' + * 'P-256K' * @member {buffer} [key.x] X component of an EC public key. * @member {buffer} [key.y] Y component of an EC public key. * @member {object} [attributes] The key management attributes. @@ -337,6 +339,19 @@ export interface SecretRestoreParameters { secretBundleBackup: Buffer; } +/** + * @class + * Initializes a new instance of the StorageRestoreParameters class. + * @constructor + * The secret restore parameters. + * + * @member {buffer} storageBundleBackup The backup blob associated with a + * storage account. + */ +export interface StorageRestoreParameters { + storageBundleBackup: Buffer; +} + /** * @class * Initializes a new instance of the CertificateAttributes class. @@ -400,17 +415,23 @@ export interface CertificateIssuerItem { * Properties of the key pair backing a certificate. * * @member {boolean} [exportable] Indicates if the private key can be exported. - * @member {string} [keyType] The key type. + * @member {string} [keyType] The type of key pair to be used for the + * certificate. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', + * 'oct' * @member {number} [keySize] The key size in bits. For example: 2048, 3072, or * 4096 for RSA. * @member {boolean} [reuseKey] Indicates if the same key pair will be used on * certificate renewal. + * @member {string} [curve] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' */ export interface KeyProperties { exportable?: boolean; keyType?: string; keySize?: number; reuseKey?: boolean; + curve?: string; } /** @@ -529,10 +550,14 @@ export interface LifetimeAction { * names; for example, 'Self' or 'Unknown'. * @member {string} [certificateType] Type of certificate to be requested from * the issuer provider. + * @member {boolean} [certificateTransparency] Indicates if the certificates + * generated under this policy should be published to certificate transparency + * logs. */ export interface IssuerParameters { name?: string; certificateType?: string; + certificateTransparency?: boolean; } /** @@ -546,11 +571,16 @@ export interface IssuerParameters { * certificate. * @member {boolean} [keyProperties.exportable] Indicates if the private key * can be exported. - * @member {string} [keyProperties.keyType] The key type. + * @member {string} [keyProperties.keyType] The type of key pair to be used for + * the certificate. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', + * 'oct' * @member {number} [keyProperties.keySize] The key size in bits. For example: * 2048, 3072, or 4096 for RSA. * @member {boolean} [keyProperties.reuseKey] Indicates if the same key pair * will be used on certificate renewal. + * @member {string} [keyProperties.curve] Elliptic curve name. For valid + * values, see JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', + * 'P-521', 'P-256K' * @member {object} [secretProperties] Properties of the secret backing a * certificate. * @member {string} [secretProperties.contentType] The media type (MIME type). @@ -578,6 +608,9 @@ export interface IssuerParameters { * object or reserved names; for example, 'Self' or 'Unknown'. * @member {string} [issuerParameters.certificateType] Type of certificate to * be requested from the issuer provider. + * @member {boolean} [issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. * @member {object} [attributes] The certificate attributes. * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery * level currently in effect for certificates in the current vault. If it @@ -612,11 +645,16 @@ export interface CertificatePolicy { * certificate. * @member {boolean} [policy.keyProperties.exportable] Indicates if the private * key can be exported. - * @member {string} [policy.keyProperties.keyType] The key type. + * @member {string} [policy.keyProperties.keyType] The type of key pair to be + * used for the certificate. Possible values include: 'EC', 'EC-HSM', 'RSA', + * 'RSA-HSM', 'oct' * @member {number} [policy.keyProperties.keySize] The key size in bits. For * example: 2048, 3072, or 4096 for RSA. * @member {boolean} [policy.keyProperties.reuseKey] Indicates if the same key * pair will be used on certificate renewal. + * @member {string} [policy.keyProperties.curve] Elliptic curve name. For valid + * values, see JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', + * 'P-521', 'P-256K' * @member {object} [policy.secretProperties] Properties of the secret backing * a certificate. * @member {string} [policy.secretProperties.contentType] The media type (MIME @@ -650,6 +688,9 @@ export interface CertificatePolicy { * issuer object or reserved names; for example, 'Self' or 'Unknown'. * @member {string} [policy.issuerParameters.certificateType] Type of * certificate to be requested from the issuer provider. + * @member {boolean} [policy.issuerParameters.certificateTransparency] + * Indicates if the certificates generated under this policy should be + * published to certificate transparency logs. * @member {object} [policy.attributes] The certificate attributes. * @member {string} [policy.attributes.recoveryLevel] Reflects the deletion * recovery level currently in effect for certificates in the current vault. If @@ -750,6 +791,9 @@ export interface ErrorModel { * object or reserved names; for example, 'Self' or 'Unknown'. * @member {string} [issuerParameters.certificateType] Type of certificate to * be requested from the issuer provider. + * @member {boolean} [issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. * @member {buffer} [csr] The certificate signing request (CSR) that is being * used in the certificate operation. * @member {boolean} [cancellationRequested] Indicates if cancellation was @@ -924,7 +968,7 @@ export interface Contacts { * key-value pairs. * @member {string} [curve] Elliptic curve name. For valid values, see * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', - * 'SECP256K1' + * 'P-256K' */ export interface KeyCreateParameters { kty: string; @@ -945,8 +989,9 @@ export interface KeyCreateParameters { * software key. * @member {object} key The Json web key * @member {string} [key.kid] Key identifier. - * @member {string} [key.kty] JsonWebKey key type (kty). Possible values - * include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @member {string} [key.kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. Possible + * values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * @member {array} [key.keyOps] * @member {buffer} [key.n] RSA modulus. * @member {buffer} [key.e] RSA public exponent. @@ -961,7 +1006,7 @@ export interface KeyCreateParameters { * @member {buffer} [key.t] HSM Token, used with 'Bring Your Own Key'. * @member {string} [key.crv] Elliptic curve name. For valid values, see * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', - * 'SECP256K1' + * 'P-256K' * @member {buffer} [key.x] X component of an EC public key. * @member {buffer} [key.y] Y component of an EC public key. * @member {object} [keyAttributes] The key management attributes. @@ -1006,7 +1051,7 @@ export interface KeyOperationsParameters { * For more information on possible algorithm types, see * JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', * 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', - * 'ECDSA256' + * 'ES256K' * @member {buffer} value */ export interface KeySignParameters { @@ -1023,7 +1068,7 @@ export interface KeySignParameters { * @member {string} algorithm The signing/verification algorithm. For more * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. * Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', - * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256' + * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' * @member {buffer} digest The digest used for signing. * @member {buffer} signature The signature to be verified. */ @@ -1131,11 +1176,16 @@ export interface SecretUpdateParameters { * backing a certificate. * @member {boolean} [certificatePolicy.keyProperties.exportable] Indicates if * the private key can be exported. - * @member {string} [certificatePolicy.keyProperties.keyType] The key type. + * @member {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * @member {number} [certificatePolicy.keyProperties.keySize] The key size in * bits. For example: 2048, 3072, or 4096 for RSA. * @member {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if * the same key pair will be used on certificate renewal. + * @member {string} [certificatePolicy.keyProperties.curve] Elliptic curve + * name. For valid values, see JsonWebKeyCurveName. Possible values include: + * 'P-256', 'P-384', 'P-521', 'P-256K' * @member {object} [certificatePolicy.secretProperties] Properties of the * secret backing a certificate. * @member {string} [certificatePolicy.secretProperties.contentType] The media @@ -1172,6 +1222,10 @@ export interface SecretUpdateParameters { * 'Unknown'. * @member {string} [certificatePolicy.issuerParameters.certificateType] Type * of certificate to be requested from the issuer provider. + * @member {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. * @member {object} [certificatePolicy.attributes] The certificate attributes. * @member {string} [certificatePolicy.attributes.recoveryLevel] Reflects the * deletion recovery level currently in effect for certificates in the current @@ -1215,11 +1269,16 @@ export interface CertificateCreateParameters { * backing a certificate. * @member {boolean} [certificatePolicy.keyProperties.exportable] Indicates if * the private key can be exported. - * @member {string} [certificatePolicy.keyProperties.keyType] The key type. + * @member {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * @member {number} [certificatePolicy.keyProperties.keySize] The key size in * bits. For example: 2048, 3072, or 4096 for RSA. * @member {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if * the same key pair will be used on certificate renewal. + * @member {string} [certificatePolicy.keyProperties.curve] Elliptic curve + * name. For valid values, see JsonWebKeyCurveName. Possible values include: + * 'P-256', 'P-384', 'P-521', 'P-256K' * @member {object} [certificatePolicy.secretProperties] Properties of the * secret backing a certificate. * @member {string} [certificatePolicy.secretProperties.contentType] The media @@ -1256,6 +1315,10 @@ export interface CertificateCreateParameters { * 'Unknown'. * @member {string} [certificatePolicy.issuerParameters.certificateType] Type * of certificate to be requested from the issuer provider. + * @member {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. * @member {object} [certificatePolicy.attributes] The certificate attributes. * @member {string} [certificatePolicy.attributes.recoveryLevel] Reflects the * deletion recovery level currently in effect for certificates in the current @@ -1296,11 +1359,16 @@ export interface CertificateImportParameters { * backing a certificate. * @member {boolean} [certificatePolicy.keyProperties.exportable] Indicates if * the private key can be exported. - * @member {string} [certificatePolicy.keyProperties.keyType] The key type. + * @member {string} [certificatePolicy.keyProperties.keyType] The type of key + * pair to be used for the certificate. Possible values include: 'EC', + * 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * @member {number} [certificatePolicy.keyProperties.keySize] The key size in * bits. For example: 2048, 3072, or 4096 for RSA. * @member {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if * the same key pair will be used on certificate renewal. + * @member {string} [certificatePolicy.keyProperties.curve] Elliptic curve + * name. For valid values, see JsonWebKeyCurveName. Possible values include: + * 'P-256', 'P-384', 'P-521', 'P-256K' * @member {object} [certificatePolicy.secretProperties] Properties of the * secret backing a certificate. * @member {string} [certificatePolicy.secretProperties.contentType] The media @@ -1337,6 +1405,10 @@ export interface CertificateImportParameters { * 'Unknown'. * @member {string} [certificatePolicy.issuerParameters.certificateType] Type * of certificate to be requested from the issuer provider. + * @member {boolean} + * [certificatePolicy.issuerParameters.certificateTransparency] Indicates if + * the certificates generated under this policy should be published to + * certificate transparency logs. * @member {object} [certificatePolicy.attributes] The certificate attributes. * @member {string} [certificatePolicy.attributes.recoveryLevel] Reflects the * deletion recovery level currently in effect for certificates in the current @@ -1509,6 +1581,19 @@ export interface BackupSecretResult { readonly value?: Buffer; } +/** + * @class + * Initializes a new instance of the BackupStorageResult class. + * @constructor + * The backup storage result, containing the backup blob. + * + * @member {buffer} [value] The backup blob containing the backed up storage + * account. + */ +export interface BackupStorageResult { + readonly value?: Buffer; +} + /** * @class * Initializes a new instance of the PendingCertificateSigningRequestResult class. @@ -1531,11 +1616,18 @@ export interface PendingCertificateSigningRequestResult { * @member {boolean} [enabled] the enabled state of the object. * @member {date} [created] Creation time in UTC. * @member {date} [updated] Last updated time in UTC. + * @member {string} [recoveryLevel] Reflects the deletion recovery level + * currently in effect for storage accounts in the current vault. If it + * contains 'Purgeable' the storage account can be permanently deleted by a + * privileged user; otherwise, only the system can purge the storage account, + * at the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' */ export interface StorageAccountAttributes { enabled?: boolean; readonly created?: Date; readonly updated?: Date; + readonly recoveryLevel?: string; } /** @@ -1557,6 +1649,12 @@ export interface StorageAccountAttributes { * @member {boolean} [attributes.enabled] the enabled state of the object. * @member {date} [attributes.created] Creation time in UTC. * @member {date} [attributes.updated] Last updated time in UTC. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for storage accounts in the current vault. If it + * contains 'Purgeable' the storage account can be permanently deleted by a + * privileged user; otherwise, only the system can purge the storage account, + * at the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' * @member {object} [tags] Application specific metadata in the form of * key-value pairs */ @@ -1570,6 +1668,26 @@ export interface StorageBundle { readonly tags?: { [propertyName: string]: string }; } +/** + * @class + * Initializes a new instance of the DeletedStorageBundle class. + * @constructor + * A deleted storage account bundle consisting of its previous id, attributes + * and its tags, as well as information on when it will be purged. + * + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted storage account. + * @member {date} [scheduledPurgeDate] The time when the storage account is + * scheduled to be purged, in UTC + * @member {date} [deletedDate] The time when the storage account was deleted, + * in UTC + */ +export interface DeletedStorageBundle extends StorageBundle { + recoveryId?: string; + readonly scheduledPurgeDate?: Date; + readonly deletedDate?: Date; +} + /** * @class * Initializes a new instance of the StorageAccountCreateParameters class. @@ -1588,6 +1706,13 @@ export interface StorageBundle { * the object. * @member {date} [storageAccountAttributes.created] Creation time in UTC. * @member {date} [storageAccountAttributes.updated] Last updated time in UTC. + * @member {string} [storageAccountAttributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for storage accounts in the + * current vault. If it contains 'Purgeable' the storage account can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the storage account, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' * @member {object} [tags] Application specific metadata in the form of * key-value pairs. */ @@ -1618,6 +1743,13 @@ export interface StorageAccountCreateParameters { * the object. * @member {date} [storageAccountAttributes.created] Creation time in UTC. * @member {date} [storageAccountAttributes.updated] Last updated time in UTC. + * @member {string} [storageAccountAttributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for storage accounts in the + * current vault. If it contains 'Purgeable' the storage account can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the storage account, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' * @member {object} [tags] Application specific metadata in the form of * key-value pairs. */ @@ -1653,6 +1785,12 @@ export interface StorageAccountRegenerteKeyParameters { * @member {boolean} [attributes.enabled] the enabled state of the object. * @member {date} [attributes.created] Creation time in UTC. * @member {date} [attributes.updated] Last updated time in UTC. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for storage accounts in the current vault. If it + * contains 'Purgeable' the storage account can be permanently deleted by a + * privileged user; otherwise, only the system can purge the storage account, + * at the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' * @member {object} [tags] Application specific metadata in the form of * key-value pairs. */ @@ -1663,6 +1801,26 @@ export interface StorageAccountItem { readonly tags?: { [propertyName: string]: string }; } +/** + * @class + * Initializes a new instance of the DeletedStorageAccountItem class. + * @constructor + * The deleted storage account item containing metadata about the deleted + * storage account. + * + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted storage account. + * @member {date} [scheduledPurgeDate] The time when the storage account is + * scheduled to be purged, in UTC + * @member {date} [deletedDate] The time when the storage account was deleted, + * in UTC + */ +export interface DeletedStorageAccountItem extends StorageAccountItem { + recoveryId?: string; + readonly scheduledPurgeDate?: Date; + readonly deletedDate?: Date; +} + /** * @class * Initializes a new instance of the SasDefinitionAttributes class. @@ -1672,11 +1830,18 @@ export interface StorageAccountItem { * @member {boolean} [enabled] the enabled state of the object. * @member {date} [created] Creation time in UTC. * @member {date} [updated] Last updated time in UTC. + * @member {string} [recoveryLevel] Reflects the deletion recovery level + * currently in effect for SAS definitions in the current vault. If it contains + * 'Purgeable' the SAS definition can be permanently deleted by a privileged + * user; otherwise, only the system can purge the SAS definition, at the end of + * the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' */ export interface SasDefinitionAttributes { enabled?: boolean; readonly created?: Date; readonly updated?: Date; + readonly recoveryLevel?: string; } /** @@ -1688,23 +1853,56 @@ export interface SasDefinitionAttributes { * * @member {string} [id] The SAS definition id. * @member {string} [secretId] Storage account SAS definition secret id. - * @member {object} [parameters] The SAS definition metadata in the form of - * key-value pairs. + * @member {string} [templateUri] The SAS definition token template signed with + * an arbitrary key. Tokens created according to the SAS definition will have + * the same properties as the template. + * @member {string} [sasType] The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * @member {string} [validityPeriod] The validity period of SAS tokens created + * according to the SAS definition. * @member {object} [attributes] The SAS definition attributes. * @member {boolean} [attributes.enabled] the enabled state of the object. * @member {date} [attributes.created] Creation time in UTC. * @member {date} [attributes.updated] Last updated time in UTC. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for SAS definitions in the current vault. If it + * contains 'Purgeable' the SAS definition can be permanently deleted by a + * privileged user; otherwise, only the system can purge the SAS definition, at + * the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' * @member {object} [tags] Application specific metadata in the form of * key-value pairs */ export interface SasDefinitionBundle { readonly id?: string; readonly secretId?: string; - readonly parameters?: { [propertyName: string]: string }; + readonly templateUri?: string; + readonly sasType?: string; + readonly validityPeriod?: string; readonly attributes?: SasDefinitionAttributes; readonly tags?: { [propertyName: string]: string }; } +/** + * @class + * Initializes a new instance of the DeletedSasDefinitionBundle class. + * @constructor + * A deleted SAS definition bundle consisting of its previous id, attributes + * and its tags, as well as information on when it will be purged. + * + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted SAS definition. + * @member {date} [scheduledPurgeDate] The time when the SAS definition is + * scheduled to be purged, in UTC + * @member {date} [deletedDate] The time when the SAS definition was deleted, + * in UTC + */ +export interface DeletedSasDefinitionBundle extends SasDefinitionBundle { + recoveryId?: string; + readonly scheduledPurgeDate?: Date; + readonly deletedDate?: Date; +} + /** * @class * Initializes a new instance of the SasDefinitionItem class. @@ -1717,6 +1915,12 @@ export interface SasDefinitionBundle { * @member {boolean} [attributes.enabled] the enabled state of the object. * @member {date} [attributes.created] Creation time in UTC. * @member {date} [attributes.updated] Last updated time in UTC. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for SAS definitions in the current vault. If it + * contains 'Purgeable' the SAS definition can be permanently deleted by a + * privileged user; otherwise, only the system can purge the SAS definition, at + * the end of the retention interval. Possible values include: 'Purgeable', + * 'Recoverable+Purgeable', 'Recoverable', 'Recoverable+ProtectedSubscription' * @member {object} [tags] Application specific metadata in the form of * key-value pairs. */ @@ -1727,25 +1931,59 @@ export interface SasDefinitionItem { readonly tags?: { [propertyName: string]: string }; } +/** + * @class + * Initializes a new instance of the DeletedSasDefinitionItem class. + * @constructor + * The deleted SAS definition item containing metadata about the deleted SAS + * definition. + * + * @member {string} [recoveryId] The url of the recovery object, used to + * identify and recover the deleted SAS definition. + * @member {date} [scheduledPurgeDate] The time when the SAS definition is + * scheduled to be purged, in UTC + * @member {date} [deletedDate] The time when the SAS definition was deleted, + * in UTC + */ +export interface DeletedSasDefinitionItem extends SasDefinitionItem { + recoveryId?: string; + readonly scheduledPurgeDate?: Date; + readonly deletedDate?: Date; +} + /** * @class * Initializes a new instance of the SasDefinitionCreateParameters class. * @constructor * The SAS definition create parameters. * - * @member {object} parameters Sas definition creation metadata in the form of - * key-value pairs. + * @member {string} templateUri The SAS definition token template signed with + * an arbitrary key. Tokens created according to the SAS definition will have + * the same properties as the template. + * @member {string} sasType The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * @member {string} validityPeriod The validity period of SAS tokens created + * according to the SAS definition. * @member {object} [sasDefinitionAttributes] The attributes of the SAS * definition. * @member {boolean} [sasDefinitionAttributes.enabled] the enabled state of the * object. * @member {date} [sasDefinitionAttributes.created] Creation time in UTC. * @member {date} [sasDefinitionAttributes.updated] Last updated time in UTC. + * @member {string} [sasDefinitionAttributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for SAS definitions in the + * current vault. If it contains 'Purgeable' the SAS definition can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the SAS definition, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' * @member {object} [tags] Application specific metadata in the form of * key-value pairs. */ export interface SasDefinitionCreateParameters { - parameters: { [propertyName: string]: string }; + templateUri: string; + sasType: string; + validityPeriod: string; sasDefinitionAttributes?: SasDefinitionAttributes; tags?: { [propertyName: string]: string }; } @@ -1756,19 +1994,33 @@ export interface SasDefinitionCreateParameters { * @constructor * The SAS definition update parameters. * - * @member {object} [parameters] Sas definition update metadata in the form of - * key-value pairs. + * @member {string} [templateUri] The SAS definition token template signed with + * an arbitrary key. Tokens created according to the SAS definition will have + * the same properties as the template. + * @member {string} [sasType] The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * @member {string} [validityPeriod] The validity period of SAS tokens created + * according to the SAS definition. * @member {object} [sasDefinitionAttributes] The attributes of the SAS * definition. * @member {boolean} [sasDefinitionAttributes.enabled] the enabled state of the * object. * @member {date} [sasDefinitionAttributes.created] Creation time in UTC. * @member {date} [sasDefinitionAttributes.updated] Last updated time in UTC. + * @member {string} [sasDefinitionAttributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for SAS definitions in the + * current vault. If it contains 'Purgeable' the SAS definition can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the SAS definition, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' * @member {object} [tags] Application specific metadata in the form of * key-value pairs. */ export interface SasDefinitionUpdateParameters { - parameters?: { [propertyName: string]: string }; + templateUri?: string; + sasType?: string; + validityPeriod?: string; sasDefinitionAttributes?: SasDefinitionAttributes; tags?: { [propertyName: string]: string }; } @@ -1788,6 +2040,32 @@ export interface KeyVaultError { readonly error?: ErrorModel; } +/** + * @class + * Initializes a new instance of the CertificateRestoreParameters class. + * @constructor + * The certificate restore parameters. + * + * @member {buffer} certificateBundleBackup The backup blob associated with a + * certificate bundle. + */ +export interface CertificateRestoreParameters { + certificateBundleBackup: Buffer; +} + +/** + * @class + * Initializes a new instance of the BackupCertificateResult class. + * @constructor + * The backup certificate result, containing the backup blob. + * + * @member {buffer} [value] The backup blob containing the backed up + * certificate. + */ +export interface BackupCertificateResult { + readonly value?: Buffer; +} + /** * @class @@ -1887,6 +2165,19 @@ export interface StorageListResult extends Array { readonly nextLink?: string; } +/** + * @class + * Initializes a new instance of the DeletedStorageListResult class. + * @constructor + * The deleted storage account list result + * + * @member {string} [nextLink] The URL to get the next set of deleted storage + * accounts. + */ +export interface DeletedStorageListResult extends Array { + readonly nextLink?: string; +} + /** * @class * Initializes a new instance of the SasDefinitionListResult class. @@ -1898,3 +2189,16 @@ export interface StorageListResult extends Array { export interface SasDefinitionListResult extends Array { readonly nextLink?: string; } + +/** + * @class + * Initializes a new instance of the DeletedSasDefinitionListResult class. + * @constructor + * The deleted SAS definition list result + * + * @member {string} [nextLink] The URL to get the next set of deleted SAS + * definitions. + */ +export interface DeletedSasDefinitionListResult extends Array { + readonly nextLink?: string; +} diff --git a/lib/services/keyvault/lib/models/index.js b/lib/services/keyvault/lib/models/index.js index 4af7b4d642..8514dd4e34 100644 --- a/lib/services/keyvault/lib/models/index.js +++ b/lib/services/keyvault/lib/models/index.js @@ -31,6 +31,7 @@ exports.SecretItem = require('./secretItem'); exports.DeletedSecretBundle = require('./deletedSecretBundle'); exports.DeletedSecretItem = require('./deletedSecretItem'); exports.SecretRestoreParameters = require('./secretRestoreParameters'); +exports.StorageRestoreParameters = require('./storageRestoreParameters'); exports.CertificateAttributes = require('./certificateAttributes'); exports.CertificateItem = require('./certificateItem'); exports.CertificateIssuerItem = require('./certificateIssuerItem'); @@ -75,19 +76,26 @@ exports.KeyOperationResult = require('./keyOperationResult'); exports.KeyVerifyResult = require('./keyVerifyResult'); exports.BackupKeyResult = require('./backupKeyResult'); exports.BackupSecretResult = require('./backupSecretResult'); +exports.BackupStorageResult = require('./backupStorageResult'); exports.PendingCertificateSigningRequestResult = require('./pendingCertificateSigningRequestResult'); exports.StorageAccountAttributes = require('./storageAccountAttributes'); exports.StorageBundle = require('./storageBundle'); +exports.DeletedStorageBundle = require('./deletedStorageBundle'); exports.StorageAccountCreateParameters = require('./storageAccountCreateParameters'); exports.StorageAccountUpdateParameters = require('./storageAccountUpdateParameters'); exports.StorageAccountRegenerteKeyParameters = require('./storageAccountRegenerteKeyParameters'); exports.StorageAccountItem = require('./storageAccountItem'); +exports.DeletedStorageAccountItem = require('./deletedStorageAccountItem'); exports.SasDefinitionAttributes = require('./sasDefinitionAttributes'); exports.SasDefinitionBundle = require('./sasDefinitionBundle'); +exports.DeletedSasDefinitionBundle = require('./deletedSasDefinitionBundle'); exports.SasDefinitionItem = require('./sasDefinitionItem'); +exports.DeletedSasDefinitionItem = require('./deletedSasDefinitionItem'); exports.SasDefinitionCreateParameters = require('./sasDefinitionCreateParameters'); exports.SasDefinitionUpdateParameters = require('./sasDefinitionUpdateParameters'); exports.KeyVaultError = require('./keyVaultError'); +exports.CertificateRestoreParameters = require('./certificateRestoreParameters'); +exports.BackupCertificateResult = require('./backupCertificateResult'); exports.KeyListResult = require('./keyListResult'); exports.DeletedKeyListResult = require('./deletedKeyListResult'); exports.SecretListResult = require('./secretListResult'); @@ -96,4 +104,6 @@ exports.CertificateListResult = require('./certificateListResult'); exports.CertificateIssuerListResult = require('./certificateIssuerListResult'); exports.DeletedCertificateListResult = require('./deletedCertificateListResult'); exports.StorageListResult = require('./storageListResult'); +exports.DeletedStorageListResult = require('./deletedStorageListResult'); exports.SasDefinitionListResult = require('./sasDefinitionListResult'); +exports.DeletedSasDefinitionListResult = require('./deletedSasDefinitionListResult'); diff --git a/lib/services/keyvault/lib/models/issuerParameters.js b/lib/services/keyvault/lib/models/issuerParameters.js index f96d902ae3..ed0b95c84d 100644 --- a/lib/services/keyvault/lib/models/issuerParameters.js +++ b/lib/services/keyvault/lib/models/issuerParameters.js @@ -21,6 +21,9 @@ class IssuerParameters { * names; for example, 'Self' or 'Unknown'. * @member {string} [certificateType] Type of certificate to be requested * from the issuer provider. + * @member {boolean} [certificateTransparency] Indicates if the certificates + * generated under this policy should be published to certificate + * transparency logs. */ constructor() { } @@ -52,6 +55,13 @@ class IssuerParameters { type: { name: 'String' } + }, + certificateTransparency: { + required: false, + serializedName: 'cert_transparency', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/keyvault/lib/models/jsonWebKey.js b/lib/services/keyvault/lib/models/jsonWebKey.js index 5c0b221573..b79057c182 100644 --- a/lib/services/keyvault/lib/models/jsonWebKey.js +++ b/lib/services/keyvault/lib/models/jsonWebKey.js @@ -18,8 +18,9 @@ class JsonWebKey { /** * Create a JsonWebKey. * @member {string} [kid] Key identifier. - * @member {string} [kty] JsonWebKey key type (kty). Possible values include: - * 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @member {string} [kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. + * Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * @member {array} [keyOps] * @member {buffer} [n] RSA modulus. * @member {buffer} [e] RSA public exponent. @@ -34,7 +35,7 @@ class JsonWebKey { * @member {buffer} [t] HSM Token, used with 'Bring Your Own Key'. * @member {string} [crv] Elliptic curve name. For valid values, see * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', - * 'SECP256K1' + * 'P-256K' * @member {buffer} [x] X component of an EC public key. * @member {buffer} [y] Y component of an EC public key. */ diff --git a/lib/services/keyvault/lib/models/keyAttributes.js b/lib/services/keyvault/lib/models/keyAttributes.js index 311392388c..9ce35133ae 100644 --- a/lib/services/keyvault/lib/models/keyAttributes.js +++ b/lib/services/keyvault/lib/models/keyAttributes.js @@ -84,6 +84,7 @@ class KeyAttributes extends models['Attributes'] { }, recoveryLevel: { required: false, + nullable: false, readOnly: true, serializedName: 'recoveryLevel', type: { diff --git a/lib/services/keyvault/lib/models/keyBundle.js b/lib/services/keyvault/lib/models/keyBundle.js index 2c554e4c9e..6efcc4d4af 100644 --- a/lib/services/keyvault/lib/models/keyBundle.js +++ b/lib/services/keyvault/lib/models/keyBundle.js @@ -21,8 +21,9 @@ class KeyBundle { * Create a KeyBundle. * @member {object} [key] The Json web key. * @member {string} [key.kid] Key identifier. - * @member {string} [key.kty] JsonWebKey key type (kty). Possible values - * include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @member {string} [key.kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. + * Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * @member {array} [key.keyOps] * @member {buffer} [key.n] RSA modulus. * @member {buffer} [key.e] RSA public exponent. @@ -37,7 +38,7 @@ class KeyBundle { * @member {buffer} [key.t] HSM Token, used with 'Bring Your Own Key'. * @member {string} [key.crv] Elliptic curve name. For valid values, see * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', - * 'SECP256K1' + * 'P-256K' * @member {buffer} [key.x] X component of an EC public key. * @member {buffer} [key.y] Y component of an EC public key. * @member {object} [attributes] The key management attributes. diff --git a/lib/services/keyvault/lib/models/keyCreateParameters.js b/lib/services/keyvault/lib/models/keyCreateParameters.js index 42d490277d..7c7708bc20 100644 --- a/lib/services/keyvault/lib/models/keyCreateParameters.js +++ b/lib/services/keyvault/lib/models/keyCreateParameters.js @@ -37,7 +37,7 @@ class KeyCreateParameters { * key-value pairs. * @member {string} [curve] Elliptic curve name. For valid values, see * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', - * 'SECP256K1' + * 'P-256K' */ constructor() { } @@ -80,7 +80,7 @@ class KeyCreateParameters { name: 'Sequence', element: { required: false, - serializedName: 'StringElementType', + serializedName: 'JsonWebKeyOperationElementType', type: { name: 'String' } diff --git a/lib/services/keyvault/lib/models/keyImportParameters.js b/lib/services/keyvault/lib/models/keyImportParameters.js index 224f128ce8..fc520230be 100644 --- a/lib/services/keyvault/lib/models/keyImportParameters.js +++ b/lib/services/keyvault/lib/models/keyImportParameters.js @@ -23,8 +23,9 @@ class KeyImportParameters { * software key. * @member {object} key The Json web key * @member {string} [key.kid] Key identifier. - * @member {string} [key.kty] JsonWebKey key type (kty). Possible values - * include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + * @member {string} [key.kty] JsonWebKey Key Type (kty), as defined in + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. + * Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' * @member {array} [key.keyOps] * @member {buffer} [key.n] RSA modulus. * @member {buffer} [key.e] RSA public exponent. @@ -39,7 +40,7 @@ class KeyImportParameters { * @member {buffer} [key.t] HSM Token, used with 'Bring Your Own Key'. * @member {string} [key.crv] Elliptic curve name. For valid values, see * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', - * 'SECP256K1' + * 'P-256K' * @member {buffer} [key.x] X component of an EC public key. * @member {buffer} [key.y] Y component of an EC public key. * @member {object} [keyAttributes] The key management attributes. diff --git a/lib/services/keyvault/lib/models/keyProperties.js b/lib/services/keyvault/lib/models/keyProperties.js index 4a3d831573..734dfa7b0b 100644 --- a/lib/services/keyvault/lib/models/keyProperties.js +++ b/lib/services/keyvault/lib/models/keyProperties.js @@ -19,11 +19,16 @@ class KeyProperties { * Create a KeyProperties. * @member {boolean} [exportable] Indicates if the private key can be * exported. - * @member {string} [keyType] The key type. + * @member {string} [keyType] The type of key pair to be used for the + * certificate. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', + * 'oct' * @member {number} [keySize] The key size in bits. For example: 2048, 3072, * or 4096 for RSA. * @member {boolean} [reuseKey] Indicates if the same key pair will be used * on certificate renewal. + * @member {string} [curve] Elliptic curve name. For valid values, see + * JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + * 'P-256K' */ constructor() { } @@ -69,6 +74,13 @@ class KeyProperties { type: { name: 'Boolean' } + }, + curve: { + required: false, + serializedName: 'crv', + type: { + name: 'String' + } } } } diff --git a/lib/services/keyvault/lib/models/keySignParameters.js b/lib/services/keyvault/lib/models/keySignParameters.js index 2adf801f80..d2255b7aa3 100644 --- a/lib/services/keyvault/lib/models/keySignParameters.js +++ b/lib/services/keyvault/lib/models/keySignParameters.js @@ -21,7 +21,7 @@ class KeySignParameters { * For more information on possible algorithm types, see * JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', * 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', - * 'ECDSA256' + * 'ES256K' * @member {buffer} value */ constructor() { diff --git a/lib/services/keyvault/lib/models/keyUpdateParameters.js b/lib/services/keyvault/lib/models/keyUpdateParameters.js index ce30790fd1..6e2a9442b5 100644 --- a/lib/services/keyvault/lib/models/keyUpdateParameters.js +++ b/lib/services/keyvault/lib/models/keyUpdateParameters.js @@ -56,7 +56,7 @@ class KeyUpdateParameters { name: 'Sequence', element: { required: false, - serializedName: 'StringElementType', + serializedName: 'JsonWebKeyOperationElementType', type: { name: 'String' } diff --git a/lib/services/keyvault/lib/models/keyVerifyParameters.js b/lib/services/keyvault/lib/models/keyVerifyParameters.js index b6c6b935b6..ab1689822f 100644 --- a/lib/services/keyvault/lib/models/keyVerifyParameters.js +++ b/lib/services/keyvault/lib/models/keyVerifyParameters.js @@ -20,7 +20,7 @@ class KeyVerifyParameters { * @member {string} algorithm The signing/verification algorithm. For more * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. * Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', - * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256' + * 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ES256K' * @member {buffer} digest The digest used for signing. * @member {buffer} signature The signature to be verified. */ diff --git a/lib/services/keyvault/lib/models/sasDefinitionAttributes.js b/lib/services/keyvault/lib/models/sasDefinitionAttributes.js index fcb4f8d005..d51b8c33d9 100644 --- a/lib/services/keyvault/lib/models/sasDefinitionAttributes.js +++ b/lib/services/keyvault/lib/models/sasDefinitionAttributes.js @@ -20,6 +20,13 @@ class SasDefinitionAttributes { * @member {boolean} [enabled] the enabled state of the object. * @member {date} [created] Creation time in UTC. * @member {date} [updated] Last updated time in UTC. + * @member {string} [recoveryLevel] Reflects the deletion recovery level + * currently in effect for SAS definitions in the current vault. If it + * contains 'Purgeable' the SAS definition can be permanently deleted by a + * privileged user; otherwise, only the system can purge the SAS definition, + * at the end of the retention interval. Possible values include: + * 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' */ constructor() { } @@ -60,6 +67,15 @@ class SasDefinitionAttributes { type: { name: 'UnixTime' } + }, + recoveryLevel: { + required: false, + nullable: false, + readOnly: true, + serializedName: 'recoveryLevel', + type: { + name: 'String' + } } } } diff --git a/lib/services/keyvault/lib/models/sasDefinitionBundle.js b/lib/services/keyvault/lib/models/sasDefinitionBundle.js index 14e0e15585..d8525a923c 100644 --- a/lib/services/keyvault/lib/models/sasDefinitionBundle.js +++ b/lib/services/keyvault/lib/models/sasDefinitionBundle.js @@ -22,12 +22,24 @@ class SasDefinitionBundle { * Create a SasDefinitionBundle. * @member {string} [id] The SAS definition id. * @member {string} [secretId] Storage account SAS definition secret id. - * @member {object} [parameters] The SAS definition metadata in the form of - * key-value pairs. + * @member {string} [templateUri] The SAS definition token template signed + * with an arbitrary key. Tokens created according to the SAS definition + * will have the same properties as the template. + * @member {string} [sasType] The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * @member {string} [validityPeriod] The validity period of SAS tokens + * created according to the SAS definition. * @member {object} [attributes] The SAS definition attributes. * @member {boolean} [attributes.enabled] the enabled state of the object. * @member {date} [attributes.created] Creation time in UTC. * @member {date} [attributes.updated] Last updated time in UTC. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for SAS definitions in the current vault. If it + * contains 'Purgeable' the SAS definition can be permanently deleted by a + * privileged user; otherwise, only the system can purge the SAS definition, + * at the end of the retention interval. Possible values include: + * 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' * @member {object} [tags] Application specific metadata in the form of * key-value pairs */ @@ -64,19 +76,28 @@ class SasDefinitionBundle { name: 'String' } }, - parameters: { + templateUri: { required: false, readOnly: true, - serializedName: 'parameters', + serializedName: 'templateUri', type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } + name: 'String' + } + }, + sasType: { + required: false, + readOnly: true, + serializedName: 'sasType', + type: { + name: 'String' + } + }, + validityPeriod: { + required: false, + readOnly: true, + serializedName: 'validityPeriod', + type: { + name: 'String' } }, attributes: { diff --git a/lib/services/keyvault/lib/models/sasDefinitionCreateParameters.js b/lib/services/keyvault/lib/models/sasDefinitionCreateParameters.js index abc8530358..c0d1559aa1 100644 --- a/lib/services/keyvault/lib/models/sasDefinitionCreateParameters.js +++ b/lib/services/keyvault/lib/models/sasDefinitionCreateParameters.js @@ -19,14 +19,26 @@ const models = require('./index'); class SasDefinitionCreateParameters { /** * Create a SasDefinitionCreateParameters. - * @member {object} parameters Sas definition creation metadata in the form - * of key-value pairs. + * @member {string} templateUri The SAS definition token template signed with + * an arbitrary key. Tokens created according to the SAS definition will + * have the same properties as the template. + * @member {string} sasType The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * @member {string} validityPeriod The validity period of SAS tokens created + * according to the SAS definition. * @member {object} [sasDefinitionAttributes] The attributes of the SAS * definition. * @member {boolean} [sasDefinitionAttributes.enabled] the enabled state of * the object. * @member {date} [sasDefinitionAttributes.created] Creation time in UTC. * @member {date} [sasDefinitionAttributes.updated] Last updated time in UTC. + * @member {string} [sasDefinitionAttributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for SAS definitions in the + * current vault. If it contains 'Purgeable' the SAS definition can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the SAS definition, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' * @member {object} [tags] Application specific metadata in the form of * key-value pairs. */ @@ -47,18 +59,25 @@ class SasDefinitionCreateParameters { name: 'Composite', className: 'SasDefinitionCreateParameters', modelProperties: { - parameters: { + templateUri: { required: true, - serializedName: 'parameters', + serializedName: 'templateUri', type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } + name: 'String' + } + }, + sasType: { + required: true, + serializedName: 'sasType', + type: { + name: 'String' + } + }, + validityPeriod: { + required: true, + serializedName: 'validityPeriod', + type: { + name: 'String' } }, sasDefinitionAttributes: { diff --git a/lib/services/keyvault/lib/models/sasDefinitionItem.js b/lib/services/keyvault/lib/models/sasDefinitionItem.js index 1517e5f4ea..ec8b815e0b 100644 --- a/lib/services/keyvault/lib/models/sasDefinitionItem.js +++ b/lib/services/keyvault/lib/models/sasDefinitionItem.js @@ -25,6 +25,13 @@ class SasDefinitionItem { * @member {boolean} [attributes.enabled] the enabled state of the object. * @member {date} [attributes.created] Creation time in UTC. * @member {date} [attributes.updated] Last updated time in UTC. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for SAS definitions in the current vault. If it + * contains 'Purgeable' the SAS definition can be permanently deleted by a + * privileged user; otherwise, only the system can purge the SAS definition, + * at the end of the retention interval. Possible values include: + * 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' * @member {object} [tags] Application specific metadata in the form of * key-value pairs. */ diff --git a/lib/services/keyvault/lib/models/sasDefinitionUpdateParameters.js b/lib/services/keyvault/lib/models/sasDefinitionUpdateParameters.js index e3c2927b7f..7e60046889 100644 --- a/lib/services/keyvault/lib/models/sasDefinitionUpdateParameters.js +++ b/lib/services/keyvault/lib/models/sasDefinitionUpdateParameters.js @@ -19,14 +19,26 @@ const models = require('./index'); class SasDefinitionUpdateParameters { /** * Create a SasDefinitionUpdateParameters. - * @member {object} [parameters] Sas definition update metadata in the form - * of key-value pairs. + * @member {string} [templateUri] The SAS definition token template signed + * with an arbitrary key. Tokens created according to the SAS definition + * will have the same properties as the template. + * @member {string} [sasType] The type of SAS token the SAS definition will + * create. Possible values include: 'account', 'service' + * @member {string} [validityPeriod] The validity period of SAS tokens + * created according to the SAS definition. * @member {object} [sasDefinitionAttributes] The attributes of the SAS * definition. * @member {boolean} [sasDefinitionAttributes.enabled] the enabled state of * the object. * @member {date} [sasDefinitionAttributes.created] Creation time in UTC. * @member {date} [sasDefinitionAttributes.updated] Last updated time in UTC. + * @member {string} [sasDefinitionAttributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for SAS definitions in the + * current vault. If it contains 'Purgeable' the SAS definition can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the SAS definition, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' * @member {object} [tags] Application specific metadata in the form of * key-value pairs. */ @@ -47,18 +59,25 @@ class SasDefinitionUpdateParameters { name: 'Composite', className: 'SasDefinitionUpdateParameters', modelProperties: { - parameters: { + templateUri: { required: false, - serializedName: 'parameters', + serializedName: 'templateUri', type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } + name: 'String' + } + }, + sasType: { + required: false, + serializedName: 'sasType', + type: { + name: 'String' + } + }, + validityPeriod: { + required: false, + serializedName: 'validityPeriod', + type: { + name: 'String' } }, sasDefinitionAttributes: { diff --git a/lib/services/keyvault/lib/models/secretAttributes.js b/lib/services/keyvault/lib/models/secretAttributes.js index 1209de7ddd..8ebf803385 100644 --- a/lib/services/keyvault/lib/models/secretAttributes.js +++ b/lib/services/keyvault/lib/models/secretAttributes.js @@ -85,6 +85,7 @@ class SecretAttributes extends models['Attributes'] { }, recoveryLevel: { required: false, + nullable: false, readOnly: true, serializedName: 'recoveryLevel', type: { diff --git a/lib/services/keyvault/lib/models/storageAccountAttributes.js b/lib/services/keyvault/lib/models/storageAccountAttributes.js index b38f4d0095..f39e7ba4de 100644 --- a/lib/services/keyvault/lib/models/storageAccountAttributes.js +++ b/lib/services/keyvault/lib/models/storageAccountAttributes.js @@ -20,6 +20,13 @@ class StorageAccountAttributes { * @member {boolean} [enabled] the enabled state of the object. * @member {date} [created] Creation time in UTC. * @member {date} [updated] Last updated time in UTC. + * @member {string} [recoveryLevel] Reflects the deletion recovery level + * currently in effect for storage accounts in the current vault. If it + * contains 'Purgeable' the storage account can be permanently deleted by a + * privileged user; otherwise, only the system can purge the storage account, + * at the end of the retention interval. Possible values include: + * 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' */ constructor() { } @@ -60,6 +67,15 @@ class StorageAccountAttributes { type: { name: 'UnixTime' } + }, + recoveryLevel: { + required: false, + nullable: false, + readOnly: true, + serializedName: 'recoveryLevel', + type: { + name: 'String' + } } } } diff --git a/lib/services/keyvault/lib/models/storageAccountCreateParameters.js b/lib/services/keyvault/lib/models/storageAccountCreateParameters.js index c2f7b6014e..5372c593a7 100644 --- a/lib/services/keyvault/lib/models/storageAccountCreateParameters.js +++ b/lib/services/keyvault/lib/models/storageAccountCreateParameters.js @@ -32,6 +32,13 @@ class StorageAccountCreateParameters { * @member {date} [storageAccountAttributes.created] Creation time in UTC. * @member {date} [storageAccountAttributes.updated] Last updated time in * UTC. + * @member {string} [storageAccountAttributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for storage accounts in the + * current vault. If it contains 'Purgeable' the storage account can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the storage account, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' * @member {object} [tags] Application specific metadata in the form of * key-value pairs. */ diff --git a/lib/services/keyvault/lib/models/storageAccountItem.js b/lib/services/keyvault/lib/models/storageAccountItem.js index b9b032f902..e0a0cec7eb 100644 --- a/lib/services/keyvault/lib/models/storageAccountItem.js +++ b/lib/services/keyvault/lib/models/storageAccountItem.js @@ -25,6 +25,13 @@ class StorageAccountItem { * @member {boolean} [attributes.enabled] the enabled state of the object. * @member {date} [attributes.created] Creation time in UTC. * @member {date} [attributes.updated] Last updated time in UTC. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for storage accounts in the current vault. If it + * contains 'Purgeable' the storage account can be permanently deleted by a + * privileged user; otherwise, only the system can purge the storage account, + * at the end of the retention interval. Possible values include: + * 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' * @member {object} [tags] Application specific metadata in the form of * key-value pairs. */ diff --git a/lib/services/keyvault/lib/models/storageAccountUpdateParameters.js b/lib/services/keyvault/lib/models/storageAccountUpdateParameters.js index 5c086ad2ec..24c317ba8b 100644 --- a/lib/services/keyvault/lib/models/storageAccountUpdateParameters.js +++ b/lib/services/keyvault/lib/models/storageAccountUpdateParameters.js @@ -32,6 +32,13 @@ class StorageAccountUpdateParameters { * @member {date} [storageAccountAttributes.created] Creation time in UTC. * @member {date} [storageAccountAttributes.updated] Last updated time in * UTC. + * @member {string} [storageAccountAttributes.recoveryLevel] Reflects the + * deletion recovery level currently in effect for storage accounts in the + * current vault. If it contains 'Purgeable' the storage account can be + * permanently deleted by a privileged user; otherwise, only the system can + * purge the storage account, at the end of the retention interval. Possible + * values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' * @member {object} [tags] Application specific metadata in the form of * key-value pairs. */ diff --git a/lib/services/keyvault/lib/models/storageBundle.js b/lib/services/keyvault/lib/models/storageBundle.js index 8e2f898867..63a80715b5 100644 --- a/lib/services/keyvault/lib/models/storageBundle.js +++ b/lib/services/keyvault/lib/models/storageBundle.js @@ -32,6 +32,13 @@ class StorageBundle { * @member {boolean} [attributes.enabled] the enabled state of the object. * @member {date} [attributes.created] Creation time in UTC. * @member {date} [attributes.updated] Last updated time in UTC. + * @member {string} [attributes.recoveryLevel] Reflects the deletion recovery + * level currently in effect for storage accounts in the current vault. If it + * contains 'Purgeable' the storage account can be permanently deleted by a + * privileged user; otherwise, only the system can purge the storage account, + * at the end of the retention interval. Possible values include: + * 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + * 'Recoverable+ProtectedSubscription' * @member {object} [tags] Application specific metadata in the form of * key-value pairs */ diff --git a/lib/services/keyvault/lib/models/storageRestoreParameters.js b/lib/services/keyvault/lib/models/storageRestoreParameters.js new file mode 100644 index 0000000000..aaa159104a --- /dev/null +++ b/lib/services/keyvault/lib/models/storageRestoreParameters.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The secret restore parameters. + * + */ +class StorageRestoreParameters { + /** + * Create a StorageRestoreParameters. + * @member {buffer} storageBundleBackup The backup blob associated with a + * storage account. + */ + constructor() { + } + + /** + * Defines the metadata of StorageRestoreParameters + * + * @returns {object} metadata of StorageRestoreParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'StorageRestoreParameters', + type: { + name: 'Composite', + className: 'StorageRestoreParameters', + modelProperties: { + storageBundleBackup: { + required: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; + } +} + +module.exports = StorageRestoreParameters; diff --git a/lib/services/keyvault/lib/models/x509CertificateProperties.js b/lib/services/keyvault/lib/models/x509CertificateProperties.js index d2ef72c246..a1fbcddf4f 100644 --- a/lib/services/keyvault/lib/models/x509CertificateProperties.js +++ b/lib/services/keyvault/lib/models/x509CertificateProperties.js @@ -83,7 +83,7 @@ class X509CertificateProperties { name: 'Sequence', element: { required: false, - serializedName: 'StringElementType', + serializedName: 'KeyUsageTypeElementType', type: { name: 'String' } diff --git a/lib/services/keyvault/package.json b/lib/services/keyvault/package.json index cfb25fea47..fc10133941 100644 --- a/lib/services/keyvault/package.json +++ b/lib/services/keyvault/package.json @@ -2,7 +2,7 @@ "name": "azure-keyvault", "author": "Microsoft Corporation", "description": "KeyVaultClient Library with typescript type definitions for node", - "version": "3.0.4-preview", + "version": "3.0.4", "dependencies": { "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5" @@ -14,12 +14,12 @@ "license": "MIT", "main": "./lib/keyVaultClient.js", "types": "./lib/keyVaultClient.d.ts", - "homepage": "http://github.com/azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" + "url": "https://github.com/azure/azure-sdk-for-node/issues" } }