@emilgroup/notification-sdk-node 1.0.0-beta.0

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 (100) hide show
  1. package/.openapi-generator/FILES +38 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +68 -0
  5. package/api/layouts-api.ts +663 -0
  6. package/api/notification-templates-api.ts +677 -0
  7. package/api/notifications-api.ts +165 -0
  8. package/api.ts +35 -0
  9. package/base.ts +284 -0
  10. package/common.ts +199 -0
  11. package/configuration.ts +109 -0
  12. package/dist/api/layouts-api.d.ts +364 -0
  13. package/dist/api/layouts-api.js +622 -0
  14. package/dist/api/notification-templates-api.d.ts +373 -0
  15. package/dist/api/notification-templates-api.js +628 -0
  16. package/dist/api/notifications-api.d.ts +93 -0
  17. package/dist/api/notifications-api.js +224 -0
  18. package/dist/api.d.ts +14 -0
  19. package/dist/api.js +32 -0
  20. package/dist/base.d.ts +77 -0
  21. package/dist/base.js +393 -0
  22. package/dist/common.d.ts +92 -0
  23. package/dist/common.js +277 -0
  24. package/dist/configuration.d.ts +90 -0
  25. package/dist/configuration.js +44 -0
  26. package/dist/index.d.ts +15 -0
  27. package/dist/index.js +36 -0
  28. package/dist/models/create-layout-request-dto.d.ts +48 -0
  29. package/dist/models/create-layout-request-dto.js +15 -0
  30. package/dist/models/create-layout-response-class.d.ts +25 -0
  31. package/dist/models/create-layout-response-class.js +15 -0
  32. package/dist/models/create-notification-template-request-dto.d.ts +66 -0
  33. package/dist/models/create-notification-template-request-dto.js +15 -0
  34. package/dist/models/create-notification-template-response-class.d.ts +25 -0
  35. package/dist/models/create-notification-template-response-class.js +15 -0
  36. package/dist/models/delete-layout-request-dto.d.ts +24 -0
  37. package/dist/models/delete-layout-request-dto.js +15 -0
  38. package/dist/models/delete-notification-template-request-dto.d.ts +24 -0
  39. package/dist/models/delete-notification-template-request-dto.js +15 -0
  40. package/dist/models/get-layout-request-dto.d.ts +24 -0
  41. package/dist/models/get-layout-request-dto.js +15 -0
  42. package/dist/models/get-layout-response-class.d.ts +25 -0
  43. package/dist/models/get-layout-response-class.js +15 -0
  44. package/dist/models/get-notification-template-request-dto.d.ts +30 -0
  45. package/dist/models/get-notification-template-request-dto.js +15 -0
  46. package/dist/models/get-notification-template-response-class.d.ts +25 -0
  47. package/dist/models/get-notification-template-response-class.js +15 -0
  48. package/dist/models/html-template-class.d.ts +60 -0
  49. package/dist/models/html-template-class.js +15 -0
  50. package/dist/models/index.d.ts +22 -0
  51. package/dist/models/index.js +38 -0
  52. package/dist/models/layout-class.d.ts +73 -0
  53. package/dist/models/layout-class.js +15 -0
  54. package/dist/models/list-layouts-response-class.d.ts +30 -0
  55. package/dist/models/list-layouts-response-class.js +15 -0
  56. package/dist/models/list-notification-templates-response-class.d.ts +30 -0
  57. package/dist/models/list-notification-templates-response-class.js +15 -0
  58. package/dist/models/notification-template-class.d.ts +98 -0
  59. package/dist/models/notification-template-class.js +15 -0
  60. package/dist/models/send-notification-request-dto.d.ts +66 -0
  61. package/dist/models/send-notification-request-dto.js +15 -0
  62. package/dist/models/send-notification-response-class.d.ts +24 -0
  63. package/dist/models/send-notification-response-class.js +15 -0
  64. package/dist/models/update-html-template-request-dto.d.ts +42 -0
  65. package/dist/models/update-html-template-request-dto.js +21 -0
  66. package/dist/models/update-layout-request-dto.d.ts +55 -0
  67. package/dist/models/update-layout-request-dto.js +15 -0
  68. package/dist/models/update-layout-response-class.d.ts +25 -0
  69. package/dist/models/update-layout-response-class.js +15 -0
  70. package/dist/models/update-notification-template-request-dto.d.ts +73 -0
  71. package/dist/models/update-notification-template-request-dto.js +15 -0
  72. package/dist/models/update-notification-template-response-class.d.ts +25 -0
  73. package/dist/models/update-notification-template-response-class.js +15 -0
  74. package/git_push.sh +57 -0
  75. package/index.ts +19 -0
  76. package/models/create-layout-request-dto.ts +54 -0
  77. package/models/create-layout-response-class.ts +31 -0
  78. package/models/create-notification-template-request-dto.ts +72 -0
  79. package/models/create-notification-template-response-class.ts +31 -0
  80. package/models/delete-layout-request-dto.ts +30 -0
  81. package/models/delete-notification-template-request-dto.ts +30 -0
  82. package/models/get-layout-request-dto.ts +30 -0
  83. package/models/get-layout-response-class.ts +31 -0
  84. package/models/get-notification-template-request-dto.ts +36 -0
  85. package/models/get-notification-template-response-class.ts +31 -0
  86. package/models/html-template-class.ts +66 -0
  87. package/models/index.ts +22 -0
  88. package/models/layout-class.ts +79 -0
  89. package/models/list-layouts-response-class.ts +36 -0
  90. package/models/list-notification-templates-response-class.ts +36 -0
  91. package/models/notification-template-class.ts +104 -0
  92. package/models/send-notification-request-dto.ts +72 -0
  93. package/models/send-notification-response-class.ts +30 -0
  94. package/models/update-html-template-request-dto.ts +51 -0
  95. package/models/update-layout-request-dto.ts +61 -0
  96. package/models/update-layout-response-class.ts +31 -0
  97. package/models/update-notification-template-request-dto.ts +79 -0
  98. package/models/update-notification-template-response-class.ts +31 -0
  99. package/package.json +29 -0
  100. package/tsconfig.json +22 -0
@@ -0,0 +1,628 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * EMIL NotificationService
6
+ * The EMIL NotificationService API description
7
+ *
8
+ * The version of the OpenAPI document: 1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __extends = (this && this.__extends) || (function () {
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
22
+ return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
30
+ var __assign = (this && this.__assign) || function () {
31
+ __assign = Object.assign || function(t) {
32
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
33
+ s = arguments[i];
34
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
35
+ t[p] = s[p];
36
+ }
37
+ return t;
38
+ };
39
+ return __assign.apply(this, arguments);
40
+ };
41
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
42
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
43
+ return new (P || (P = Promise))(function (resolve, reject) {
44
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
45
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
46
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
47
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
48
+ });
49
+ };
50
+ var __generator = (this && this.__generator) || function (thisArg, body) {
51
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
52
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
+ function verb(n) { return function (v) { return step([n, v]); }; }
54
+ function step(op) {
55
+ if (f) throw new TypeError("Generator is already executing.");
56
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
57
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
58
+ if (y = 0, t) op = [op[0] & 2, t.value];
59
+ switch (op[0]) {
60
+ case 0: case 1: t = op; break;
61
+ case 4: _.label++; return { value: op[1], done: false };
62
+ case 5: _.label++; y = op[1]; op = [0]; continue;
63
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
64
+ default:
65
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
66
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
67
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
68
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
69
+ if (t[2]) _.ops.pop();
70
+ _.trys.pop(); continue;
71
+ }
72
+ op = body.call(thisArg, _);
73
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
74
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
+ }
76
+ };
77
+ var __importDefault = (this && this.__importDefault) || function (mod) {
78
+ return (mod && mod.__esModule) ? mod : { "default": mod };
79
+ };
80
+ Object.defineProperty(exports, "__esModule", { value: true });
81
+ exports.NotificationTemplatesApi = exports.NotificationTemplatesApiFactory = exports.NotificationTemplatesApiFp = exports.NotificationTemplatesApiAxiosParamCreator = void 0;
82
+ var axios_1 = __importDefault(require("axios"));
83
+ // Some imports not used depending on template conditions
84
+ // @ts-ignore
85
+ var common_1 = require("../common");
86
+ // @ts-ignore
87
+ var base_1 = require("../base");
88
+ // URLSearchParams not necessarily used
89
+ // @ts-ignore
90
+ var url_1 = require("url");
91
+ var FormData = require('form-data');
92
+ /**
93
+ * NotificationTemplatesApi - axios parameter creator
94
+ * @export
95
+ */
96
+ var NotificationTemplatesApiAxiosParamCreator = function (configuration) {
97
+ var _this = this;
98
+ return {
99
+ /**
100
+ *
101
+ * @param {CreateNotificationTemplateRequestDto} createNotificationTemplateRequestDto
102
+ * @param {string} [authorization] Bearer Token
103
+ * @param {*} [options] Override http request option.
104
+ * @throws {RequiredError}
105
+ */
106
+ createNotificationTemplate: function (createNotificationTemplateRequestDto, authorization, options) {
107
+ if (options === void 0) { options = {}; }
108
+ return __awaiter(_this, void 0, void 0, function () {
109
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
110
+ return __generator(this, function (_a) {
111
+ switch (_a.label) {
112
+ case 0:
113
+ // verify required parameter 'createNotificationTemplateRequestDto' is not null or undefined
114
+ (0, common_1.assertParamExists)('createNotificationTemplate', 'createNotificationTemplateRequestDto', createNotificationTemplateRequestDto);
115
+ localVarPath = "/notificationservice/v1/notification-templates";
116
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
117
+ if (configuration) {
118
+ baseOptions = configuration.baseOptions;
119
+ baseAccessToken = configuration.accessToken;
120
+ }
121
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
122
+ localVarHeaderParameter = {};
123
+ localVarQueryParameter = {};
124
+ // authentication bearer required
125
+ // http bearer authentication required
126
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
127
+ case 1:
128
+ // authentication bearer required
129
+ // http bearer authentication required
130
+ _a.sent();
131
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
132
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
133
+ }
134
+ localVarHeaderParameter['Content-Type'] = 'application/json';
135
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
136
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
137
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
138
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createNotificationTemplateRequestDto, localVarRequestOptions, configuration);
139
+ return [2 /*return*/, {
140
+ url: (0, common_1.toPathString)(localVarUrlObj),
141
+ options: localVarRequestOptions,
142
+ }];
143
+ }
144
+ });
145
+ });
146
+ },
147
+ /**
148
+ *
149
+ * @param {number} id
150
+ * @param {string} [authorization] Bearer Token
151
+ * @param {*} [options] Override http request option.
152
+ * @throws {RequiredError}
153
+ */
154
+ deleteNotificationTemplate: function (id, authorization, options) {
155
+ if (options === void 0) { options = {}; }
156
+ return __awaiter(_this, void 0, void 0, function () {
157
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
158
+ return __generator(this, function (_a) {
159
+ switch (_a.label) {
160
+ case 0:
161
+ // verify required parameter 'id' is not null or undefined
162
+ (0, common_1.assertParamExists)('deleteNotificationTemplate', 'id', id);
163
+ localVarPath = "/notificationservice/v1/notification-templates/{id}"
164
+ .replace("{".concat("id", "}"), encodeURIComponent(String(id)));
165
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
166
+ if (configuration) {
167
+ baseOptions = configuration.baseOptions;
168
+ baseAccessToken = configuration.accessToken;
169
+ }
170
+ localVarRequestOptions = __assign(__assign({ method: 'DELETE' }, baseOptions), options);
171
+ localVarHeaderParameter = {};
172
+ localVarQueryParameter = {};
173
+ // authentication bearer required
174
+ // http bearer authentication required
175
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
176
+ case 1:
177
+ // authentication bearer required
178
+ // http bearer authentication required
179
+ _a.sent();
180
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
181
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
182
+ }
183
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
184
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
185
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
186
+ return [2 /*return*/, {
187
+ url: (0, common_1.toPathString)(localVarUrlObj),
188
+ options: localVarRequestOptions,
189
+ }];
190
+ }
191
+ });
192
+ });
193
+ },
194
+ /**
195
+ *
196
+ * @param {number} id
197
+ * @param {number} id2
198
+ * @param {string} [authorization] Bearer Token
199
+ * @param {string} [expand]
200
+ * @param {*} [options] Override http request option.
201
+ * @throws {RequiredError}
202
+ */
203
+ getNotificationTemplate: function (id, id2, authorization, expand, options) {
204
+ if (options === void 0) { options = {}; }
205
+ return __awaiter(_this, void 0, void 0, function () {
206
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
207
+ return __generator(this, function (_a) {
208
+ switch (_a.label) {
209
+ case 0:
210
+ // verify required parameter 'id' is not null or undefined
211
+ (0, common_1.assertParamExists)('getNotificationTemplate', 'id', id);
212
+ // verify required parameter 'id2' is not null or undefined
213
+ (0, common_1.assertParamExists)('getNotificationTemplate', 'id2', id2);
214
+ localVarPath = "/notificationservice/v1/notification-templates/{id}"
215
+ .replace("{".concat("id", "}"), encodeURIComponent(String(id)));
216
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
217
+ if (configuration) {
218
+ baseOptions = configuration.baseOptions;
219
+ baseAccessToken = configuration.accessToken;
220
+ }
221
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
222
+ localVarHeaderParameter = {};
223
+ localVarQueryParameter = {};
224
+ // authentication bearer required
225
+ // http bearer authentication required
226
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
227
+ case 1:
228
+ // authentication bearer required
229
+ // http bearer authentication required
230
+ _a.sent();
231
+ if (id2 !== undefined) {
232
+ localVarQueryParameter['id'] = id2;
233
+ }
234
+ if (expand !== undefined) {
235
+ localVarQueryParameter['expand'] = expand;
236
+ }
237
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
238
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
239
+ }
240
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
241
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
242
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
243
+ return [2 /*return*/, {
244
+ url: (0, common_1.toPathString)(localVarUrlObj),
245
+ options: localVarRequestOptions,
246
+ }];
247
+ }
248
+ });
249
+ });
250
+ },
251
+ /**
252
+ *
253
+ * @param {string} [authorization] Bearer Token
254
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
255
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
256
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
257
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
258
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
259
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
260
+ * @param {*} [options] Override http request option.
261
+ * @throws {RequiredError}
262
+ */
263
+ listNotificationTemplates: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
264
+ if (options === void 0) { options = {}; }
265
+ return __awaiter(_this, void 0, void 0, function () {
266
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
267
+ return __generator(this, function (_a) {
268
+ switch (_a.label) {
269
+ case 0:
270
+ localVarPath = "/notificationservice/v1/notification-templates";
271
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
272
+ if (configuration) {
273
+ baseOptions = configuration.baseOptions;
274
+ baseAccessToken = configuration.accessToken;
275
+ }
276
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
277
+ localVarHeaderParameter = {};
278
+ localVarQueryParameter = {};
279
+ // authentication bearer required
280
+ // http bearer authentication required
281
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
282
+ case 1:
283
+ // authentication bearer required
284
+ // http bearer authentication required
285
+ _a.sent();
286
+ if (pageSize !== undefined) {
287
+ localVarQueryParameter['pageSize'] = pageSize;
288
+ }
289
+ if (pageToken !== undefined) {
290
+ localVarQueryParameter['pageToken'] = pageToken;
291
+ }
292
+ if (filter !== undefined) {
293
+ localVarQueryParameter['filter'] = filter;
294
+ }
295
+ if (search !== undefined) {
296
+ localVarQueryParameter['search'] = search;
297
+ }
298
+ if (order !== undefined) {
299
+ localVarQueryParameter['order'] = order;
300
+ }
301
+ if (expand !== undefined) {
302
+ localVarQueryParameter['expand'] = expand;
303
+ }
304
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
305
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
306
+ }
307
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
308
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
309
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
310
+ return [2 /*return*/, {
311
+ url: (0, common_1.toPathString)(localVarUrlObj),
312
+ options: localVarRequestOptions,
313
+ }];
314
+ }
315
+ });
316
+ });
317
+ },
318
+ /**
319
+ *
320
+ * @param {number} id
321
+ * @param {UpdateNotificationTemplateRequestDto} updateNotificationTemplateRequestDto
322
+ * @param {string} [authorization] Bearer Token
323
+ * @param {*} [options] Override http request option.
324
+ * @throws {RequiredError}
325
+ */
326
+ updateNotificationTemplate: function (id, updateNotificationTemplateRequestDto, authorization, options) {
327
+ if (options === void 0) { options = {}; }
328
+ return __awaiter(_this, void 0, void 0, function () {
329
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
330
+ return __generator(this, function (_a) {
331
+ switch (_a.label) {
332
+ case 0:
333
+ // verify required parameter 'id' is not null or undefined
334
+ (0, common_1.assertParamExists)('updateNotificationTemplate', 'id', id);
335
+ // verify required parameter 'updateNotificationTemplateRequestDto' is not null or undefined
336
+ (0, common_1.assertParamExists)('updateNotificationTemplate', 'updateNotificationTemplateRequestDto', updateNotificationTemplateRequestDto);
337
+ localVarPath = "/notificationservice/v1/notification-templates/{id}"
338
+ .replace("{".concat("id", "}"), encodeURIComponent(String(id)));
339
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
340
+ if (configuration) {
341
+ baseOptions = configuration.baseOptions;
342
+ baseAccessToken = configuration.accessToken;
343
+ }
344
+ localVarRequestOptions = __assign(__assign({ method: 'PUT' }, baseOptions), options);
345
+ localVarHeaderParameter = {};
346
+ localVarQueryParameter = {};
347
+ // authentication bearer required
348
+ // http bearer authentication required
349
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
350
+ case 1:
351
+ // authentication bearer required
352
+ // http bearer authentication required
353
+ _a.sent();
354
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
355
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
356
+ }
357
+ localVarHeaderParameter['Content-Type'] = 'application/json';
358
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
359
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
360
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
361
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateNotificationTemplateRequestDto, localVarRequestOptions, configuration);
362
+ return [2 /*return*/, {
363
+ url: (0, common_1.toPathString)(localVarUrlObj),
364
+ options: localVarRequestOptions,
365
+ }];
366
+ }
367
+ });
368
+ });
369
+ },
370
+ };
371
+ };
372
+ exports.NotificationTemplatesApiAxiosParamCreator = NotificationTemplatesApiAxiosParamCreator;
373
+ /**
374
+ * NotificationTemplatesApi - functional programming interface
375
+ * @export
376
+ */
377
+ var NotificationTemplatesApiFp = function (configuration) {
378
+ var localVarAxiosParamCreator = (0, exports.NotificationTemplatesApiAxiosParamCreator)(configuration);
379
+ return {
380
+ /**
381
+ *
382
+ * @param {CreateNotificationTemplateRequestDto} createNotificationTemplateRequestDto
383
+ * @param {string} [authorization] Bearer Token
384
+ * @param {*} [options] Override http request option.
385
+ * @throws {RequiredError}
386
+ */
387
+ createNotificationTemplate: function (createNotificationTemplateRequestDto, authorization, options) {
388
+ return __awaiter(this, void 0, void 0, function () {
389
+ var localVarAxiosArgs;
390
+ return __generator(this, function (_a) {
391
+ switch (_a.label) {
392
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.createNotificationTemplate(createNotificationTemplateRequestDto, authorization, options)];
393
+ case 1:
394
+ localVarAxiosArgs = _a.sent();
395
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
396
+ }
397
+ });
398
+ });
399
+ },
400
+ /**
401
+ *
402
+ * @param {number} id
403
+ * @param {string} [authorization] Bearer Token
404
+ * @param {*} [options] Override http request option.
405
+ * @throws {RequiredError}
406
+ */
407
+ deleteNotificationTemplate: function (id, authorization, options) {
408
+ return __awaiter(this, void 0, void 0, function () {
409
+ var localVarAxiosArgs;
410
+ return __generator(this, function (_a) {
411
+ switch (_a.label) {
412
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.deleteNotificationTemplate(id, authorization, options)];
413
+ case 1:
414
+ localVarAxiosArgs = _a.sent();
415
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
416
+ }
417
+ });
418
+ });
419
+ },
420
+ /**
421
+ *
422
+ * @param {number} id
423
+ * @param {number} id2
424
+ * @param {string} [authorization] Bearer Token
425
+ * @param {string} [expand]
426
+ * @param {*} [options] Override http request option.
427
+ * @throws {RequiredError}
428
+ */
429
+ getNotificationTemplate: function (id, id2, authorization, expand, options) {
430
+ return __awaiter(this, void 0, void 0, function () {
431
+ var localVarAxiosArgs;
432
+ return __generator(this, function (_a) {
433
+ switch (_a.label) {
434
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.getNotificationTemplate(id, id2, authorization, expand, options)];
435
+ case 1:
436
+ localVarAxiosArgs = _a.sent();
437
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
438
+ }
439
+ });
440
+ });
441
+ },
442
+ /**
443
+ *
444
+ * @param {string} [authorization] Bearer Token
445
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
446
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
447
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
448
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
449
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
450
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
451
+ * @param {*} [options] Override http request option.
452
+ * @throws {RequiredError}
453
+ */
454
+ listNotificationTemplates: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
455
+ return __awaiter(this, void 0, void 0, function () {
456
+ var localVarAxiosArgs;
457
+ return __generator(this, function (_a) {
458
+ switch (_a.label) {
459
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listNotificationTemplates(authorization, pageSize, pageToken, filter, search, order, expand, options)];
460
+ case 1:
461
+ localVarAxiosArgs = _a.sent();
462
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
463
+ }
464
+ });
465
+ });
466
+ },
467
+ /**
468
+ *
469
+ * @param {number} id
470
+ * @param {UpdateNotificationTemplateRequestDto} updateNotificationTemplateRequestDto
471
+ * @param {string} [authorization] Bearer Token
472
+ * @param {*} [options] Override http request option.
473
+ * @throws {RequiredError}
474
+ */
475
+ updateNotificationTemplate: function (id, updateNotificationTemplateRequestDto, authorization, options) {
476
+ return __awaiter(this, void 0, void 0, function () {
477
+ var localVarAxiosArgs;
478
+ return __generator(this, function (_a) {
479
+ switch (_a.label) {
480
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.updateNotificationTemplate(id, updateNotificationTemplateRequestDto, authorization, options)];
481
+ case 1:
482
+ localVarAxiosArgs = _a.sent();
483
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
484
+ }
485
+ });
486
+ });
487
+ },
488
+ };
489
+ };
490
+ exports.NotificationTemplatesApiFp = NotificationTemplatesApiFp;
491
+ /**
492
+ * NotificationTemplatesApi - factory interface
493
+ * @export
494
+ */
495
+ var NotificationTemplatesApiFactory = function (configuration, basePath, axios) {
496
+ var localVarFp = (0, exports.NotificationTemplatesApiFp)(configuration);
497
+ return {
498
+ /**
499
+ *
500
+ * @param {CreateNotificationTemplateRequestDto} createNotificationTemplateRequestDto
501
+ * @param {string} [authorization] Bearer Token
502
+ * @param {*} [options] Override http request option.
503
+ * @throws {RequiredError}
504
+ */
505
+ createNotificationTemplate: function (createNotificationTemplateRequestDto, authorization, options) {
506
+ return localVarFp.createNotificationTemplate(createNotificationTemplateRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
507
+ },
508
+ /**
509
+ *
510
+ * @param {number} id
511
+ * @param {string} [authorization] Bearer Token
512
+ * @param {*} [options] Override http request option.
513
+ * @throws {RequiredError}
514
+ */
515
+ deleteNotificationTemplate: function (id, authorization, options) {
516
+ return localVarFp.deleteNotificationTemplate(id, authorization, options).then(function (request) { return request(axios, basePath); });
517
+ },
518
+ /**
519
+ *
520
+ * @param {number} id
521
+ * @param {number} id2
522
+ * @param {string} [authorization] Bearer Token
523
+ * @param {string} [expand]
524
+ * @param {*} [options] Override http request option.
525
+ * @throws {RequiredError}
526
+ */
527
+ getNotificationTemplate: function (id, id2, authorization, expand, options) {
528
+ return localVarFp.getNotificationTemplate(id, id2, authorization, expand, options).then(function (request) { return request(axios, basePath); });
529
+ },
530
+ /**
531
+ *
532
+ * @param {string} [authorization] Bearer Token
533
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
534
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
535
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
536
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
537
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
538
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
539
+ * @param {*} [options] Override http request option.
540
+ * @throws {RequiredError}
541
+ */
542
+ listNotificationTemplates: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
543
+ return localVarFp.listNotificationTemplates(authorization, pageSize, pageToken, filter, search, order, expand, options).then(function (request) { return request(axios, basePath); });
544
+ },
545
+ /**
546
+ *
547
+ * @param {number} id
548
+ * @param {UpdateNotificationTemplateRequestDto} updateNotificationTemplateRequestDto
549
+ * @param {string} [authorization] Bearer Token
550
+ * @param {*} [options] Override http request option.
551
+ * @throws {RequiredError}
552
+ */
553
+ updateNotificationTemplate: function (id, updateNotificationTemplateRequestDto, authorization, options) {
554
+ return localVarFp.updateNotificationTemplate(id, updateNotificationTemplateRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
555
+ },
556
+ };
557
+ };
558
+ exports.NotificationTemplatesApiFactory = NotificationTemplatesApiFactory;
559
+ /**
560
+ * NotificationTemplatesApi - object-oriented interface
561
+ * @export
562
+ * @class NotificationTemplatesApi
563
+ * @extends {BaseAPI}
564
+ */
565
+ var NotificationTemplatesApi = /** @class */ (function (_super) {
566
+ __extends(NotificationTemplatesApi, _super);
567
+ function NotificationTemplatesApi() {
568
+ return _super !== null && _super.apply(this, arguments) || this;
569
+ }
570
+ /**
571
+ *
572
+ * @param {NotificationTemplatesApiCreateNotificationTemplateRequest} requestParameters Request parameters.
573
+ * @param {*} [options] Override http request option.
574
+ * @throws {RequiredError}
575
+ * @memberof NotificationTemplatesApi
576
+ */
577
+ NotificationTemplatesApi.prototype.createNotificationTemplate = function (requestParameters, options) {
578
+ var _this = this;
579
+ return (0, exports.NotificationTemplatesApiFp)(this.configuration).createNotificationTemplate(requestParameters.createNotificationTemplateRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
580
+ };
581
+ /**
582
+ *
583
+ * @param {NotificationTemplatesApiDeleteNotificationTemplateRequest} requestParameters Request parameters.
584
+ * @param {*} [options] Override http request option.
585
+ * @throws {RequiredError}
586
+ * @memberof NotificationTemplatesApi
587
+ */
588
+ NotificationTemplatesApi.prototype.deleteNotificationTemplate = function (requestParameters, options) {
589
+ var _this = this;
590
+ return (0, exports.NotificationTemplatesApiFp)(this.configuration).deleteNotificationTemplate(requestParameters.id, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
591
+ };
592
+ /**
593
+ *
594
+ * @param {NotificationTemplatesApiGetNotificationTemplateRequest} requestParameters Request parameters.
595
+ * @param {*} [options] Override http request option.
596
+ * @throws {RequiredError}
597
+ * @memberof NotificationTemplatesApi
598
+ */
599
+ NotificationTemplatesApi.prototype.getNotificationTemplate = function (requestParameters, options) {
600
+ var _this = this;
601
+ return (0, exports.NotificationTemplatesApiFp)(this.configuration).getNotificationTemplate(requestParameters.id, requestParameters.id2, requestParameters.authorization, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
602
+ };
603
+ /**
604
+ *
605
+ * @param {NotificationTemplatesApiListNotificationTemplatesRequest} requestParameters Request parameters.
606
+ * @param {*} [options] Override http request option.
607
+ * @throws {RequiredError}
608
+ * @memberof NotificationTemplatesApi
609
+ */
610
+ NotificationTemplatesApi.prototype.listNotificationTemplates = function (requestParameters, options) {
611
+ var _this = this;
612
+ if (requestParameters === void 0) { requestParameters = {}; }
613
+ return (0, exports.NotificationTemplatesApiFp)(this.configuration).listNotificationTemplates(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
614
+ };
615
+ /**
616
+ *
617
+ * @param {NotificationTemplatesApiUpdateNotificationTemplateRequest} requestParameters Request parameters.
618
+ * @param {*} [options] Override http request option.
619
+ * @throws {RequiredError}
620
+ * @memberof NotificationTemplatesApi
621
+ */
622
+ NotificationTemplatesApi.prototype.updateNotificationTemplate = function (requestParameters, options) {
623
+ var _this = this;
624
+ return (0, exports.NotificationTemplatesApiFp)(this.configuration).updateNotificationTemplate(requestParameters.id, requestParameters.updateNotificationTemplateRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
625
+ };
626
+ return NotificationTemplatesApi;
627
+ }(base_1.BaseAPI));
628
+ exports.NotificationTemplatesApi = NotificationTemplatesApi;