@foru-ms/sdk 2.1.4 → 2.1.6

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 (175) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/BaseClient.d.ts +0 -4
  3. package/dist/cjs/BaseClient.js +2 -3
  4. package/dist/cjs/Client.d.ts +1 -1
  5. package/dist/cjs/Client.js +1 -1
  6. package/dist/cjs/api/errors/ConflictError.d.ts +6 -0
  7. package/dist/cjs/api/errors/ConflictError.js +54 -0
  8. package/dist/cjs/api/errors/ForbiddenError.d.ts +6 -0
  9. package/dist/cjs/api/errors/ForbiddenError.js +54 -0
  10. package/dist/cjs/api/errors/index.d.ts +2 -0
  11. package/dist/cjs/api/errors/index.js +2 -0
  12. package/dist/cjs/api/resources/auth/client/Client.d.ts +1 -1
  13. package/dist/cjs/api/resources/auth/client/Client.js +36 -46
  14. package/dist/cjs/api/resources/integrations/client/Client.d.ts +1 -1
  15. package/dist/cjs/api/resources/integrations/client/Client.js +36 -46
  16. package/dist/cjs/api/resources/notifications/client/Client.d.ts +1 -1
  17. package/dist/cjs/api/resources/notifications/client/Client.js +36 -46
  18. package/dist/cjs/api/resources/posts/client/Client.d.ts +1 -1
  19. package/dist/cjs/api/resources/posts/client/Client.js +85 -109
  20. package/dist/cjs/api/resources/privateMessages/client/Client.d.ts +1 -1
  21. package/dist/cjs/api/resources/privateMessages/client/Client.js +64 -82
  22. package/dist/cjs/api/resources/provisioning/client/Client.d.ts +97 -3
  23. package/dist/cjs/api/resources/provisioning/client/Client.js +472 -214
  24. package/dist/cjs/api/resources/provisioning/client/requests/AddDomainProvisioningRequest.d.ts +3 -0
  25. package/dist/cjs/api/resources/provisioning/client/requests/CreateInstance.d.ts +3 -0
  26. package/dist/cjs/api/resources/provisioning/client/requests/CreateWebhookProvisioningRequest.d.ts +3 -0
  27. package/dist/cjs/api/resources/provisioning/client/requests/DeleteInstance.d.ts +3 -0
  28. package/dist/cjs/api/resources/provisioning/client/requests/DeleteWebhookProvisioningRequest.d.ts +3 -0
  29. package/dist/cjs/api/resources/provisioning/client/requests/ExportDataProvisioningRequest.d.ts +3 -0
  30. package/dist/cjs/api/resources/provisioning/client/requests/GetBillingProvisioningRequest.d.ts +3 -0
  31. package/dist/cjs/api/resources/provisioning/client/requests/GetOwnershipProvisioningRequest.d.ts +13 -0
  32. package/dist/cjs/api/resources/provisioning/client/requests/GetOwnershipProvisioningRequest.js +3 -0
  33. package/dist/cjs/api/resources/provisioning/client/requests/GetUsageProvisioningRequest.d.ts +3 -0
  34. package/dist/cjs/api/resources/provisioning/client/requests/InviteTeamProvisioningRequest.d.ts +3 -0
  35. package/dist/cjs/api/resources/provisioning/client/requests/ListDomainsProvisioningRequest.d.ts +3 -0
  36. package/dist/cjs/api/resources/provisioning/client/requests/ListProvisioningRequest.d.ts +5 -1
  37. package/dist/cjs/api/resources/provisioning/client/requests/ListTeamProvisioningRequest.d.ts +3 -0
  38. package/dist/cjs/api/resources/provisioning/client/requests/ListWebhooksProvisioningRequest.d.ts +3 -0
  39. package/dist/cjs/api/resources/provisioning/client/requests/LoginProvisioningRequest.d.ts +13 -0
  40. package/dist/cjs/api/resources/provisioning/client/requests/LoginProvisioningRequest.js +3 -0
  41. package/dist/cjs/api/resources/provisioning/client/requests/RegenerateApiKeyProvisioningRequest.d.ts +3 -0
  42. package/dist/cjs/api/resources/provisioning/client/requests/RegisterProvisioningRequest.d.ts +15 -0
  43. package/dist/cjs/api/resources/provisioning/client/requests/RegisterProvisioningRequest.js +3 -0
  44. package/dist/cjs/api/resources/provisioning/client/requests/RemoveDomainProvisioningRequest.d.ts +3 -0
  45. package/dist/cjs/api/resources/provisioning/client/requests/RemoveTeamMemberProvisioningRequest.d.ts +3 -0
  46. package/dist/cjs/api/resources/provisioning/client/requests/TransferOwnershipProvisioningRequest.d.ts +15 -0
  47. package/dist/cjs/api/resources/provisioning/client/requests/TransferOwnershipProvisioningRequest.js +3 -0
  48. package/dist/cjs/api/resources/provisioning/client/requests/UpdateInstance.d.ts +3 -0
  49. package/dist/cjs/api/resources/provisioning/client/requests/UpdateWebhookProvisioningRequest.d.ts +3 -0
  50. package/dist/cjs/api/resources/provisioning/client/requests/UpgradeInstance.d.ts +3 -0
  51. package/dist/cjs/api/resources/provisioning/client/requests/index.d.ts +4 -0
  52. package/dist/cjs/api/resources/provisioning/types/GetOwnershipProvisioningResponse.d.ts +4 -0
  53. package/dist/cjs/api/resources/provisioning/types/GetOwnershipProvisioningResponse.js +3 -0
  54. package/dist/cjs/api/resources/provisioning/types/LoginProvisioningResponse.d.ts +4 -0
  55. package/dist/cjs/api/resources/provisioning/types/LoginProvisioningResponse.js +3 -0
  56. package/dist/cjs/api/resources/provisioning/types/RegisterProvisioningResponse.d.ts +4 -0
  57. package/dist/cjs/api/resources/provisioning/types/RegisterProvisioningResponse.js +3 -0
  58. package/dist/cjs/api/resources/provisioning/types/TransferOwnershipProvisioningResponse.d.ts +16 -0
  59. package/dist/cjs/api/resources/provisioning/types/TransferOwnershipProvisioningResponse.js +3 -0
  60. package/dist/cjs/api/resources/provisioning/types/index.d.ts +4 -0
  61. package/dist/cjs/api/resources/provisioning/types/index.js +4 -0
  62. package/dist/cjs/api/resources/reports/client/Client.d.ts +1 -1
  63. package/dist/cjs/api/resources/reports/client/Client.js +36 -46
  64. package/dist/cjs/api/resources/roles/client/Client.d.ts +1 -1
  65. package/dist/cjs/api/resources/roles/client/Client.js +36 -46
  66. package/dist/cjs/api/resources/search/client/Client.d.ts +1 -1
  67. package/dist/cjs/api/resources/search/client/Client.js +8 -10
  68. package/dist/cjs/api/resources/ssOs/client/Client.d.ts +1 -1
  69. package/dist/cjs/api/resources/ssOs/client/Client.js +36 -46
  70. package/dist/cjs/api/resources/tags/client/Client.d.ts +1 -1
  71. package/dist/cjs/api/resources/tags/client/Client.js +57 -73
  72. package/dist/cjs/api/resources/threads/client/Client.d.ts +1 -1
  73. package/dist/cjs/api/resources/threads/client/Client.js +127 -163
  74. package/dist/cjs/api/resources/users/client/Client.d.ts +1 -1
  75. package/dist/cjs/api/resources/users/client/Client.js +78 -100
  76. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +1 -1
  77. package/dist/cjs/api/resources/webhooks/client/Client.js +57 -73
  78. package/dist/cjs/api/types/ConflictErrorBody.d.ts +13 -0
  79. package/dist/cjs/api/types/ConflictErrorBody.js +3 -0
  80. package/dist/cjs/api/types/OwnershipInfo.d.ts +18 -0
  81. package/dist/cjs/api/types/OwnershipInfo.js +3 -0
  82. package/dist/cjs/api/types/ProvisioningAuthResponse.d.ts +5 -0
  83. package/dist/cjs/api/types/ProvisioningAuthResponse.js +3 -0
  84. package/dist/cjs/api/types/index.d.ts +3 -0
  85. package/dist/cjs/api/types/index.js +3 -0
  86. package/dist/cjs/version.d.ts +1 -1
  87. package/dist/cjs/version.js +1 -1
  88. package/dist/esm/BaseClient.d.mts +0 -4
  89. package/dist/esm/BaseClient.mjs +2 -3
  90. package/dist/esm/Client.d.mts +1 -1
  91. package/dist/esm/Client.mjs +1 -1
  92. package/dist/esm/api/errors/ConflictError.d.mts +6 -0
  93. package/dist/esm/api/errors/ConflictError.mjs +17 -0
  94. package/dist/esm/api/errors/ForbiddenError.d.mts +6 -0
  95. package/dist/esm/api/errors/ForbiddenError.mjs +17 -0
  96. package/dist/esm/api/errors/index.d.mts +2 -0
  97. package/dist/esm/api/errors/index.mjs +2 -0
  98. package/dist/esm/api/resources/auth/client/Client.d.mts +1 -1
  99. package/dist/esm/api/resources/auth/client/Client.mjs +37 -47
  100. package/dist/esm/api/resources/integrations/client/Client.d.mts +1 -1
  101. package/dist/esm/api/resources/integrations/client/Client.mjs +37 -47
  102. package/dist/esm/api/resources/notifications/client/Client.d.mts +1 -1
  103. package/dist/esm/api/resources/notifications/client/Client.mjs +37 -47
  104. package/dist/esm/api/resources/posts/client/Client.d.mts +1 -1
  105. package/dist/esm/api/resources/posts/client/Client.mjs +86 -110
  106. package/dist/esm/api/resources/privateMessages/client/Client.d.mts +1 -1
  107. package/dist/esm/api/resources/privateMessages/client/Client.mjs +65 -83
  108. package/dist/esm/api/resources/provisioning/client/Client.d.mts +97 -3
  109. package/dist/esm/api/resources/provisioning/client/Client.mjs +472 -214
  110. package/dist/esm/api/resources/provisioning/client/requests/AddDomainProvisioningRequest.d.mts +3 -0
  111. package/dist/esm/api/resources/provisioning/client/requests/CreateInstance.d.mts +3 -0
  112. package/dist/esm/api/resources/provisioning/client/requests/CreateWebhookProvisioningRequest.d.mts +3 -0
  113. package/dist/esm/api/resources/provisioning/client/requests/DeleteInstance.d.mts +3 -0
  114. package/dist/esm/api/resources/provisioning/client/requests/DeleteWebhookProvisioningRequest.d.mts +3 -0
  115. package/dist/esm/api/resources/provisioning/client/requests/ExportDataProvisioningRequest.d.mts +3 -0
  116. package/dist/esm/api/resources/provisioning/client/requests/GetBillingProvisioningRequest.d.mts +3 -0
  117. package/dist/esm/api/resources/provisioning/client/requests/GetOwnershipProvisioningRequest.d.mts +13 -0
  118. package/dist/esm/api/resources/provisioning/client/requests/GetOwnershipProvisioningRequest.mjs +2 -0
  119. package/dist/esm/api/resources/provisioning/client/requests/GetUsageProvisioningRequest.d.mts +3 -0
  120. package/dist/esm/api/resources/provisioning/client/requests/InviteTeamProvisioningRequest.d.mts +3 -0
  121. package/dist/esm/api/resources/provisioning/client/requests/ListDomainsProvisioningRequest.d.mts +3 -0
  122. package/dist/esm/api/resources/provisioning/client/requests/ListProvisioningRequest.d.mts +5 -1
  123. package/dist/esm/api/resources/provisioning/client/requests/ListTeamProvisioningRequest.d.mts +3 -0
  124. package/dist/esm/api/resources/provisioning/client/requests/ListWebhooksProvisioningRequest.d.mts +3 -0
  125. package/dist/esm/api/resources/provisioning/client/requests/LoginProvisioningRequest.d.mts +13 -0
  126. package/dist/esm/api/resources/provisioning/client/requests/LoginProvisioningRequest.mjs +2 -0
  127. package/dist/esm/api/resources/provisioning/client/requests/RegenerateApiKeyProvisioningRequest.d.mts +3 -0
  128. package/dist/esm/api/resources/provisioning/client/requests/RegisterProvisioningRequest.d.mts +15 -0
  129. package/dist/esm/api/resources/provisioning/client/requests/RegisterProvisioningRequest.mjs +2 -0
  130. package/dist/esm/api/resources/provisioning/client/requests/RemoveDomainProvisioningRequest.d.mts +3 -0
  131. package/dist/esm/api/resources/provisioning/client/requests/RemoveTeamMemberProvisioningRequest.d.mts +3 -0
  132. package/dist/esm/api/resources/provisioning/client/requests/TransferOwnershipProvisioningRequest.d.mts +15 -0
  133. package/dist/esm/api/resources/provisioning/client/requests/TransferOwnershipProvisioningRequest.mjs +2 -0
  134. package/dist/esm/api/resources/provisioning/client/requests/UpdateInstance.d.mts +3 -0
  135. package/dist/esm/api/resources/provisioning/client/requests/UpdateWebhookProvisioningRequest.d.mts +3 -0
  136. package/dist/esm/api/resources/provisioning/client/requests/UpgradeInstance.d.mts +3 -0
  137. package/dist/esm/api/resources/provisioning/client/requests/index.d.mts +4 -0
  138. package/dist/esm/api/resources/provisioning/types/GetOwnershipProvisioningResponse.d.mts +4 -0
  139. package/dist/esm/api/resources/provisioning/types/GetOwnershipProvisioningResponse.mjs +2 -0
  140. package/dist/esm/api/resources/provisioning/types/LoginProvisioningResponse.d.mts +4 -0
  141. package/dist/esm/api/resources/provisioning/types/LoginProvisioningResponse.mjs +2 -0
  142. package/dist/esm/api/resources/provisioning/types/RegisterProvisioningResponse.d.mts +4 -0
  143. package/dist/esm/api/resources/provisioning/types/RegisterProvisioningResponse.mjs +2 -0
  144. package/dist/esm/api/resources/provisioning/types/TransferOwnershipProvisioningResponse.d.mts +16 -0
  145. package/dist/esm/api/resources/provisioning/types/TransferOwnershipProvisioningResponse.mjs +2 -0
  146. package/dist/esm/api/resources/provisioning/types/index.d.mts +4 -0
  147. package/dist/esm/api/resources/provisioning/types/index.mjs +4 -0
  148. package/dist/esm/api/resources/reports/client/Client.d.mts +1 -1
  149. package/dist/esm/api/resources/reports/client/Client.mjs +37 -47
  150. package/dist/esm/api/resources/roles/client/Client.d.mts +1 -1
  151. package/dist/esm/api/resources/roles/client/Client.mjs +37 -47
  152. package/dist/esm/api/resources/search/client/Client.d.mts +1 -1
  153. package/dist/esm/api/resources/search/client/Client.mjs +9 -11
  154. package/dist/esm/api/resources/ssOs/client/Client.d.mts +1 -1
  155. package/dist/esm/api/resources/ssOs/client/Client.mjs +37 -47
  156. package/dist/esm/api/resources/tags/client/Client.d.mts +1 -1
  157. package/dist/esm/api/resources/tags/client/Client.mjs +58 -74
  158. package/dist/esm/api/resources/threads/client/Client.d.mts +1 -1
  159. package/dist/esm/api/resources/threads/client/Client.mjs +128 -164
  160. package/dist/esm/api/resources/users/client/Client.d.mts +1 -1
  161. package/dist/esm/api/resources/users/client/Client.mjs +79 -101
  162. package/dist/esm/api/resources/webhooks/client/Client.d.mts +1 -1
  163. package/dist/esm/api/resources/webhooks/client/Client.mjs +58 -74
  164. package/dist/esm/api/types/ConflictErrorBody.d.mts +13 -0
  165. package/dist/esm/api/types/ConflictErrorBody.mjs +2 -0
  166. package/dist/esm/api/types/OwnershipInfo.d.mts +18 -0
  167. package/dist/esm/api/types/OwnershipInfo.mjs +2 -0
  168. package/dist/esm/api/types/ProvisioningAuthResponse.d.mts +5 -0
  169. package/dist/esm/api/types/ProvisioningAuthResponse.mjs +2 -0
  170. package/dist/esm/api/types/index.d.mts +3 -0
  171. package/dist/esm/api/types/index.mjs +3 -0
  172. package/dist/esm/version.d.mts +1 -1
  173. package/dist/esm/version.mjs +1 -1
  174. package/package.json +1 -1
  175. package/reference.md +286 -1
@@ -8,6 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __rest = (this && this.__rest) || function (s, e) {
12
+ var t = {};
13
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
+ t[p] = s[p];
15
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
+ t[p[i]] = s[p[i]];
19
+ }
20
+ return t;
21
+ };
11
22
  import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
12
23
  import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
13
24
  import * as core from "../../../../core/index.mjs";
@@ -19,7 +30,7 @@ import * as Forum from "../../../index.mjs";
19
30
  * Platform-level instance management using your provisioning key
20
31
  */
21
32
  export class ProvisioningClient {
22
- constructor(options) {
33
+ constructor(options = {}) {
23
34
  this._options = normalizeClientOptionsWithAuth(options);
24
35
  }
25
36
  /**
@@ -33,31 +44,31 @@ export class ProvisioningClient {
33
44
  * @throws {@link Forum.InternalServerError}
34
45
  *
35
46
  * @example
36
- * await client.provisioning.list()
47
+ * await client.provisioning.list({
48
+ * "x-provisioning-key": "x-provisioning-key"
49
+ * })
37
50
  */
38
- list(request = {}, requestOptions) {
51
+ list(request, requestOptions) {
39
52
  return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
40
53
  }
41
- __list() {
42
- return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
43
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
44
- const { handle } = request;
54
+ __list(request, requestOptions) {
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
57
+ const { handle, "x-provisioning-key": provisioningKey } = request;
45
58
  const _queryParams = {
46
59
  handle,
47
60
  };
48
61
  const _authRequest = yield this._options.authProvider.getAuthRequest();
49
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
50
- "x-provisioning-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.provisioningKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.provisioningKey,
51
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
52
- const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
53
- url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "instances"),
62
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
63
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
64
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances"),
54
65
  method: "GET",
55
66
  headers: _headers,
56
67
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
57
- timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
58
- maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
68
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
69
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
59
70
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
60
- fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
71
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
61
72
  logging: this._options.logging,
62
73
  });
63
74
  if (_response.ok) {
@@ -79,7 +90,7 @@ export class ProvisioningClient {
79
90
  });
80
91
  }
81
92
  }
82
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/instances");
93
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/provisioning/instances");
83
94
  });
84
95
  }
85
96
  /**
@@ -94,6 +105,7 @@ export class ProvisioningClient {
94
105
  *
95
106
  * @example
96
107
  * await client.provisioning.create({
108
+ * "x-provisioning-key": "x-provisioning-key",
97
109
  * name: "name",
98
110
  * handle: "handle"
99
111
  * })
@@ -103,23 +115,22 @@ export class ProvisioningClient {
103
115
  }
104
116
  __create(request, requestOptions) {
105
117
  return __awaiter(this, void 0, void 0, function* () {
106
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
118
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
119
+ const { "x-provisioning-key": provisioningKey } = request, _body = __rest(request, ["x-provisioning-key"]);
107
120
  const _authRequest = yield this._options.authProvider.getAuthRequest();
108
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
109
- "x-provisioning-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.provisioningKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.provisioningKey,
110
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
111
- const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
112
- url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "instances"),
121
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
122
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
123
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances"),
113
124
  method: "POST",
114
125
  headers: _headers,
115
126
  contentType: "application/json",
116
127
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
117
128
  requestType: "json",
118
- body: request,
119
- timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
120
- maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
129
+ body: _body,
130
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
131
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
121
132
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
122
- fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
133
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
123
134
  logging: this._options.logging,
124
135
  });
125
136
  if (_response.ok) {
@@ -141,7 +152,7 @@ export class ProvisioningClient {
141
152
  });
142
153
  }
143
154
  }
144
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/instances");
155
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/provisioning/instances");
145
156
  });
146
157
  }
147
158
  /**
@@ -157,6 +168,7 @@ export class ProvisioningClient {
157
168
  *
158
169
  * @example
159
170
  * await client.provisioning.update({
171
+ * "x-provisioning-key": "x-provisioning-key",
160
172
  * handle: "handle"
161
173
  * })
162
174
  */
@@ -165,23 +177,22 @@ export class ProvisioningClient {
165
177
  }
166
178
  __update(request, requestOptions) {
167
179
  return __awaiter(this, void 0, void 0, function* () {
168
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
180
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
181
+ const { "x-provisioning-key": provisioningKey } = request, _body = __rest(request, ["x-provisioning-key"]);
169
182
  const _authRequest = yield this._options.authProvider.getAuthRequest();
170
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
171
- "x-provisioning-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.provisioningKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.provisioningKey,
172
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
173
- const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
174
- url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "instances"),
183
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
184
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
185
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances"),
175
186
  method: "PUT",
176
187
  headers: _headers,
177
188
  contentType: "application/json",
178
189
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
179
190
  requestType: "json",
180
- body: request,
181
- timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
182
- maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
191
+ body: _body,
192
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
193
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
183
194
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
184
- fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
195
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
185
196
  logging: this._options.logging,
186
197
  });
187
198
  if (_response.ok) {
@@ -205,7 +216,7 @@ export class ProvisioningClient {
205
216
  });
206
217
  }
207
218
  }
208
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/instances");
219
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/provisioning/instances");
209
220
  });
210
221
  }
211
222
  /**
@@ -221,6 +232,7 @@ export class ProvisioningClient {
221
232
  *
222
233
  * @example
223
234
  * await client.provisioning.delete({
235
+ * "x-provisioning-key": "x-provisioning-key",
224
236
  * handle: "handle"
225
237
  * })
226
238
  */
@@ -229,23 +241,22 @@ export class ProvisioningClient {
229
241
  }
230
242
  __delete(request, requestOptions) {
231
243
  return __awaiter(this, void 0, void 0, function* () {
232
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
244
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
245
+ const { "x-provisioning-key": provisioningKey } = request, _body = __rest(request, ["x-provisioning-key"]);
233
246
  const _authRequest = yield this._options.authProvider.getAuthRequest();
234
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
235
- "x-provisioning-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.provisioningKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.provisioningKey,
236
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
237
- const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
238
- url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "instances"),
247
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
248
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
249
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances"),
239
250
  method: "DELETE",
240
251
  headers: _headers,
241
252
  contentType: "application/json",
242
253
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
243
254
  requestType: "json",
244
- body: request,
245
- timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
246
- maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
255
+ body: _body,
256
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
257
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
247
258
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
248
- fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
259
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
249
260
  logging: this._options.logging,
250
261
  });
251
262
  if (_response.ok) {
@@ -269,7 +280,7 @@ export class ProvisioningClient {
269
280
  });
270
281
  }
271
282
  }
272
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/instances");
283
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/provisioning/instances");
273
284
  });
274
285
  }
275
286
  /**
@@ -284,6 +295,7 @@ export class ProvisioningClient {
284
295
  *
285
296
  * @example
286
297
  * await client.provisioning.getBilling({
298
+ * "x-provisioning-key": "x-provisioning-key",
287
299
  * handle: "handle"
288
300
  * })
289
301
  */
@@ -292,24 +304,22 @@ export class ProvisioningClient {
292
304
  }
293
305
  __getBilling(request, requestOptions) {
294
306
  return __awaiter(this, void 0, void 0, function* () {
295
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
296
- const { handle } = request;
307
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
308
+ const { handle, "x-provisioning-key": provisioningKey } = request;
297
309
  const _queryParams = {
298
310
  handle,
299
311
  };
300
312
  const _authRequest = yield this._options.authProvider.getAuthRequest();
301
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
302
- "x-provisioning-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.provisioningKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.provisioningKey,
303
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
304
- const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
305
- url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "instances/billing"),
313
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
314
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
315
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances/billing"),
306
316
  method: "GET",
307
317
  headers: _headers,
308
318
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
309
- timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
310
- maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
319
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
320
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
311
321
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
312
- fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
322
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
313
323
  logging: this._options.logging,
314
324
  });
315
325
  if (_response.ok) {
@@ -331,7 +341,7 @@ export class ProvisioningClient {
331
341
  });
332
342
  }
333
343
  }
334
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/instances/billing");
344
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/provisioning/instances/billing");
335
345
  });
336
346
  }
337
347
  /**
@@ -347,6 +357,7 @@ export class ProvisioningClient {
347
357
  *
348
358
  * @example
349
359
  * await client.provisioning.changePlan({
360
+ * "x-provisioning-key": "x-provisioning-key",
350
361
  * handle: "handle",
351
362
  * plan: "FREE"
352
363
  * })
@@ -356,23 +367,22 @@ export class ProvisioningClient {
356
367
  }
357
368
  __changePlan(request, requestOptions) {
358
369
  return __awaiter(this, void 0, void 0, function* () {
359
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
370
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
371
+ const { "x-provisioning-key": provisioningKey } = request, _body = __rest(request, ["x-provisioning-key"]);
360
372
  const _authRequest = yield this._options.authProvider.getAuthRequest();
361
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
362
- "x-provisioning-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.provisioningKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.provisioningKey,
363
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
364
- const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
365
- url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "instances/billing"),
373
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
374
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
375
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances/billing"),
366
376
  method: "POST",
367
377
  headers: _headers,
368
378
  contentType: "application/json",
369
379
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
370
380
  requestType: "json",
371
- body: request,
372
- timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
373
- maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
381
+ body: _body,
382
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
383
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
374
384
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
375
- fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
385
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
376
386
  logging: this._options.logging,
377
387
  });
378
388
  if (_response.ok) {
@@ -396,7 +406,7 @@ export class ProvisioningClient {
396
406
  });
397
407
  }
398
408
  }
399
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/instances/billing");
409
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/provisioning/instances/billing");
400
410
  });
401
411
  }
402
412
  /**
@@ -411,6 +421,7 @@ export class ProvisioningClient {
411
421
  *
412
422
  * @example
413
423
  * await client.provisioning.regenerateApiKey({
424
+ * "x-provisioning-key": "x-provisioning-key",
414
425
  * handle: "handle"
415
426
  * })
416
427
  */
@@ -419,23 +430,22 @@ export class ProvisioningClient {
419
430
  }
420
431
  __regenerateApiKey(request, requestOptions) {
421
432
  return __awaiter(this, void 0, void 0, function* () {
422
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
433
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
434
+ const { "x-provisioning-key": provisioningKey } = request, _body = __rest(request, ["x-provisioning-key"]);
423
435
  const _authRequest = yield this._options.authProvider.getAuthRequest();
424
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
425
- "x-provisioning-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.provisioningKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.provisioningKey,
426
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
427
- const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
428
- url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "instances/api-key"),
436
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
437
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
438
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances/api-key"),
429
439
  method: "POST",
430
440
  headers: _headers,
431
441
  contentType: "application/json",
432
442
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
433
443
  requestType: "json",
434
- body: request,
435
- timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
436
- maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
444
+ body: _body,
445
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
446
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
437
447
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
438
- fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
448
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
439
449
  logging: this._options.logging,
440
450
  });
441
451
  if (_response.ok) {
@@ -460,7 +470,7 @@ export class ProvisioningClient {
460
470
  });
461
471
  }
462
472
  }
463
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/instances/api-key");
473
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/provisioning/instances/api-key");
464
474
  });
465
475
  }
466
476
  /**
@@ -475,6 +485,7 @@ export class ProvisioningClient {
475
485
  *
476
486
  * @example
477
487
  * await client.provisioning.getUsage({
488
+ * "x-provisioning-key": "x-provisioning-key",
478
489
  * handle: "handle"
479
490
  * })
480
491
  */
@@ -483,24 +494,22 @@ export class ProvisioningClient {
483
494
  }
484
495
  __getUsage(request, requestOptions) {
485
496
  return __awaiter(this, void 0, void 0, function* () {
486
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
487
- const { handle } = request;
497
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
498
+ const { handle, "x-provisioning-key": provisioningKey } = request;
488
499
  const _queryParams = {
489
500
  handle,
490
501
  };
491
502
  const _authRequest = yield this._options.authProvider.getAuthRequest();
492
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
493
- "x-provisioning-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.provisioningKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.provisioningKey,
494
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
495
- const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
496
- url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "instances/usage"),
503
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
504
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
505
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances/usage"),
497
506
  method: "GET",
498
507
  headers: _headers,
499
508
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
500
- timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
501
- maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
509
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
510
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
502
511
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
503
- fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
512
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
504
513
  logging: this._options.logging,
505
514
  });
506
515
  if (_response.ok) {
@@ -522,7 +531,7 @@ export class ProvisioningClient {
522
531
  });
523
532
  }
524
533
  }
525
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/instances/usage");
534
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/provisioning/instances/usage");
526
535
  });
527
536
  }
528
537
  /**
@@ -537,6 +546,7 @@ export class ProvisioningClient {
537
546
  *
538
547
  * @example
539
548
  * await client.provisioning.listTeam({
549
+ * "x-provisioning-key": "x-provisioning-key",
540
550
  * handle: "handle"
541
551
  * })
542
552
  */
@@ -545,24 +555,22 @@ export class ProvisioningClient {
545
555
  }
546
556
  __listTeam(request, requestOptions) {
547
557
  return __awaiter(this, void 0, void 0, function* () {
548
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
549
- const { handle } = request;
558
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
559
+ const { handle, "x-provisioning-key": provisioningKey } = request;
550
560
  const _queryParams = {
551
561
  handle,
552
562
  };
553
563
  const _authRequest = yield this._options.authProvider.getAuthRequest();
554
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
555
- "x-provisioning-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.provisioningKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.provisioningKey,
556
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
557
- const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
558
- url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "instances/team"),
564
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
565
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
566
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances/team"),
559
567
  method: "GET",
560
568
  headers: _headers,
561
569
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
562
- timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
563
- maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
570
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
571
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
564
572
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
565
- fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
573
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
566
574
  logging: this._options.logging,
567
575
  });
568
576
  if (_response.ok) {
@@ -584,7 +592,7 @@ export class ProvisioningClient {
584
592
  });
585
593
  }
586
594
  }
587
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/instances/team");
595
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/provisioning/instances/team");
588
596
  });
589
597
  }
590
598
  /**
@@ -600,6 +608,7 @@ export class ProvisioningClient {
600
608
  *
601
609
  * @example
602
610
  * await client.provisioning.inviteTeam({
611
+ * "x-provisioning-key": "x-provisioning-key",
603
612
  * handle: "handle",
604
613
  * members: [{
605
614
  * email: "email"
@@ -611,23 +620,22 @@ export class ProvisioningClient {
611
620
  }
612
621
  __inviteTeam(request, requestOptions) {
613
622
  return __awaiter(this, void 0, void 0, function* () {
614
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
623
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
624
+ const { "x-provisioning-key": provisioningKey } = request, _body = __rest(request, ["x-provisioning-key"]);
615
625
  const _authRequest = yield this._options.authProvider.getAuthRequest();
616
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
617
- "x-provisioning-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.provisioningKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.provisioningKey,
618
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
619
- const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
620
- url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "instances/team"),
626
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
627
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
628
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances/team"),
621
629
  method: "POST",
622
630
  headers: _headers,
623
631
  contentType: "application/json",
624
632
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
625
633
  requestType: "json",
626
- body: request,
627
- timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
628
- maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
634
+ body: _body,
635
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
636
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
629
637
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
630
- fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
638
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
631
639
  logging: this._options.logging,
632
640
  });
633
641
  if (_response.ok) {
@@ -651,7 +659,7 @@ export class ProvisioningClient {
651
659
  });
652
660
  }
653
661
  }
654
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/instances/team");
662
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/provisioning/instances/team");
655
663
  });
656
664
  }
657
665
  /**
@@ -667,6 +675,7 @@ export class ProvisioningClient {
667
675
  *
668
676
  * @example
669
677
  * await client.provisioning.removeTeamMember({
678
+ * "x-provisioning-key": "x-provisioning-key",
670
679
  * handle: "handle",
671
680
  * email: "email"
672
681
  * })
@@ -676,23 +685,22 @@ export class ProvisioningClient {
676
685
  }
677
686
  __removeTeamMember(request, requestOptions) {
678
687
  return __awaiter(this, void 0, void 0, function* () {
679
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
688
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
689
+ const { "x-provisioning-key": provisioningKey } = request, _body = __rest(request, ["x-provisioning-key"]);
680
690
  const _authRequest = yield this._options.authProvider.getAuthRequest();
681
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
682
- "x-provisioning-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.provisioningKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.provisioningKey,
683
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
684
- const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
685
- url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "instances/team"),
691
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
692
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
693
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances/team"),
686
694
  method: "DELETE",
687
695
  headers: _headers,
688
696
  contentType: "application/json",
689
697
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
690
698
  requestType: "json",
691
- body: request,
692
- timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
693
- maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
699
+ body: _body,
700
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
701
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
694
702
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
695
- fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
703
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
696
704
  logging: this._options.logging,
697
705
  });
698
706
  if (_response.ok) {
@@ -719,7 +727,7 @@ export class ProvisioningClient {
719
727
  });
720
728
  }
721
729
  }
722
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/instances/team");
730
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/provisioning/instances/team");
723
731
  });
724
732
  }
725
733
  /**
@@ -734,6 +742,7 @@ export class ProvisioningClient {
734
742
  *
735
743
  * @example
736
744
  * await client.provisioning.listDomains({
745
+ * "x-provisioning-key": "x-provisioning-key",
737
746
  * handle: "handle"
738
747
  * })
739
748
  */
@@ -742,24 +751,22 @@ export class ProvisioningClient {
742
751
  }
743
752
  __listDomains(request, requestOptions) {
744
753
  return __awaiter(this, void 0, void 0, function* () {
745
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
746
- const { handle } = request;
754
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
755
+ const { handle, "x-provisioning-key": provisioningKey } = request;
747
756
  const _queryParams = {
748
757
  handle,
749
758
  };
750
759
  const _authRequest = yield this._options.authProvider.getAuthRequest();
751
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
752
- "x-provisioning-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.provisioningKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.provisioningKey,
753
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
754
- const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
755
- url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "instances/domains"),
760
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
761
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
762
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances/domains"),
756
763
  method: "GET",
757
764
  headers: _headers,
758
765
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
759
- timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
760
- maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
766
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
767
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
761
768
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
762
- fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
769
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
763
770
  logging: this._options.logging,
764
771
  });
765
772
  if (_response.ok) {
@@ -784,7 +791,7 @@ export class ProvisioningClient {
784
791
  });
785
792
  }
786
793
  }
787
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/instances/domains");
794
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/provisioning/instances/domains");
788
795
  });
789
796
  }
790
797
  /**
@@ -800,6 +807,7 @@ export class ProvisioningClient {
800
807
  *
801
808
  * @example
802
809
  * await client.provisioning.addDomain({
810
+ * "x-provisioning-key": "x-provisioning-key",
803
811
  * handle: "handle",
804
812
  * name: "name"
805
813
  * })
@@ -809,23 +817,22 @@ export class ProvisioningClient {
809
817
  }
810
818
  __addDomain(request, requestOptions) {
811
819
  return __awaiter(this, void 0, void 0, function* () {
812
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
820
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
821
+ const { "x-provisioning-key": provisioningKey } = request, _body = __rest(request, ["x-provisioning-key"]);
813
822
  const _authRequest = yield this._options.authProvider.getAuthRequest();
814
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
815
- "x-provisioning-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.provisioningKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.provisioningKey,
816
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
817
- const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
818
- url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "instances/domains"),
823
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
824
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
825
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances/domains"),
819
826
  method: "POST",
820
827
  headers: _headers,
821
828
  contentType: "application/json",
822
829
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
823
830
  requestType: "json",
824
- body: request,
825
- timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
826
- maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
831
+ body: _body,
832
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
833
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
827
834
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
828
- fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
835
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
829
836
  logging: this._options.logging,
830
837
  });
831
838
  if (_response.ok) {
@@ -849,7 +856,7 @@ export class ProvisioningClient {
849
856
  });
850
857
  }
851
858
  }
852
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/instances/domains");
859
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/provisioning/instances/domains");
853
860
  });
854
861
  }
855
862
  /**
@@ -865,6 +872,7 @@ export class ProvisioningClient {
865
872
  *
866
873
  * @example
867
874
  * await client.provisioning.removeDomain({
875
+ * "x-provisioning-key": "x-provisioning-key",
868
876
  * handle: "handle",
869
877
  * name: "name"
870
878
  * })
@@ -874,23 +882,22 @@ export class ProvisioningClient {
874
882
  }
875
883
  __removeDomain(request, requestOptions) {
876
884
  return __awaiter(this, void 0, void 0, function* () {
877
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
885
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
886
+ const { "x-provisioning-key": provisioningKey } = request, _body = __rest(request, ["x-provisioning-key"]);
878
887
  const _authRequest = yield this._options.authProvider.getAuthRequest();
879
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
880
- "x-provisioning-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.provisioningKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.provisioningKey,
881
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
882
- const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
883
- url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "instances/domains"),
888
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
889
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
890
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances/domains"),
884
891
  method: "DELETE",
885
892
  headers: _headers,
886
893
  contentType: "application/json",
887
894
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
888
895
  requestType: "json",
889
- body: request,
890
- timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
891
- maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
896
+ body: _body,
897
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
898
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
892
899
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
893
- fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
900
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
894
901
  logging: this._options.logging,
895
902
  });
896
903
  if (_response.ok) {
@@ -917,7 +924,7 @@ export class ProvisioningClient {
917
924
  });
918
925
  }
919
926
  }
920
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/instances/domains");
927
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/provisioning/instances/domains");
921
928
  });
922
929
  }
923
930
  /**
@@ -932,6 +939,7 @@ export class ProvisioningClient {
932
939
  *
933
940
  * @example
934
941
  * await client.provisioning.exportData({
942
+ * "x-provisioning-key": "x-provisioning-key",
935
943
  * handle: "handle"
936
944
  * })
937
945
  */
@@ -940,23 +948,22 @@ export class ProvisioningClient {
940
948
  }
941
949
  __exportData(request, requestOptions) {
942
950
  return __awaiter(this, void 0, void 0, function* () {
943
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
951
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
952
+ const { "x-provisioning-key": provisioningKey } = request, _body = __rest(request, ["x-provisioning-key"]);
944
953
  const _authRequest = yield this._options.authProvider.getAuthRequest();
945
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
946
- "x-provisioning-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.provisioningKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.provisioningKey,
947
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
948
- const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
949
- url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "instances/export"),
954
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
955
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
956
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances/export"),
950
957
  method: "POST",
951
958
  headers: _headers,
952
959
  contentType: "application/json",
953
960
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
954
961
  requestType: "json",
955
- body: request,
956
- timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
957
- maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
962
+ body: _body,
963
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
964
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
958
965
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
959
- fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
966
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
960
967
  logging: this._options.logging,
961
968
  });
962
969
  if (_response.ok) {
@@ -978,7 +985,7 @@ export class ProvisioningClient {
978
985
  });
979
986
  }
980
987
  }
981
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/instances/export");
988
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/provisioning/instances/export");
982
989
  });
983
990
  }
984
991
  /**
@@ -993,6 +1000,7 @@ export class ProvisioningClient {
993
1000
  *
994
1001
  * @example
995
1002
  * await client.provisioning.listWebhooks({
1003
+ * "x-provisioning-key": "x-provisioning-key",
996
1004
  * handle: "handle"
997
1005
  * })
998
1006
  */
@@ -1001,24 +1009,22 @@ export class ProvisioningClient {
1001
1009
  }
1002
1010
  __listWebhooks(request, requestOptions) {
1003
1011
  return __awaiter(this, void 0, void 0, function* () {
1004
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1005
- const { handle } = request;
1012
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1013
+ const { handle, "x-provisioning-key": provisioningKey } = request;
1006
1014
  const _queryParams = {
1007
1015
  handle,
1008
1016
  };
1009
1017
  const _authRequest = yield this._options.authProvider.getAuthRequest();
1010
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
1011
- "x-provisioning-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.provisioningKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.provisioningKey,
1012
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1013
- const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
1014
- url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "instances/webhooks"),
1018
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1019
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1020
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances/webhooks"),
1015
1021
  method: "GET",
1016
1022
  headers: _headers,
1017
1023
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
1018
- timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
1019
- maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
1024
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
1025
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
1020
1026
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1021
- fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
1027
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
1022
1028
  logging: this._options.logging,
1023
1029
  });
1024
1030
  if (_response.ok) {
@@ -1043,7 +1049,7 @@ export class ProvisioningClient {
1043
1049
  });
1044
1050
  }
1045
1051
  }
1046
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/instances/webhooks");
1052
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/provisioning/instances/webhooks");
1047
1053
  });
1048
1054
  }
1049
1055
  /**
@@ -1059,6 +1065,7 @@ export class ProvisioningClient {
1059
1065
  *
1060
1066
  * @example
1061
1067
  * await client.provisioning.createWebhook({
1068
+ * "x-provisioning-key": "x-provisioning-key",
1062
1069
  * handle: "handle",
1063
1070
  * url: "url",
1064
1071
  * events: ["events"]
@@ -1069,23 +1076,22 @@ export class ProvisioningClient {
1069
1076
  }
1070
1077
  __createWebhook(request, requestOptions) {
1071
1078
  return __awaiter(this, void 0, void 0, function* () {
1072
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1079
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1080
+ const { "x-provisioning-key": provisioningKey } = request, _body = __rest(request, ["x-provisioning-key"]);
1073
1081
  const _authRequest = yield this._options.authProvider.getAuthRequest();
1074
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
1075
- "x-provisioning-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.provisioningKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.provisioningKey,
1076
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1077
- const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
1078
- url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "instances/webhooks"),
1082
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1083
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1084
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances/webhooks"),
1079
1085
  method: "POST",
1080
1086
  headers: _headers,
1081
1087
  contentType: "application/json",
1082
1088
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1083
1089
  requestType: "json",
1084
- body: request,
1085
- timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
1086
- maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
1090
+ body: _body,
1091
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
1092
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
1087
1093
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1088
- fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
1094
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
1089
1095
  logging: this._options.logging,
1090
1096
  });
1091
1097
  if (_response.ok) {
@@ -1112,7 +1118,7 @@ export class ProvisioningClient {
1112
1118
  });
1113
1119
  }
1114
1120
  }
1115
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/instances/webhooks");
1121
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/provisioning/instances/webhooks");
1116
1122
  });
1117
1123
  }
1118
1124
  /**
@@ -1128,6 +1134,7 @@ export class ProvisioningClient {
1128
1134
  *
1129
1135
  * @example
1130
1136
  * await client.provisioning.updateWebhook({
1137
+ * "x-provisioning-key": "x-provisioning-key",
1131
1138
  * handle: "handle",
1132
1139
  * webhookId: "webhookId"
1133
1140
  * })
@@ -1137,23 +1144,22 @@ export class ProvisioningClient {
1137
1144
  }
1138
1145
  __updateWebhook(request, requestOptions) {
1139
1146
  return __awaiter(this, void 0, void 0, function* () {
1140
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1147
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1148
+ const { "x-provisioning-key": provisioningKey } = request, _body = __rest(request, ["x-provisioning-key"]);
1141
1149
  const _authRequest = yield this._options.authProvider.getAuthRequest();
1142
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
1143
- "x-provisioning-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.provisioningKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.provisioningKey,
1144
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1145
- const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
1146
- url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "instances/webhooks"),
1150
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1151
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1152
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances/webhooks"),
1147
1153
  method: "PUT",
1148
1154
  headers: _headers,
1149
1155
  contentType: "application/json",
1150
1156
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1151
1157
  requestType: "json",
1152
- body: request,
1153
- timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
1154
- maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
1158
+ body: _body,
1159
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
1160
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
1155
1161
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1156
- fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
1162
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
1157
1163
  logging: this._options.logging,
1158
1164
  });
1159
1165
  if (_response.ok) {
@@ -1180,7 +1186,7 @@ export class ProvisioningClient {
1180
1186
  });
1181
1187
  }
1182
1188
  }
1183
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/instances/webhooks");
1189
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/provisioning/instances/webhooks");
1184
1190
  });
1185
1191
  }
1186
1192
  /**
@@ -1196,6 +1202,7 @@ export class ProvisioningClient {
1196
1202
  *
1197
1203
  * @example
1198
1204
  * await client.provisioning.deleteWebhook({
1205
+ * "x-provisioning-key": "x-provisioning-key",
1199
1206
  * handle: "handle",
1200
1207
  * webhookId: "webhookId"
1201
1208
  * })
@@ -1205,23 +1212,157 @@ export class ProvisioningClient {
1205
1212
  }
1206
1213
  __deleteWebhook(request, requestOptions) {
1207
1214
  return __awaiter(this, void 0, void 0, function* () {
1208
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1215
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1216
+ const { "x-provisioning-key": provisioningKey } = request, _body = __rest(request, ["x-provisioning-key"]);
1209
1217
  const _authRequest = yield this._options.authProvider.getAuthRequest();
1210
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
1211
- "x-provisioning-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.provisioningKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.provisioningKey,
1212
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1213
- const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
1214
- url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ForumEnvironment.Production, "instances/webhooks"),
1218
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1219
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1220
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances/webhooks"),
1215
1221
  method: "DELETE",
1216
1222
  headers: _headers,
1217
1223
  contentType: "application/json",
1218
1224
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1219
1225
  requestType: "json",
1220
- body: request,
1221
- timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
1222
- maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
1226
+ body: _body,
1227
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
1228
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
1229
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1230
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
1231
+ logging: this._options.logging,
1232
+ });
1233
+ if (_response.ok) {
1234
+ return {
1235
+ data: _response.body,
1236
+ rawResponse: _response.rawResponse,
1237
+ };
1238
+ }
1239
+ if (_response.error.reason === "status-code") {
1240
+ switch (_response.error.statusCode) {
1241
+ case 400:
1242
+ throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
1243
+ case 401:
1244
+ throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
1245
+ case 404:
1246
+ throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
1247
+ case 500:
1248
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
1249
+ default:
1250
+ throw new errors.ForumError({
1251
+ statusCode: _response.error.statusCode,
1252
+ body: _response.error.body,
1253
+ rawResponse: _response.rawResponse,
1254
+ });
1255
+ }
1256
+ }
1257
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/provisioning/instances/webhooks");
1258
+ });
1259
+ }
1260
+ /**
1261
+ * Retrieve owner and creator information for an instance.
1262
+ *
1263
+ * @param {Forum.GetOwnershipProvisioningRequest} request
1264
+ * @param {ProvisioningClient.RequestOptions} requestOptions - Request-specific configuration.
1265
+ *
1266
+ * @throws {@link Forum.UnauthorizedError}
1267
+ * @throws {@link Forum.ForbiddenError}
1268
+ * @throws {@link Forum.NotFoundError}
1269
+ * @throws {@link Forum.InternalServerError}
1270
+ *
1271
+ * @example
1272
+ * await client.provisioning.getOwnership({
1273
+ * "x-provisioning-key": "x-provisioning-key",
1274
+ * handle: "handle"
1275
+ * })
1276
+ */
1277
+ getOwnership(request, requestOptions) {
1278
+ return core.HttpResponsePromise.fromPromise(this.__getOwnership(request, requestOptions));
1279
+ }
1280
+ __getOwnership(request, requestOptions) {
1281
+ return __awaiter(this, void 0, void 0, function* () {
1282
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1283
+ const { handle, "x-provisioning-key": provisioningKey } = request;
1284
+ const _queryParams = {
1285
+ handle,
1286
+ };
1287
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1288
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1289
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1290
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances/ownership"),
1291
+ method: "GET",
1292
+ headers: _headers,
1293
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
1294
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
1295
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
1296
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1297
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
1298
+ logging: this._options.logging,
1299
+ });
1300
+ if (_response.ok) {
1301
+ return {
1302
+ data: _response.body,
1303
+ rawResponse: _response.rawResponse,
1304
+ };
1305
+ }
1306
+ if (_response.error.reason === "status-code") {
1307
+ switch (_response.error.statusCode) {
1308
+ case 401:
1309
+ throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
1310
+ case 403:
1311
+ throw new Forum.ForbiddenError(_response.error.body, _response.rawResponse);
1312
+ case 404:
1313
+ throw new Forum.NotFoundError(_response.error.body, _response.rawResponse);
1314
+ case 500:
1315
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
1316
+ default:
1317
+ throw new errors.ForumError({
1318
+ statusCode: _response.error.statusCode,
1319
+ body: _response.error.body,
1320
+ rawResponse: _response.rawResponse,
1321
+ });
1322
+ }
1323
+ }
1324
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/provisioning/instances/ownership");
1325
+ });
1326
+ }
1327
+ /**
1328
+ * Transfer instance ownership to another user. Only the current owner can transfer ownership.
1329
+ *
1330
+ * @param {Forum.TransferOwnershipProvisioningRequest} request
1331
+ * @param {ProvisioningClient.RequestOptions} requestOptions - Request-specific configuration.
1332
+ *
1333
+ * @throws {@link Forum.BadRequestError}
1334
+ * @throws {@link Forum.UnauthorizedError}
1335
+ * @throws {@link Forum.NotFoundError}
1336
+ * @throws {@link Forum.InternalServerError}
1337
+ *
1338
+ * @example
1339
+ * await client.provisioning.transferOwnership({
1340
+ * "x-provisioning-key": "x-provisioning-key",
1341
+ * handle: "handle",
1342
+ * newOwnerEmail: "newOwnerEmail"
1343
+ * })
1344
+ */
1345
+ transferOwnership(request, requestOptions) {
1346
+ return core.HttpResponsePromise.fromPromise(this.__transferOwnership(request, requestOptions));
1347
+ }
1348
+ __transferOwnership(request, requestOptions) {
1349
+ return __awaiter(this, void 0, void 0, function* () {
1350
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1351
+ const { "x-provisioning-key": provisioningKey } = request, _body = __rest(request, ["x-provisioning-key"]);
1352
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1353
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-provisioning-key": provisioningKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1354
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1355
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/instances/ownership"),
1356
+ method: "POST",
1357
+ headers: _headers,
1358
+ contentType: "application/json",
1359
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1360
+ requestType: "json",
1361
+ body: _body,
1362
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
1363
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
1223
1364
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1224
- fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
1365
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
1225
1366
  logging: this._options.logging,
1226
1367
  });
1227
1368
  if (_response.ok) {
@@ -1248,7 +1389,124 @@ export class ProvisioningClient {
1248
1389
  });
1249
1390
  }
1250
1391
  }
1251
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/instances/webhooks");
1392
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/provisioning/instances/ownership");
1393
+ });
1394
+ }
1395
+ /**
1396
+ * Create a new account and receive a provisioning key for API access. Use this key to create and manage instances.
1397
+ *
1398
+ * @param {Forum.RegisterProvisioningRequest} request
1399
+ * @param {ProvisioningClient.RequestOptions} requestOptions - Request-specific configuration.
1400
+ *
1401
+ * @throws {@link Forum.BadRequestError}
1402
+ * @throws {@link Forum.ConflictError}
1403
+ * @throws {@link Forum.InternalServerError}
1404
+ *
1405
+ * @example
1406
+ * await client.provisioning.register({
1407
+ * email: "email",
1408
+ * password: "password"
1409
+ * })
1410
+ */
1411
+ register(request, requestOptions) {
1412
+ return core.HttpResponsePromise.fromPromise(this.__register(request, requestOptions));
1413
+ }
1414
+ __register(request, requestOptions) {
1415
+ return __awaiter(this, void 0, void 0, function* () {
1416
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1417
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1418
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1419
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1420
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/register"),
1421
+ method: "POST",
1422
+ headers: _headers,
1423
+ contentType: "application/json",
1424
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1425
+ requestType: "json",
1426
+ body: request,
1427
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
1428
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
1429
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1430
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
1431
+ logging: this._options.logging,
1432
+ });
1433
+ if (_response.ok) {
1434
+ return { data: _response.body, rawResponse: _response.rawResponse };
1435
+ }
1436
+ if (_response.error.reason === "status-code") {
1437
+ switch (_response.error.statusCode) {
1438
+ case 400:
1439
+ throw new Forum.BadRequestError(_response.error.body, _response.rawResponse);
1440
+ case 409:
1441
+ throw new Forum.ConflictError(_response.error.body, _response.rawResponse);
1442
+ case 500:
1443
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
1444
+ default:
1445
+ throw new errors.ForumError({
1446
+ statusCode: _response.error.statusCode,
1447
+ body: _response.error.body,
1448
+ rawResponse: _response.rawResponse,
1449
+ });
1450
+ }
1451
+ }
1452
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/provisioning/register");
1453
+ });
1454
+ }
1455
+ /**
1456
+ * Login with email and password to retrieve your provisioning key.
1457
+ *
1458
+ * @param {Forum.LoginProvisioningRequest} request
1459
+ * @param {ProvisioningClient.RequestOptions} requestOptions - Request-specific configuration.
1460
+ *
1461
+ * @throws {@link Forum.UnauthorizedError}
1462
+ * @throws {@link Forum.InternalServerError}
1463
+ *
1464
+ * @example
1465
+ * await client.provisioning.login({
1466
+ * email: "email",
1467
+ * password: "password"
1468
+ * })
1469
+ */
1470
+ login(request, requestOptions) {
1471
+ return core.HttpResponsePromise.fromPromise(this.__login(request, requestOptions));
1472
+ }
1473
+ __login(request, requestOptions) {
1474
+ return __awaiter(this, void 0, void 0, function* () {
1475
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1476
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1477
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1478
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1479
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ForumEnvironment.Production, "provisioning/login"),
1480
+ method: "POST",
1481
+ headers: _headers,
1482
+ contentType: "application/json",
1483
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1484
+ requestType: "json",
1485
+ body: request,
1486
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
1487
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
1488
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1489
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
1490
+ logging: this._options.logging,
1491
+ });
1492
+ if (_response.ok) {
1493
+ return { data: _response.body, rawResponse: _response.rawResponse };
1494
+ }
1495
+ if (_response.error.reason === "status-code") {
1496
+ switch (_response.error.statusCode) {
1497
+ case 401:
1498
+ throw new Forum.UnauthorizedError(_response.error.body, _response.rawResponse);
1499
+ case 500:
1500
+ throw new Forum.InternalServerError(_response.error.body, _response.rawResponse);
1501
+ default:
1502
+ throw new errors.ForumError({
1503
+ statusCode: _response.error.statusCode,
1504
+ body: _response.error.body,
1505
+ rawResponse: _response.rawResponse,
1506
+ });
1507
+ }
1508
+ }
1509
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/provisioning/login");
1252
1510
  });
1253
1511
  }
1254
1512
  }