@azure/keyvault-certificates 4.9.1-alpha.20250221.1 → 4.10.0-alpha.20250226.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/dist/browser/certificatesModels.d.ts +10 -2
  2. package/dist/browser/certificatesModels.d.ts.map +1 -1
  3. package/dist/browser/certificatesModels.js +1 -1
  4. package/dist/browser/certificatesModels.js.map +1 -1
  5. package/dist/browser/constants.d.ts.map +1 -1
  6. package/dist/browser/constants.js +1 -1
  7. package/dist/browser/constants.js.map +1 -1
  8. package/dist/browser/generated/api/index.d.ts +2 -2
  9. package/dist/browser/generated/api/index.d.ts.map +1 -1
  10. package/dist/browser/generated/api/index.js +1 -1
  11. package/dist/browser/generated/api/index.js.map +1 -1
  12. package/dist/browser/generated/api/keyVaultContext.d.ts +4 -1
  13. package/dist/browser/generated/api/keyVaultContext.d.ts.map +1 -1
  14. package/dist/browser/generated/api/keyVaultContext.js +4 -4
  15. package/dist/browser/generated/api/keyVaultContext.js.map +1 -1
  16. package/dist/browser/generated/api/operations.d.ts +104 -104
  17. package/dist/browser/generated/api/operations.d.ts.map +1 -1
  18. package/dist/browser/generated/api/operations.js +358 -269
  19. package/dist/browser/generated/api/operations.js.map +1 -1
  20. package/dist/browser/generated/api/options.d.ts +36 -36
  21. package/dist/browser/generated/api/options.d.ts.map +1 -1
  22. package/dist/browser/generated/api/options.js.map +1 -1
  23. package/dist/browser/generated/index.d.ts +2 -2
  24. package/dist/browser/generated/index.d.ts.map +1 -1
  25. package/dist/browser/generated/index.js.map +1 -1
  26. package/dist/browser/generated/keyVaultClient.d.ts +54 -54
  27. package/dist/browser/generated/keyVaultClient.d.ts.map +1 -1
  28. package/dist/browser/generated/keyVaultClient.js +81 -81
  29. package/dist/browser/generated/keyVaultClient.js.map +1 -1
  30. package/dist/browser/generated/models/index.d.ts +1 -1
  31. package/dist/browser/generated/models/index.d.ts.map +1 -1
  32. package/dist/browser/generated/models/index.js.map +1 -1
  33. package/dist/browser/generated/models/models.d.ts +35 -7
  34. package/dist/browser/generated/models/models.d.ts.map +1 -1
  35. package/dist/browser/generated/models/models.js +19 -5
  36. package/dist/browser/generated/models/models.js.map +1 -1
  37. package/dist/browser/index.d.ts.map +1 -1
  38. package/dist/browser/index.js +1 -1
  39. package/dist/browser/index.js.map +1 -1
  40. package/dist/browser/lro/create/operation.d.ts.map +1 -1
  41. package/dist/browser/lro/create/operation.js +1 -0
  42. package/dist/browser/lro/create/operation.js.map +1 -1
  43. package/dist/browser/transformations.d.ts +1 -1
  44. package/dist/browser/transformations.d.ts.map +1 -1
  45. package/dist/browser/transformations.js +3 -0
  46. package/dist/browser/transformations.js.map +1 -1
  47. package/dist/commonjs/certificatesModels.d.ts +10 -2
  48. package/dist/commonjs/certificatesModels.d.ts.map +1 -1
  49. package/dist/commonjs/certificatesModels.js +1 -1
  50. package/dist/commonjs/certificatesModels.js.map +1 -1
  51. package/dist/commonjs/constants.d.ts.map +1 -1
  52. package/dist/commonjs/constants.js +1 -1
  53. package/dist/commonjs/constants.js.map +1 -1
  54. package/dist/commonjs/generated/api/index.d.ts +2 -2
  55. package/dist/commonjs/generated/api/index.d.ts.map +1 -1
  56. package/dist/commonjs/generated/api/index.js +27 -27
  57. package/dist/commonjs/generated/api/index.js.map +1 -1
  58. package/dist/commonjs/generated/api/keyVaultContext.d.ts +4 -1
  59. package/dist/commonjs/generated/api/keyVaultContext.d.ts.map +1 -1
  60. package/dist/commonjs/generated/api/keyVaultContext.js +4 -4
  61. package/dist/commonjs/generated/api/keyVaultContext.js.map +1 -1
  62. package/dist/commonjs/generated/api/operations.d.ts +104 -104
  63. package/dist/commonjs/generated/api/operations.d.ts.map +1 -1
  64. package/dist/commonjs/generated/api/operations.js +435 -346
  65. package/dist/commonjs/generated/api/operations.js.map +1 -1
  66. package/dist/commonjs/generated/api/options.d.ts +36 -36
  67. package/dist/commonjs/generated/api/options.d.ts.map +1 -1
  68. package/dist/commonjs/generated/api/options.js.map +1 -1
  69. package/dist/commonjs/generated/index.d.ts +2 -2
  70. package/dist/commonjs/generated/index.d.ts.map +1 -1
  71. package/dist/commonjs/generated/index.js.map +1 -1
  72. package/dist/commonjs/generated/keyVaultClient.d.ts +54 -54
  73. package/dist/commonjs/generated/keyVaultClient.d.ts.map +1 -1
  74. package/dist/commonjs/generated/keyVaultClient.js +80 -80
  75. package/dist/commonjs/generated/keyVaultClient.js.map +1 -1
  76. package/dist/commonjs/generated/models/index.d.ts +1 -1
  77. package/dist/commonjs/generated/models/index.d.ts.map +1 -1
  78. package/dist/commonjs/generated/models/index.js.map +1 -1
  79. package/dist/commonjs/generated/models/models.d.ts +35 -7
  80. package/dist/commonjs/generated/models/models.d.ts.map +1 -1
  81. package/dist/commonjs/generated/models/models.js +21 -6
  82. package/dist/commonjs/generated/models/models.js.map +1 -1
  83. package/dist/commonjs/index.d.ts.map +1 -1
  84. package/dist/commonjs/index.js +1 -1
  85. package/dist/commonjs/index.js.map +1 -1
  86. package/dist/commonjs/lro/create/operation.d.ts.map +1 -1
  87. package/dist/commonjs/lro/create/operation.js +1 -0
  88. package/dist/commonjs/lro/create/operation.js.map +1 -1
  89. package/dist/commonjs/transformations.d.ts +1 -1
  90. package/dist/commonjs/transformations.d.ts.map +1 -1
  91. package/dist/commonjs/transformations.js +3 -0
  92. package/dist/commonjs/transformations.js.map +1 -1
  93. package/dist/commonjs/tsdoc-metadata.json +1 -1
  94. package/dist/esm/certificatesModels.d.ts +10 -2
  95. package/dist/esm/certificatesModels.d.ts.map +1 -1
  96. package/dist/esm/certificatesModels.js +1 -1
  97. package/dist/esm/certificatesModels.js.map +1 -1
  98. package/dist/esm/constants.d.ts.map +1 -1
  99. package/dist/esm/constants.js +1 -1
  100. package/dist/esm/constants.js.map +1 -1
  101. package/dist/esm/generated/api/index.d.ts +2 -2
  102. package/dist/esm/generated/api/index.d.ts.map +1 -1
  103. package/dist/esm/generated/api/index.js +1 -1
  104. package/dist/esm/generated/api/index.js.map +1 -1
  105. package/dist/esm/generated/api/keyVaultContext.d.ts +4 -1
  106. package/dist/esm/generated/api/keyVaultContext.d.ts.map +1 -1
  107. package/dist/esm/generated/api/keyVaultContext.js +4 -4
  108. package/dist/esm/generated/api/keyVaultContext.js.map +1 -1
  109. package/dist/esm/generated/api/operations.d.ts +104 -104
  110. package/dist/esm/generated/api/operations.d.ts.map +1 -1
  111. package/dist/esm/generated/api/operations.js +358 -269
  112. package/dist/esm/generated/api/operations.js.map +1 -1
  113. package/dist/esm/generated/api/options.d.ts +36 -36
  114. package/dist/esm/generated/api/options.d.ts.map +1 -1
  115. package/dist/esm/generated/api/options.js.map +1 -1
  116. package/dist/esm/generated/index.d.ts +2 -2
  117. package/dist/esm/generated/index.d.ts.map +1 -1
  118. package/dist/esm/generated/index.js.map +1 -1
  119. package/dist/esm/generated/keyVaultClient.d.ts +54 -54
  120. package/dist/esm/generated/keyVaultClient.d.ts.map +1 -1
  121. package/dist/esm/generated/keyVaultClient.js +81 -81
  122. package/dist/esm/generated/keyVaultClient.js.map +1 -1
  123. package/dist/esm/generated/models/index.d.ts +1 -1
  124. package/dist/esm/generated/models/index.d.ts.map +1 -1
  125. package/dist/esm/generated/models/index.js.map +1 -1
  126. package/dist/esm/generated/models/models.d.ts +35 -7
  127. package/dist/esm/generated/models/models.d.ts.map +1 -1
  128. package/dist/esm/generated/models/models.js +19 -5
  129. package/dist/esm/generated/models/models.js.map +1 -1
  130. package/dist/esm/index.d.ts.map +1 -1
  131. package/dist/esm/index.js +1 -1
  132. package/dist/esm/index.js.map +1 -1
  133. package/dist/esm/lro/create/operation.d.ts.map +1 -1
  134. package/dist/esm/lro/create/operation.js +1 -0
  135. package/dist/esm/lro/create/operation.js.map +1 -1
  136. package/dist/esm/transformations.d.ts +1 -1
  137. package/dist/esm/transformations.d.ts.map +1 -1
  138. package/dist/esm/transformations.js +3 -0
  139. package/dist/esm/transformations.js.map +1 -1
  140. package/dist/react-native/certificatesModels.d.ts +10 -2
  141. package/dist/react-native/certificatesModels.d.ts.map +1 -1
  142. package/dist/react-native/certificatesModels.js +1 -1
  143. package/dist/react-native/certificatesModels.js.map +1 -1
  144. package/dist/react-native/constants.d.ts.map +1 -1
  145. package/dist/react-native/constants.js +1 -1
  146. package/dist/react-native/constants.js.map +1 -1
  147. package/dist/react-native/generated/api/index.d.ts +2 -2
  148. package/dist/react-native/generated/api/index.d.ts.map +1 -1
  149. package/dist/react-native/generated/api/index.js +1 -1
  150. package/dist/react-native/generated/api/index.js.map +1 -1
  151. package/dist/react-native/generated/api/keyVaultContext.d.ts +4 -1
  152. package/dist/react-native/generated/api/keyVaultContext.d.ts.map +1 -1
  153. package/dist/react-native/generated/api/keyVaultContext.js +4 -4
  154. package/dist/react-native/generated/api/keyVaultContext.js.map +1 -1
  155. package/dist/react-native/generated/api/operations.d.ts +104 -104
  156. package/dist/react-native/generated/api/operations.d.ts.map +1 -1
  157. package/dist/react-native/generated/api/operations.js +358 -269
  158. package/dist/react-native/generated/api/operations.js.map +1 -1
  159. package/dist/react-native/generated/api/options.d.ts +36 -36
  160. package/dist/react-native/generated/api/options.d.ts.map +1 -1
  161. package/dist/react-native/generated/api/options.js.map +1 -1
  162. package/dist/react-native/generated/index.d.ts +2 -2
  163. package/dist/react-native/generated/index.d.ts.map +1 -1
  164. package/dist/react-native/generated/index.js.map +1 -1
  165. package/dist/react-native/generated/keyVaultClient.d.ts +54 -54
  166. package/dist/react-native/generated/keyVaultClient.d.ts.map +1 -1
  167. package/dist/react-native/generated/keyVaultClient.js +81 -81
  168. package/dist/react-native/generated/keyVaultClient.js.map +1 -1
  169. package/dist/react-native/generated/models/index.d.ts +1 -1
  170. package/dist/react-native/generated/models/index.d.ts.map +1 -1
  171. package/dist/react-native/generated/models/index.js.map +1 -1
  172. package/dist/react-native/generated/models/models.d.ts +35 -7
  173. package/dist/react-native/generated/models/models.d.ts.map +1 -1
  174. package/dist/react-native/generated/models/models.js +19 -5
  175. package/dist/react-native/generated/models/models.js.map +1 -1
  176. package/dist/react-native/index.d.ts.map +1 -1
  177. package/dist/react-native/index.js +1 -1
  178. package/dist/react-native/index.js.map +1 -1
  179. package/dist/react-native/lro/create/operation.d.ts.map +1 -1
  180. package/dist/react-native/lro/create/operation.js +1 -0
  181. package/dist/react-native/lro/create/operation.js.map +1 -1
  182. package/dist/react-native/transformations.d.ts +1 -1
  183. package/dist/react-native/transformations.d.ts.map +1 -1
  184. package/dist/react-native/transformations.js +3 -0
  185. package/dist/react-native/transformations.js.map +1 -1
  186. package/package.json +1 -1
  187. package/dist/browser/generated/helpers/serializerHelpers.d.ts +0 -3
  188. package/dist/browser/generated/helpers/serializerHelpers.d.ts.map +0 -1
  189. package/dist/browser/generated/helpers/serializerHelpers.js +0 -25
  190. package/dist/browser/generated/helpers/serializerHelpers.js.map +0 -1
  191. package/dist/commonjs/generated/helpers/serializerHelpers.d.ts +0 -3
  192. package/dist/commonjs/generated/helpers/serializerHelpers.d.ts.map +0 -1
  193. package/dist/commonjs/generated/helpers/serializerHelpers.js +0 -28
  194. package/dist/commonjs/generated/helpers/serializerHelpers.js.map +0 -1
  195. package/dist/esm/generated/helpers/serializerHelpers.d.ts +0 -3
  196. package/dist/esm/generated/helpers/serializerHelpers.d.ts.map +0 -1
  197. package/dist/esm/generated/helpers/serializerHelpers.js +0 -25
  198. package/dist/esm/generated/helpers/serializerHelpers.js.map +0 -1
  199. package/dist/react-native/generated/helpers/serializerHelpers.d.ts +0 -3
  200. package/dist/react-native/generated/helpers/serializerHelpers.d.ts.map +0 -1
  201. package/dist/react-native/generated/helpers/serializerHelpers.js +0 -25
  202. package/dist/react-native/generated/helpers/serializerHelpers.js.map +0 -1
@@ -1,238 +1,283 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { _certificateListResultDeserializer, deletedCertificateBundleDeserializer, certificatePolicySerializer, certificatePolicyDeserializer, contactsSerializer, contactsDeserializer, _certificateIssuerListResultDeserializer, certificateIssuerSetParametersSerializer, issuerBundleDeserializer, certificateIssuerUpdateParametersSerializer, certificateCreateParametersSerializer, certificateOperationDeserializer, certificateImportParametersSerializer, certificateBundleDeserializer, certificateUpdateParametersSerializer, certificateOperationUpdateParameterSerializer, certificateMergeParametersSerializer, backupCertificateResultDeserializer, certificateRestoreParametersSerializer, _deletedCertificateListResultDeserializer, } from "../models/models.js";
3
+ import { _certificateListResultDeserializer, keyVaultErrorDeserializer, deletedCertificateBundleDeserializer, certificatePolicySerializer, certificatePolicyDeserializer, contactsSerializer, contactsDeserializer, _certificateIssuerListResultDeserializer, certificateIssuerSetParametersSerializer, issuerBundleDeserializer, certificateIssuerUpdateParametersSerializer, certificateCreateParametersSerializer, certificateOperationDeserializer, certificateImportParametersSerializer, certificateBundleDeserializer, certificateUpdateParametersSerializer, certificateOperationUpdateParameterSerializer, certificateMergeParametersSerializer, backupCertificateResultDeserializer, certificateRestoreParametersSerializer, _deletedCertificateListResultDeserializer, } from "../models/models.js";
4
4
  import { buildPagedAsyncIterator, } from "../static-helpers/pagingHelpers.js";
5
5
  import { createRestError, operationOptionsToRequestParameters, } from "@azure-rest/core-client";
6
- export function _getCertificatesSend(context, options = { requestOptions: {} }) {
6
+ export function _recoverDeletedCertificateSend(context, certificateName, options = { requestOptions: {} }) {
7
+ var _a;
7
8
  return context
8
- .path("/certificates")
9
- .get(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { queryParameters: {
10
- maxresults: options === null || options === void 0 ? void 0 : options.maxresults,
11
- includePending: options === null || options === void 0 ? void 0 : options.includePending,
12
- } }));
9
+ .path("/deletedcertificates/{certificate-name}/recover", certificateName)
10
+ .post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion } }));
13
11
  }
14
- export async function _getCertificatesDeserialize(result) {
12
+ export async function _recoverDeletedCertificateDeserialize(result) {
15
13
  const expectedStatuses = ["200"];
16
14
  if (!expectedStatuses.includes(result.status)) {
17
- throw createRestError(result);
15
+ const error = createRestError(result);
16
+ error.details = keyVaultErrorDeserializer(result.body);
17
+ throw error;
18
18
  }
19
- return _certificateListResultDeserializer(result.body);
19
+ return certificateBundleDeserializer(result.body);
20
20
  }
21
- /** The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. */
22
- export function getCertificates(context, options = { requestOptions: {} }) {
23
- return buildPagedAsyncIterator(context, () => _getCertificatesSend(context, options), _getCertificatesDeserialize, ["200"], { itemName: "value", nextLinkName: "nextLink" });
21
+ /** 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. */
22
+ export async function recoverDeletedCertificate(context, certificateName, options = { requestOptions: {} }) {
23
+ const result = await _recoverDeletedCertificateSend(context, certificateName, options);
24
+ return _recoverDeletedCertificateDeserialize(result);
24
25
  }
25
- export function _deleteCertificateSend(context, certificateName, options = { requestOptions: {} }) {
26
+ export function _purgeDeletedCertificateSend(context, certificateName, options = { requestOptions: {} }) {
27
+ var _a;
26
28
  return context
27
- .path("/certificates/{certificate-name}", certificateName)
28
- .delete(Object.assign({}, operationOptionsToRequestParameters(options)));
29
+ .path("/deletedcertificates/{certificate-name}", certificateName)
30
+ .delete(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion } }));
29
31
  }
30
- export async function _deleteCertificateDeserialize(result) {
31
- const expectedStatuses = ["200"];
32
+ export async function _purgeDeletedCertificateDeserialize(result) {
33
+ const expectedStatuses = ["204"];
32
34
  if (!expectedStatuses.includes(result.status)) {
33
- throw createRestError(result);
35
+ const error = createRestError(result);
36
+ error.details = keyVaultErrorDeserializer(result.body);
37
+ throw error;
34
38
  }
35
- return deletedCertificateBundleDeserializer(result.body);
39
+ return;
36
40
  }
37
- /** 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. */
38
- export async function deleteCertificate(context, certificateName, options = { requestOptions: {} }) {
39
- const result = await _deleteCertificateSend(context, certificateName, options);
40
- return _deleteCertificateDeserialize(result);
41
+ /** 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. */
42
+ export async function purgeDeletedCertificate(context, certificateName, options = { requestOptions: {} }) {
43
+ const result = await _purgeDeletedCertificateSend(context, certificateName, options);
44
+ return _purgeDeletedCertificateDeserialize(result);
41
45
  }
42
- export function _setCertificateContactsSend(context, contacts, options = { requestOptions: {} }) {
46
+ export function _getDeletedCertificateSend(context, certificateName, options = { requestOptions: {} }) {
47
+ var _a;
43
48
  return context
44
- .path("/certificates/contacts")
45
- .put(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: contactsSerializer(contacts) }));
49
+ .path("/deletedcertificates/{certificate-name}", certificateName)
50
+ .get(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion } }));
46
51
  }
47
- export async function _setCertificateContactsDeserialize(result) {
52
+ export async function _getDeletedCertificateDeserialize(result) {
48
53
  const expectedStatuses = ["200"];
49
54
  if (!expectedStatuses.includes(result.status)) {
50
- throw createRestError(result);
55
+ const error = createRestError(result);
56
+ error.details = keyVaultErrorDeserializer(result.body);
57
+ throw error;
51
58
  }
52
- return contactsDeserializer(result.body);
59
+ return deletedCertificateBundleDeserializer(result.body);
53
60
  }
54
- /** Sets the certificate contacts for the specified key vault. This operation requires the certificates/managecontacts permission. */
55
- export async function setCertificateContacts(context, contacts, options = { requestOptions: {} }) {
56
- const result = await _setCertificateContactsSend(context, contacts, options);
57
- return _setCertificateContactsDeserialize(result);
61
+ /** 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. */
62
+ export async function getDeletedCertificate(context, certificateName, options = { requestOptions: {} }) {
63
+ const result = await _getDeletedCertificateSend(context, certificateName, options);
64
+ return _getDeletedCertificateDeserialize(result);
58
65
  }
59
- export function _getCertificateContactsSend(context, options = { requestOptions: {} }) {
66
+ export function _getDeletedCertificatesSend(context, options = { requestOptions: {} }) {
67
+ var _a;
60
68
  return context
61
- .path("/certificates/contacts")
62
- .get(Object.assign({}, operationOptionsToRequestParameters(options)));
69
+ .path("/deletedcertificates")
70
+ .get(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: {
71
+ "api-version": context.apiVersion,
72
+ maxresults: options === null || options === void 0 ? void 0 : options.maxresults,
73
+ includePending: options === null || options === void 0 ? void 0 : options.includePending,
74
+ } }));
63
75
  }
64
- export async function _getCertificateContactsDeserialize(result) {
76
+ export async function _getDeletedCertificatesDeserialize(result) {
65
77
  const expectedStatuses = ["200"];
66
78
  if (!expectedStatuses.includes(result.status)) {
67
- throw createRestError(result);
79
+ const error = createRestError(result);
80
+ error.details = keyVaultErrorDeserializer(result.body);
81
+ throw error;
68
82
  }
69
- return contactsDeserializer(result.body);
83
+ return _deletedCertificateListResultDeserializer(result.body);
70
84
  }
71
- /** The GetCertificateContacts operation returns the set of certificate contact resources in the specified key vault. This operation requires the certificates/managecontacts permission. */
72
- export async function getCertificateContacts(context, options = { requestOptions: {} }) {
73
- const result = await _getCertificateContactsSend(context, options);
74
- return _getCertificateContactsDeserialize(result);
85
+ /** 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. */
86
+ export function getDeletedCertificates(context, options = { requestOptions: {} }) {
87
+ return buildPagedAsyncIterator(context, () => _getDeletedCertificatesSend(context, options), _getDeletedCertificatesDeserialize, ["200"], { itemName: "value", nextLinkName: "nextLink" });
75
88
  }
76
- export function _deleteCertificateContactsSend(context, options = { requestOptions: {} }) {
89
+ export function _restoreCertificateSend(context, parameters, options = { requestOptions: {} }) {
90
+ var _a;
77
91
  return context
78
- .path("/certificates/contacts")
79
- .delete(Object.assign({}, operationOptionsToRequestParameters(options)));
92
+ .path("/certificates/restore")
93
+ .post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { contentType: "application/json", headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion }, body: certificateRestoreParametersSerializer(parameters) }));
80
94
  }
81
- export async function _deleteCertificateContactsDeserialize(result) {
95
+ export async function _restoreCertificateDeserialize(result) {
82
96
  const expectedStatuses = ["200"];
83
97
  if (!expectedStatuses.includes(result.status)) {
84
- throw createRestError(result);
98
+ const error = createRestError(result);
99
+ error.details = keyVaultErrorDeserializer(result.body);
100
+ throw error;
85
101
  }
86
- return contactsDeserializer(result.body);
102
+ return certificateBundleDeserializer(result.body);
87
103
  }
88
- /** Deletes the certificate contacts for a specified key vault certificate. This operation requires the certificates/managecontacts permission. */
89
- export async function deleteCertificateContacts(context, options = { requestOptions: {} }) {
90
- const result = await _deleteCertificateContactsSend(context, options);
91
- return _deleteCertificateContactsDeserialize(result);
104
+ /** Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission. */
105
+ export async function restoreCertificate(context, parameters, options = { requestOptions: {} }) {
106
+ const result = await _restoreCertificateSend(context, parameters, options);
107
+ return _restoreCertificateDeserialize(result);
92
108
  }
93
- export function _getCertificateIssuersSend(context, options = { requestOptions: {} }) {
109
+ export function _backupCertificateSend(context, certificateName, options = { requestOptions: {} }) {
110
+ var _a;
94
111
  return context
95
- .path("/certificates/issuers")
96
- .get(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { queryParameters: { maxresults: options === null || options === void 0 ? void 0 : options.maxresults } }));
112
+ .path("/certificates/{certificate-name}/backup", certificateName)
113
+ .post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion } }));
97
114
  }
98
- export async function _getCertificateIssuersDeserialize(result) {
115
+ export async function _backupCertificateDeserialize(result) {
99
116
  const expectedStatuses = ["200"];
100
117
  if (!expectedStatuses.includes(result.status)) {
101
- throw createRestError(result);
118
+ const error = createRestError(result);
119
+ error.details = keyVaultErrorDeserializer(result.body);
120
+ throw error;
102
121
  }
103
- return _certificateIssuerListResultDeserializer(result.body);
122
+ return backupCertificateResultDeserializer(result.body);
104
123
  }
105
- /** The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. */
106
- export function getCertificateIssuers(context, options = { requestOptions: {} }) {
107
- return buildPagedAsyncIterator(context, () => _getCertificateIssuersSend(context, options), _getCertificateIssuersDeserialize, ["200"], { itemName: "value", nextLinkName: "nextLink" });
124
+ /** 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. */
125
+ export async function backupCertificate(context, certificateName, options = { requestOptions: {} }) {
126
+ const result = await _backupCertificateSend(context, certificateName, options);
127
+ return _backupCertificateDeserialize(result);
108
128
  }
109
- export function _setCertificateIssuerSend(context, issuerName, parameter, options = { requestOptions: {} }) {
129
+ export function _mergeCertificateSend(context, certificateName, parameters, options = { requestOptions: {} }) {
130
+ var _a;
110
131
  return context
111
- .path("/certificates/issuers/{issuer-name}", issuerName)
112
- .put(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: certificateIssuerSetParametersSerializer(parameter) }));
132
+ .path("/certificates/{certificate-name}/pending/merge", certificateName)
133
+ .post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { contentType: "application/json", headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion }, body: certificateMergeParametersSerializer(parameters) }));
113
134
  }
114
- export async function _setCertificateIssuerDeserialize(result) {
115
- const expectedStatuses = ["200"];
135
+ export async function _mergeCertificateDeserialize(result) {
136
+ const expectedStatuses = ["201"];
116
137
  if (!expectedStatuses.includes(result.status)) {
117
- throw createRestError(result);
138
+ const error = createRestError(result);
139
+ error.details = keyVaultErrorDeserializer(result.body);
140
+ throw error;
118
141
  }
119
- return issuerBundleDeserializer(result.body);
142
+ return certificateBundleDeserializer(result.body);
120
143
  }
121
- /** The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission. */
122
- export async function setCertificateIssuer(context, issuerName, parameter, options = { requestOptions: {} }) {
123
- const result = await _setCertificateIssuerSend(context, issuerName, parameter, options);
124
- return _setCertificateIssuerDeserialize(result);
144
+ /** 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. */
145
+ export async function mergeCertificate(context, certificateName, parameters, options = { requestOptions: {} }) {
146
+ const result = await _mergeCertificateSend(context, certificateName, parameters, options);
147
+ return _mergeCertificateDeserialize(result);
125
148
  }
126
- export function _updateCertificateIssuerSend(context, issuerName, parameter, options = { requestOptions: {} }) {
149
+ export function _deleteCertificateOperationSend(context, certificateName, options = { requestOptions: {} }) {
150
+ var _a;
127
151
  return context
128
- .path("/certificates/issuers/{issuer-name}", issuerName)
129
- .patch(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: certificateIssuerUpdateParametersSerializer(parameter) }));
152
+ .path("/certificates/{certificate-name}/pending", certificateName)
153
+ .delete(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion } }));
130
154
  }
131
- export async function _updateCertificateIssuerDeserialize(result) {
155
+ export async function _deleteCertificateOperationDeserialize(result) {
132
156
  const expectedStatuses = ["200"];
133
157
  if (!expectedStatuses.includes(result.status)) {
134
- throw createRestError(result);
158
+ const error = createRestError(result);
159
+ error.details = keyVaultErrorDeserializer(result.body);
160
+ throw error;
135
161
  }
136
- return issuerBundleDeserializer(result.body);
162
+ return certificateOperationDeserializer(result.body);
137
163
  }
138
- /** The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. */
139
- export async function updateCertificateIssuer(context, issuerName, parameter, options = { requestOptions: {} }) {
140
- const result = await _updateCertificateIssuerSend(context, issuerName, parameter, options);
141
- return _updateCertificateIssuerDeserialize(result);
164
+ /** 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. */
165
+ export async function deleteCertificateOperation(context, certificateName, options = { requestOptions: {} }) {
166
+ const result = await _deleteCertificateOperationSend(context, certificateName, options);
167
+ return _deleteCertificateOperationDeserialize(result);
142
168
  }
143
- export function _getCertificateIssuerSend(context, issuerName, options = { requestOptions: {} }) {
169
+ export function _getCertificateOperationSend(context, certificateName, options = { requestOptions: {} }) {
170
+ var _a;
144
171
  return context
145
- .path("/certificates/issuers/{issuer-name}", issuerName)
146
- .get(Object.assign({}, operationOptionsToRequestParameters(options)));
172
+ .path("/certificates/{certificate-name}/pending", certificateName)
173
+ .get(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion } }));
147
174
  }
148
- export async function _getCertificateIssuerDeserialize(result) {
175
+ export async function _getCertificateOperationDeserialize(result) {
149
176
  const expectedStatuses = ["200"];
150
177
  if (!expectedStatuses.includes(result.status)) {
151
- throw createRestError(result);
178
+ const error = createRestError(result);
179
+ error.details = keyVaultErrorDeserializer(result.body);
180
+ throw error;
152
181
  }
153
- return issuerBundleDeserializer(result.body);
182
+ return certificateOperationDeserializer(result.body);
154
183
  }
155
- /** The GetCertificateIssuer operation returns the specified certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. */
156
- export async function getCertificateIssuer(context, issuerName, options = { requestOptions: {} }) {
157
- const result = await _getCertificateIssuerSend(context, issuerName, options);
158
- return _getCertificateIssuerDeserialize(result);
184
+ /** Gets the creation operation associated with a specified certificate. This operation requires the certificates/get permission. */
185
+ export async function getCertificateOperation(context, certificateName, options = { requestOptions: {} }) {
186
+ const result = await _getCertificateOperationSend(context, certificateName, options);
187
+ return _getCertificateOperationDeserialize(result);
159
188
  }
160
- export function _deleteCertificateIssuerSend(context, issuerName, options = { requestOptions: {} }) {
189
+ export function _updateCertificateOperationSend(context, certificateName, certificateOperation, options = { requestOptions: {} }) {
190
+ var _a;
161
191
  return context
162
- .path("/certificates/issuers/{issuer-name}", issuerName)
163
- .delete(Object.assign({}, operationOptionsToRequestParameters(options)));
192
+ .path("/certificates/{certificate-name}/pending", certificateName)
193
+ .patch(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { contentType: "application/json", headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion }, body: certificateOperationUpdateParameterSerializer(certificateOperation) }));
164
194
  }
165
- export async function _deleteCertificateIssuerDeserialize(result) {
195
+ export async function _updateCertificateOperationDeserialize(result) {
166
196
  const expectedStatuses = ["200"];
167
197
  if (!expectedStatuses.includes(result.status)) {
168
- throw createRestError(result);
198
+ const error = createRestError(result);
199
+ error.details = keyVaultErrorDeserializer(result.body);
200
+ throw error;
169
201
  }
170
- return issuerBundleDeserializer(result.body);
202
+ return certificateOperationDeserializer(result.body);
171
203
  }
172
- /** The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/deleteissuers permission. */
173
- export async function deleteCertificateIssuer(context, issuerName, options = { requestOptions: {} }) {
174
- const result = await _deleteCertificateIssuerSend(context, issuerName, options);
175
- return _deleteCertificateIssuerDeserialize(result);
204
+ /** Updates a certificate creation operation that is already in progress. This operation requires the certificates/update permission. */
205
+ export async function updateCertificateOperation(context, certificateName, certificateOperation, options = { requestOptions: {} }) {
206
+ const result = await _updateCertificateOperationSend(context, certificateName, certificateOperation, options);
207
+ return _updateCertificateOperationDeserialize(result);
176
208
  }
177
- export function _createCertificateSend(context, certificateName, parameters, options = { requestOptions: {} }) {
209
+ export function _getCertificateSend(context, certificateName, certificateVersion, options = { requestOptions: {} }) {
210
+ var _a;
178
211
  return context
179
- .path("/certificates/{certificate-name}/create", certificateName)
180
- .post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: certificateCreateParametersSerializer(parameters) }));
212
+ .path("/certificates/{certificate-name}/{certificate-version}", certificateName, certificateVersion)
213
+ .get(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion } }));
181
214
  }
182
- export async function _createCertificateDeserialize(result) {
183
- const expectedStatuses = ["202"];
215
+ export async function _getCertificateDeserialize(result) {
216
+ const expectedStatuses = ["200"];
184
217
  if (!expectedStatuses.includes(result.status)) {
185
- throw createRestError(result);
218
+ const error = createRestError(result);
219
+ error.details = keyVaultErrorDeserializer(result.body);
220
+ throw error;
186
221
  }
187
- return certificateOperationDeserializer(result.body);
222
+ return certificateBundleDeserializer(result.body);
188
223
  }
189
- /** If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. */
190
- export async function createCertificate(context, certificateName, parameters, options = { requestOptions: {} }) {
191
- const result = await _createCertificateSend(context, certificateName, parameters, options);
192
- return _createCertificateDeserialize(result);
224
+ /** Gets information about a specific certificate. This operation requires the certificates/get permission. */
225
+ export async function getCertificate(context, certificateName, certificateVersion, options = { requestOptions: {} }) {
226
+ const result = await _getCertificateSend(context, certificateName, certificateVersion, options);
227
+ return _getCertificateDeserialize(result);
193
228
  }
194
- export function _importCertificateSend(context, certificateName, parameters, options = { requestOptions: {} }) {
229
+ export function _updateCertificateSend(context, certificateName, certificateVersion, parameters, options = { requestOptions: {} }) {
230
+ var _a;
195
231
  return context
196
- .path("/certificates/{certificate-name}/import", certificateName)
197
- .post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: certificateImportParametersSerializer(parameters) }));
232
+ .path("/certificates/{certificate-name}/{certificate-version}", certificateName, certificateVersion)
233
+ .patch(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { contentType: "application/json", headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion }, body: certificateUpdateParametersSerializer(parameters) }));
198
234
  }
199
- export async function _importCertificateDeserialize(result) {
235
+ export async function _updateCertificateDeserialize(result) {
200
236
  const expectedStatuses = ["200"];
201
237
  if (!expectedStatuses.includes(result.status)) {
202
- throw createRestError(result);
238
+ const error = createRestError(result);
239
+ error.details = keyVaultErrorDeserializer(result.body);
240
+ throw error;
203
241
  }
204
242
  return certificateBundleDeserializer(result.body);
205
243
  }
206
- /** Imports an existing valid certificate, containing a private key, into Azure Key Vault. This operation requires the certificates/import permission. 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. Key Vault will only accept a key in PKCS#8 format. */
207
- export async function importCertificate(context, certificateName, parameters, options = { requestOptions: {} }) {
208
- const result = await _importCertificateSend(context, certificateName, parameters, options);
209
- return _importCertificateDeserialize(result);
244
+ /** 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. */
245
+ export async function updateCertificate(context, certificateName, certificateVersion, parameters, options = { requestOptions: {} }) {
246
+ const result = await _updateCertificateSend(context, certificateName, certificateVersion, parameters, options);
247
+ return _updateCertificateDeserialize(result);
210
248
  }
211
- export function _getCertificateVersionsSend(context, certificateName, options = { requestOptions: {} }) {
249
+ export function _updateCertificatePolicySend(context, certificateName, certificatePolicy, options = { requestOptions: {} }) {
250
+ var _a;
212
251
  return context
213
- .path("/certificates/{certificate-name}/versions", certificateName)
214
- .get(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { queryParameters: { maxresults: options === null || options === void 0 ? void 0 : options.maxresults } }));
252
+ .path("/certificates/{certificate-name}/policy", certificateName)
253
+ .patch(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { contentType: "application/json", headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion }, body: certificatePolicySerializer(certificatePolicy) }));
215
254
  }
216
- export async function _getCertificateVersionsDeserialize(result) {
255
+ export async function _updateCertificatePolicyDeserialize(result) {
217
256
  const expectedStatuses = ["200"];
218
257
  if (!expectedStatuses.includes(result.status)) {
219
- throw createRestError(result);
258
+ const error = createRestError(result);
259
+ error.details = keyVaultErrorDeserializer(result.body);
260
+ throw error;
220
261
  }
221
- return _certificateListResultDeserializer(result.body);
262
+ return certificatePolicyDeserializer(result.body);
222
263
  }
223
- /** The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. */
224
- export function getCertificateVersions(context, certificateName, options = { requestOptions: {} }) {
225
- return buildPagedAsyncIterator(context, () => _getCertificateVersionsSend(context, certificateName, options), _getCertificateVersionsDeserialize, ["200"], { itemName: "value", nextLinkName: "nextLink" });
264
+ /** Set specified members in the certificate policy. Leave others as null. This operation requires the certificates/update permission. */
265
+ export async function updateCertificatePolicy(context, certificateName, certificatePolicy, options = { requestOptions: {} }) {
266
+ const result = await _updateCertificatePolicySend(context, certificateName, certificatePolicy, options);
267
+ return _updateCertificatePolicyDeserialize(result);
226
268
  }
227
269
  export function _getCertificatePolicySend(context, certificateName, options = { requestOptions: {} }) {
270
+ var _a;
228
271
  return context
229
272
  .path("/certificates/{certificate-name}/policy", certificateName)
230
- .get(Object.assign({}, operationOptionsToRequestParameters(options)));
273
+ .get(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion } }));
231
274
  }
232
275
  export async function _getCertificatePolicyDeserialize(result) {
233
276
  const expectedStatuses = ["200"];
234
277
  if (!expectedStatuses.includes(result.status)) {
235
- throw createRestError(result);
278
+ const error = createRestError(result);
279
+ error.details = keyVaultErrorDeserializer(result.body);
280
+ throw error;
236
281
  }
237
282
  return certificatePolicyDeserializer(result.body);
238
283
  }
@@ -241,227 +286,271 @@ export async function getCertificatePolicy(context, certificateName, options = {
241
286
  const result = await _getCertificatePolicySend(context, certificateName, options);
242
287
  return _getCertificatePolicyDeserialize(result);
243
288
  }
244
- export function _updateCertificatePolicySend(context, certificateName, certificatePolicy, options = { requestOptions: {} }) {
289
+ export function _getCertificateVersionsSend(context, certificateName, options = { requestOptions: {} }) {
290
+ var _a;
245
291
  return context
246
- .path("/certificates/{certificate-name}/policy", certificateName)
247
- .patch(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: certificatePolicySerializer(certificatePolicy) }));
292
+ .path("/certificates/{certificate-name}/versions", certificateName)
293
+ .get(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: {
294
+ "api-version": context.apiVersion,
295
+ maxresults: options === null || options === void 0 ? void 0 : options.maxresults,
296
+ } }));
248
297
  }
249
- export async function _updateCertificatePolicyDeserialize(result) {
298
+ export async function _getCertificateVersionsDeserialize(result) {
250
299
  const expectedStatuses = ["200"];
251
300
  if (!expectedStatuses.includes(result.status)) {
252
- throw createRestError(result);
301
+ const error = createRestError(result);
302
+ error.details = keyVaultErrorDeserializer(result.body);
303
+ throw error;
253
304
  }
254
- return certificatePolicyDeserializer(result.body);
305
+ return _certificateListResultDeserializer(result.body);
255
306
  }
256
- /** Set specified members in the certificate policy. Leave others as null. This operation requires the certificates/update permission. */
257
- export async function updateCertificatePolicy(context, certificateName, certificatePolicy, options = { requestOptions: {} }) {
258
- const result = await _updateCertificatePolicySend(context, certificateName, certificatePolicy, options);
259
- return _updateCertificatePolicyDeserialize(result);
307
+ /** The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission. */
308
+ export function getCertificateVersions(context, certificateName, options = { requestOptions: {} }) {
309
+ return buildPagedAsyncIterator(context, () => _getCertificateVersionsSend(context, certificateName, options), _getCertificateVersionsDeserialize, ["200"], { itemName: "value", nextLinkName: "nextLink" });
260
310
  }
261
- export function _updateCertificateSend(context, certificateName, certificateVersion, parameters, options = { requestOptions: {} }) {
311
+ export function _importCertificateSend(context, certificateName, parameters, options = { requestOptions: {} }) {
312
+ var _a;
262
313
  return context
263
- .path("/certificates/{certificate-name}/{certificate-version}", certificateName, certificateVersion)
264
- .patch(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: certificateUpdateParametersSerializer(parameters) }));
314
+ .path("/certificates/{certificate-name}/import", certificateName)
315
+ .post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { contentType: "application/json", headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion }, body: certificateImportParametersSerializer(parameters) }));
265
316
  }
266
- export async function _updateCertificateDeserialize(result) {
317
+ export async function _importCertificateDeserialize(result) {
267
318
  const expectedStatuses = ["200"];
268
319
  if (!expectedStatuses.includes(result.status)) {
269
- throw createRestError(result);
320
+ const error = createRestError(result);
321
+ error.details = keyVaultErrorDeserializer(result.body);
322
+ throw error;
270
323
  }
271
324
  return certificateBundleDeserializer(result.body);
272
325
  }
273
- /** 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. */
274
- export async function updateCertificate(context, certificateName, certificateVersion, parameters, options = { requestOptions: {} }) {
275
- const result = await _updateCertificateSend(context, certificateName, certificateVersion, parameters, options);
276
- return _updateCertificateDeserialize(result);
326
+ /** Imports an existing valid certificate, containing a private key, into Azure Key Vault. This operation requires the certificates/import permission. 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. Key Vault will only accept a key in PKCS#8 format. */
327
+ export async function importCertificate(context, certificateName, parameters, options = { requestOptions: {} }) {
328
+ const result = await _importCertificateSend(context, certificateName, parameters, options);
329
+ return _importCertificateDeserialize(result);
277
330
  }
278
- export function _getCertificateSend(context, certificateName, certificateVersion, options = { requestOptions: {} }) {
331
+ export function _createCertificateSend(context, certificateName, parameters, options = { requestOptions: {} }) {
332
+ var _a;
279
333
  return context
280
- .path("/certificates/{certificate-name}/{certificate-version}", certificateName, certificateVersion)
281
- .get(Object.assign({}, operationOptionsToRequestParameters(options)));
334
+ .path("/certificates/{certificate-name}/create", certificateName)
335
+ .post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { contentType: "application/json", headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion }, body: certificateCreateParametersSerializer(parameters) }));
282
336
  }
283
- export async function _getCertificateDeserialize(result) {
284
- const expectedStatuses = ["200"];
337
+ export async function _createCertificateDeserialize(result) {
338
+ const expectedStatuses = ["202"];
285
339
  if (!expectedStatuses.includes(result.status)) {
286
- throw createRestError(result);
340
+ const error = createRestError(result);
341
+ error.details = keyVaultErrorDeserializer(result.body);
342
+ throw error;
287
343
  }
288
- return certificateBundleDeserializer(result.body);
344
+ return certificateOperationDeserializer(result.body);
289
345
  }
290
- /** Gets information about a specific certificate. This operation requires the certificates/get permission. */
291
- export async function getCertificate(context, certificateName, certificateVersion, options = { requestOptions: {} }) {
292
- const result = await _getCertificateSend(context, certificateName, certificateVersion, options);
293
- return _getCertificateDeserialize(result);
346
+ /** If this is the first version, the certificate resource is created. This operation requires the certificates/create permission. */
347
+ export async function createCertificate(context, certificateName, parameters, options = { requestOptions: {} }) {
348
+ const result = await _createCertificateSend(context, certificateName, parameters, options);
349
+ return _createCertificateDeserialize(result);
294
350
  }
295
- export function _updateCertificateOperationSend(context, certificateName, certificateOperation, options = { requestOptions: {} }) {
351
+ export function _deleteCertificateIssuerSend(context, issuerName, options = { requestOptions: {} }) {
352
+ var _a;
296
353
  return context
297
- .path("/certificates/{certificate-name}/pending", certificateName)
298
- .patch(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: certificateOperationUpdateParameterSerializer(certificateOperation) }));
354
+ .path("/certificates/issuers/{issuer-name}", issuerName)
355
+ .delete(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion } }));
299
356
  }
300
- export async function _updateCertificateOperationDeserialize(result) {
357
+ export async function _deleteCertificateIssuerDeserialize(result) {
301
358
  const expectedStatuses = ["200"];
302
359
  if (!expectedStatuses.includes(result.status)) {
303
- throw createRestError(result);
360
+ const error = createRestError(result);
361
+ error.details = keyVaultErrorDeserializer(result.body);
362
+ throw error;
304
363
  }
305
- return certificateOperationDeserializer(result.body);
364
+ return issuerBundleDeserializer(result.body);
306
365
  }
307
- /** Updates a certificate creation operation that is already in progress. This operation requires the certificates/update permission. */
308
- export async function updateCertificateOperation(context, certificateName, certificateOperation, options = { requestOptions: {} }) {
309
- const result = await _updateCertificateOperationSend(context, certificateName, certificateOperation, options);
310
- return _updateCertificateOperationDeserialize(result);
366
+ /** The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/deleteissuers permission. */
367
+ export async function deleteCertificateIssuer(context, issuerName, options = { requestOptions: {} }) {
368
+ const result = await _deleteCertificateIssuerSend(context, issuerName, options);
369
+ return _deleteCertificateIssuerDeserialize(result);
311
370
  }
312
- export function _getCertificateOperationSend(context, certificateName, options = { requestOptions: {} }) {
371
+ export function _getCertificateIssuerSend(context, issuerName, options = { requestOptions: {} }) {
372
+ var _a;
313
373
  return context
314
- .path("/certificates/{certificate-name}/pending", certificateName)
315
- .get(Object.assign({}, operationOptionsToRequestParameters(options)));
374
+ .path("/certificates/issuers/{issuer-name}", issuerName)
375
+ .get(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion } }));
316
376
  }
317
- export async function _getCertificateOperationDeserialize(result) {
377
+ export async function _getCertificateIssuerDeserialize(result) {
318
378
  const expectedStatuses = ["200"];
319
379
  if (!expectedStatuses.includes(result.status)) {
320
- throw createRestError(result);
380
+ const error = createRestError(result);
381
+ error.details = keyVaultErrorDeserializer(result.body);
382
+ throw error;
321
383
  }
322
- return certificateOperationDeserializer(result.body);
384
+ return issuerBundleDeserializer(result.body);
323
385
  }
324
- /** Gets the creation operation associated with a specified certificate. This operation requires the certificates/get permission. */
325
- export async function getCertificateOperation(context, certificateName, options = { requestOptions: {} }) {
326
- const result = await _getCertificateOperationSend(context, certificateName, options);
327
- return _getCertificateOperationDeserialize(result);
386
+ /** The GetCertificateIssuer operation returns the specified certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. */
387
+ export async function getCertificateIssuer(context, issuerName, options = { requestOptions: {} }) {
388
+ const result = await _getCertificateIssuerSend(context, issuerName, options);
389
+ return _getCertificateIssuerDeserialize(result);
328
390
  }
329
- export function _deleteCertificateOperationSend(context, certificateName, options = { requestOptions: {} }) {
391
+ export function _updateCertificateIssuerSend(context, issuerName, parameter, options = { requestOptions: {} }) {
392
+ var _a;
330
393
  return context
331
- .path("/certificates/{certificate-name}/pending", certificateName)
332
- .delete(Object.assign({}, operationOptionsToRequestParameters(options)));
394
+ .path("/certificates/issuers/{issuer-name}", issuerName)
395
+ .patch(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { contentType: "application/json", headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion }, body: certificateIssuerUpdateParametersSerializer(parameter) }));
333
396
  }
334
- export async function _deleteCertificateOperationDeserialize(result) {
397
+ export async function _updateCertificateIssuerDeserialize(result) {
335
398
  const expectedStatuses = ["200"];
336
399
  if (!expectedStatuses.includes(result.status)) {
337
- throw createRestError(result);
400
+ const error = createRestError(result);
401
+ error.details = keyVaultErrorDeserializer(result.body);
402
+ throw error;
338
403
  }
339
- return certificateOperationDeserializer(result.body);
404
+ return issuerBundleDeserializer(result.body);
340
405
  }
341
- /** 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. */
342
- export async function deleteCertificateOperation(context, certificateName, options = { requestOptions: {} }) {
343
- const result = await _deleteCertificateOperationSend(context, certificateName, options);
344
- return _deleteCertificateOperationDeserialize(result);
406
+ /** The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. */
407
+ export async function updateCertificateIssuer(context, issuerName, parameter, options = { requestOptions: {} }) {
408
+ const result = await _updateCertificateIssuerSend(context, issuerName, parameter, options);
409
+ return _updateCertificateIssuerDeserialize(result);
345
410
  }
346
- export function _mergeCertificateSend(context, certificateName, parameters, options = { requestOptions: {} }) {
411
+ export function _setCertificateIssuerSend(context, issuerName, parameter, options = { requestOptions: {} }) {
412
+ var _a;
347
413
  return context
348
- .path("/certificates/{certificate-name}/pending/merge", certificateName)
349
- .post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: certificateMergeParametersSerializer(parameters) }));
414
+ .path("/certificates/issuers/{issuer-name}", issuerName)
415
+ .put(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { contentType: "application/json", headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion }, body: certificateIssuerSetParametersSerializer(parameter) }));
350
416
  }
351
- export async function _mergeCertificateDeserialize(result) {
352
- const expectedStatuses = ["201"];
417
+ export async function _setCertificateIssuerDeserialize(result) {
418
+ const expectedStatuses = ["200"];
353
419
  if (!expectedStatuses.includes(result.status)) {
354
- throw createRestError(result);
420
+ const error = createRestError(result);
421
+ error.details = keyVaultErrorDeserializer(result.body);
422
+ throw error;
355
423
  }
356
- return certificateBundleDeserializer(result.body);
424
+ return issuerBundleDeserializer(result.body);
357
425
  }
358
- /** 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. */
359
- export async function mergeCertificate(context, certificateName, parameters, options = { requestOptions: {} }) {
360
- const result = await _mergeCertificateSend(context, certificateName, parameters, options);
361
- return _mergeCertificateDeserialize(result);
426
+ /** The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission. */
427
+ export async function setCertificateIssuer(context, issuerName, parameter, options = { requestOptions: {} }) {
428
+ const result = await _setCertificateIssuerSend(context, issuerName, parameter, options);
429
+ return _setCertificateIssuerDeserialize(result);
362
430
  }
363
- export function _backupCertificateSend(context, certificateName, options = { requestOptions: {} }) {
431
+ export function _getCertificateIssuersSend(context, options = { requestOptions: {} }) {
432
+ var _a;
364
433
  return context
365
- .path("/certificates/{certificate-name}/backup", certificateName)
366
- .post(Object.assign({}, operationOptionsToRequestParameters(options)));
434
+ .path("/certificates/issuers")
435
+ .get(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: {
436
+ "api-version": context.apiVersion,
437
+ maxresults: options === null || options === void 0 ? void 0 : options.maxresults,
438
+ } }));
367
439
  }
368
- export async function _backupCertificateDeserialize(result) {
440
+ export async function _getCertificateIssuersDeserialize(result) {
369
441
  const expectedStatuses = ["200"];
370
442
  if (!expectedStatuses.includes(result.status)) {
371
- throw createRestError(result);
443
+ const error = createRestError(result);
444
+ error.details = keyVaultErrorDeserializer(result.body);
445
+ throw error;
372
446
  }
373
- return backupCertificateResultDeserializer(result.body);
447
+ return _certificateIssuerListResultDeserializer(result.body);
374
448
  }
375
- /** 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. */
376
- export async function backupCertificate(context, certificateName, options = { requestOptions: {} }) {
377
- const result = await _backupCertificateSend(context, certificateName, options);
378
- return _backupCertificateDeserialize(result);
449
+ /** The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. */
450
+ export function getCertificateIssuers(context, options = { requestOptions: {} }) {
451
+ return buildPagedAsyncIterator(context, () => _getCertificateIssuersSend(context, options), _getCertificateIssuersDeserialize, ["200"], { itemName: "value", nextLinkName: "nextLink" });
379
452
  }
380
- export function _restoreCertificateSend(context, parameters, options = { requestOptions: {} }) {
453
+ export function _deleteCertificateContactsSend(context, options = { requestOptions: {} }) {
454
+ var _a;
381
455
  return context
382
- .path("/certificates/restore")
383
- .post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: certificateRestoreParametersSerializer(parameters) }));
456
+ .path("/certificates/contacts")
457
+ .delete(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion } }));
384
458
  }
385
- export async function _restoreCertificateDeserialize(result) {
459
+ export async function _deleteCertificateContactsDeserialize(result) {
386
460
  const expectedStatuses = ["200"];
387
461
  if (!expectedStatuses.includes(result.status)) {
388
- throw createRestError(result);
462
+ const error = createRestError(result);
463
+ error.details = keyVaultErrorDeserializer(result.body);
464
+ throw error;
389
465
  }
390
- return certificateBundleDeserializer(result.body);
466
+ return contactsDeserializer(result.body);
391
467
  }
392
- /** Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission. */
393
- export async function restoreCertificate(context, parameters, options = { requestOptions: {} }) {
394
- const result = await _restoreCertificateSend(context, parameters, options);
395
- return _restoreCertificateDeserialize(result);
468
+ /** Deletes the certificate contacts for a specified key vault certificate. This operation requires the certificates/managecontacts permission. */
469
+ export async function deleteCertificateContacts(context, options = { requestOptions: {} }) {
470
+ const result = await _deleteCertificateContactsSend(context, options);
471
+ return _deleteCertificateContactsDeserialize(result);
396
472
  }
397
- export function _getDeletedCertificatesSend(context, options = { requestOptions: {} }) {
473
+ export function _getCertificateContactsSend(context, options = { requestOptions: {} }) {
474
+ var _a;
398
475
  return context
399
- .path("/deletedcertificates")
400
- .get(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { queryParameters: {
401
- maxresults: options === null || options === void 0 ? void 0 : options.maxresults,
402
- includePending: options === null || options === void 0 ? void 0 : options.includePending,
403
- } }));
476
+ .path("/certificates/contacts")
477
+ .get(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion } }));
404
478
  }
405
- export async function _getDeletedCertificatesDeserialize(result) {
479
+ export async function _getCertificateContactsDeserialize(result) {
406
480
  const expectedStatuses = ["200"];
407
481
  if (!expectedStatuses.includes(result.status)) {
408
- throw createRestError(result);
482
+ const error = createRestError(result);
483
+ error.details = keyVaultErrorDeserializer(result.body);
484
+ throw error;
409
485
  }
410
- return _deletedCertificateListResultDeserializer(result.body);
486
+ return contactsDeserializer(result.body);
411
487
  }
412
- /** 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. */
413
- export function getDeletedCertificates(context, options = { requestOptions: {} }) {
414
- return buildPagedAsyncIterator(context, () => _getDeletedCertificatesSend(context, options), _getDeletedCertificatesDeserialize, ["200"], { itemName: "value", nextLinkName: "nextLink" });
488
+ /** The GetCertificateContacts operation returns the set of certificate contact resources in the specified key vault. This operation requires the certificates/managecontacts permission. */
489
+ export async function getCertificateContacts(context, options = { requestOptions: {} }) {
490
+ const result = await _getCertificateContactsSend(context, options);
491
+ return _getCertificateContactsDeserialize(result);
415
492
  }
416
- export function _getDeletedCertificateSend(context, certificateName, options = { requestOptions: {} }) {
493
+ export function _setCertificateContactsSend(context, contacts, options = { requestOptions: {} }) {
494
+ var _a;
417
495
  return context
418
- .path("/deletedcertificates/{certificate-name}", certificateName)
419
- .get(Object.assign({}, operationOptionsToRequestParameters(options)));
496
+ .path("/certificates/contacts")
497
+ .put(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { contentType: "application/json", headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion }, body: contactsSerializer(contacts) }));
420
498
  }
421
- export async function _getDeletedCertificateDeserialize(result) {
499
+ export async function _setCertificateContactsDeserialize(result) {
422
500
  const expectedStatuses = ["200"];
423
501
  if (!expectedStatuses.includes(result.status)) {
424
- throw createRestError(result);
502
+ const error = createRestError(result);
503
+ error.details = keyVaultErrorDeserializer(result.body);
504
+ throw error;
425
505
  }
426
- return deletedCertificateBundleDeserializer(result.body);
506
+ return contactsDeserializer(result.body);
427
507
  }
428
- /** 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. */
429
- export async function getDeletedCertificate(context, certificateName, options = { requestOptions: {} }) {
430
- const result = await _getDeletedCertificateSend(context, certificateName, options);
431
- return _getDeletedCertificateDeserialize(result);
508
+ /** Sets the certificate contacts for the specified key vault. This operation requires the certificates/managecontacts permission. */
509
+ export async function setCertificateContacts(context, contacts, options = { requestOptions: {} }) {
510
+ const result = await _setCertificateContactsSend(context, contacts, options);
511
+ return _setCertificateContactsDeserialize(result);
432
512
  }
433
- export function _purgeDeletedCertificateSend(context, certificateName, options = { requestOptions: {} }) {
513
+ export function _deleteCertificateSend(context, certificateName, options = { requestOptions: {} }) {
514
+ var _a;
434
515
  return context
435
- .path("/deletedcertificates/{certificate-name}", certificateName)
436
- .delete(Object.assign({}, operationOptionsToRequestParameters(options)));
516
+ .path("/certificates/{certificate-name}", certificateName)
517
+ .delete(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: { "api-version": context.apiVersion } }));
437
518
  }
438
- export async function _purgeDeletedCertificateDeserialize(result) {
439
- const expectedStatuses = ["204"];
519
+ export async function _deleteCertificateDeserialize(result) {
520
+ const expectedStatuses = ["200"];
440
521
  if (!expectedStatuses.includes(result.status)) {
441
- throw createRestError(result);
522
+ const error = createRestError(result);
523
+ error.details = keyVaultErrorDeserializer(result.body);
524
+ throw error;
442
525
  }
443
- return;
526
+ return deletedCertificateBundleDeserializer(result.body);
444
527
  }
445
- /** 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. */
446
- export async function purgeDeletedCertificate(context, certificateName, options = { requestOptions: {} }) {
447
- const result = await _purgeDeletedCertificateSend(context, certificateName, options);
448
- return _purgeDeletedCertificateDeserialize(result);
528
+ /** 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. */
529
+ export async function deleteCertificate(context, certificateName, options = { requestOptions: {} }) {
530
+ const result = await _deleteCertificateSend(context, certificateName, options);
531
+ return _deleteCertificateDeserialize(result);
449
532
  }
450
- export function _recoverDeletedCertificateSend(context, certificateName, options = { requestOptions: {} }) {
533
+ export function _getCertificatesSend(context, options = { requestOptions: {} }) {
534
+ var _a;
451
535
  return context
452
- .path("/deletedcertificates/{certificate-name}/recover", certificateName)
453
- .post(Object.assign({}, operationOptionsToRequestParameters(options)));
536
+ .path("/certificates")
537
+ .get(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { headers: Object.assign({ accept: "application/json" }, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.headers), queryParameters: {
538
+ "api-version": context.apiVersion,
539
+ maxresults: options === null || options === void 0 ? void 0 : options.maxresults,
540
+ includePending: options === null || options === void 0 ? void 0 : options.includePending,
541
+ } }));
454
542
  }
455
- export async function _recoverDeletedCertificateDeserialize(result) {
543
+ export async function _getCertificatesDeserialize(result) {
456
544
  const expectedStatuses = ["200"];
457
545
  if (!expectedStatuses.includes(result.status)) {
458
- throw createRestError(result);
546
+ const error = createRestError(result);
547
+ error.details = keyVaultErrorDeserializer(result.body);
548
+ throw error;
459
549
  }
460
- return certificateBundleDeserializer(result.body);
550
+ return _certificateListResultDeserializer(result.body);
461
551
  }
462
- /** 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. */
463
- export async function recoverDeletedCertificate(context, certificateName, options = { requestOptions: {} }) {
464
- const result = await _recoverDeletedCertificateSend(context, certificateName, options);
465
- return _recoverDeletedCertificateDeserialize(result);
552
+ /** The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission. */
553
+ export function getCertificates(context, options = { requestOptions: {} }) {
554
+ return buildPagedAsyncIterator(context, () => _getCertificatesSend(context, options), _getCertificatesDeserialize, ["200"], { itemName: "value", nextLinkName: "nextLink" });
466
555
  }
467
556
  //# sourceMappingURL=operations.js.map