@emilgroup/notification-sdk 0.8.1-beta.7 → 0.8.1-beta.70

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 (122) hide show
  1. package/.openapi-generator/FILES +25 -0
  2. package/README.md +2 -2
  3. package/api/email-mailboxes-api.ts +153 -0
  4. package/api/email-messages-api.ts +197 -40
  5. package/api/email-subscriptions-api.ts +799 -0
  6. package/api/email-tracking-api.ts +313 -52
  7. package/api/email-verifications-api.ts +32 -14
  8. package/api/health-api.ts +1 -1
  9. package/api/layouts-api.ts +96 -51
  10. package/api/msgraph-webhooks-api.ts +278 -0
  11. package/api/notification-templates-api.ts +96 -51
  12. package/api/notifications-api.ts +128 -7
  13. package/api.ts +6 -0
  14. package/base.ts +239 -43
  15. package/common.ts +3 -2
  16. package/configuration.ts +20 -0
  17. package/dist/api/email-mailboxes-api.d.ts +87 -0
  18. package/dist/api/email-mailboxes-api.js +225 -0
  19. package/dist/api/email-messages-api.d.ts +110 -32
  20. package/dist/api/email-messages-api.js +199 -56
  21. package/dist/api/email-subscriptions-api.d.ts +432 -0
  22. package/dist/api/email-subscriptions-api.js +761 -0
  23. package/dist/api/email-tracking-api.d.ts +174 -44
  24. package/dist/api/email-tracking-api.js +299 -64
  25. package/dist/api/email-verifications-api.d.ts +18 -10
  26. package/dist/api/email-verifications-api.js +46 -24
  27. package/dist/api/health-api.d.ts +1 -1
  28. package/dist/api/health-api.js +1 -1
  29. package/dist/api/layouts-api.d.ts +61 -41
  30. package/dist/api/layouts-api.js +119 -70
  31. package/dist/api/msgraph-webhooks-api.d.ts +168 -0
  32. package/dist/api/msgraph-webhooks-api.js +305 -0
  33. package/dist/api/notification-templates-api.d.ts +61 -41
  34. package/dist/api/notification-templates-api.js +119 -70
  35. package/dist/api/notifications-api.d.ts +66 -5
  36. package/dist/api/notifications-api.js +123 -12
  37. package/dist/api.d.ts +3 -0
  38. package/dist/api.js +3 -0
  39. package/dist/base.d.ts +26 -0
  40. package/dist/base.js +243 -60
  41. package/dist/common.d.ts +1 -1
  42. package/dist/common.js +1 -0
  43. package/dist/configuration.d.ts +17 -0
  44. package/dist/configuration.js +2 -0
  45. package/dist/models/assign-email-thread-entity-body-dto.d.ts +43 -0
  46. package/dist/models/assign-email-thread-entity-body-dto.js +22 -0
  47. package/dist/models/assign-email-thread-entity-response-class.d.ts +25 -0
  48. package/dist/models/assign-email-thread-entity-response-class.js +15 -0
  49. package/dist/models/catch-up-email-subscription-response-class.d.ts +24 -0
  50. package/dist/models/catch-up-email-subscription-response-class.js +15 -0
  51. package/dist/models/catch-up-email-subscriptions-request-dto.d.ts +24 -0
  52. package/dist/models/catch-up-email-subscriptions-request-dto.js +15 -0
  53. package/dist/models/catch-up-email-subscriptions-response-class.d.ts +30 -0
  54. package/dist/models/catch-up-email-subscriptions-response-class.js +15 -0
  55. package/dist/models/email-mailbox-class.d.ts +47 -0
  56. package/dist/models/email-mailbox-class.js +20 -0
  57. package/dist/models/email-message-class.d.ts +102 -7
  58. package/dist/models/email-message-class.js +25 -2
  59. package/dist/models/email-message-summary-class.d.ts +121 -0
  60. package/dist/models/email-message-summary-class.js +37 -0
  61. package/dist/models/email-subscription-class.d.ts +110 -0
  62. package/dist/models/email-subscription-class.js +23 -0
  63. package/dist/models/email-thread-class.d.ts +37 -5
  64. package/dist/models/entity-ref-class.d.ts +37 -0
  65. package/dist/models/entity-ref-class.js +22 -0
  66. package/dist/models/get-email-subscription-response-class.d.ts +25 -0
  67. package/dist/models/get-email-subscription-response-class.js +15 -0
  68. package/dist/models/grpc-send-email-request-dto.d.ts +137 -0
  69. package/dist/models/grpc-send-email-request-dto.js +22 -0
  70. package/dist/models/index.d.ts +22 -0
  71. package/dist/models/index.js +22 -0
  72. package/dist/models/inline-attachment-dto.d.ts +36 -0
  73. package/dist/models/inline-attachment-dto.js +15 -0
  74. package/dist/models/list-email-mailboxes-response-class.d.ts +43 -0
  75. package/dist/models/list-email-mailboxes-response-class.js +15 -0
  76. package/dist/models/list-email-subscriptions-response-class.d.ts +43 -0
  77. package/dist/models/list-email-subscriptions-response-class.js +15 -0
  78. package/dist/models/reconcile-email-subscriptions-request-dto.d.ts +24 -0
  79. package/dist/models/reconcile-email-subscriptions-request-dto.js +15 -0
  80. package/dist/models/reconcile-email-subscriptions-response-class.d.ts +48 -0
  81. package/dist/models/reconcile-email-subscriptions-response-class.js +15 -0
  82. package/dist/models/renew-email-subscription-response-class.d.ts +25 -0
  83. package/dist/models/renew-email-subscription-response-class.js +15 -0
  84. package/dist/models/resend-email-message-body-dto.d.ts +30 -0
  85. package/dist/models/resend-email-message-body-dto.js +15 -0
  86. package/dist/models/resend-email-message-response-class.d.ts +25 -0
  87. package/dist/models/resend-email-message-response-class.js +15 -0
  88. package/dist/models/send-email-request-dto.d.ts +131 -0
  89. package/dist/models/send-email-request-dto.js +22 -0
  90. package/dist/models/send-email-response-class.d.ts +24 -0
  91. package/dist/models/send-email-response-class.js +15 -0
  92. package/dist/models/send-notification-request-dto.d.ts +10 -1
  93. package/dist/models/send-notification-request-dto.js +2 -1
  94. package/dist/models/unassign-email-thread-entity-response-class.d.ts +25 -0
  95. package/dist/models/unassign-email-thread-entity-response-class.js +15 -0
  96. package/models/assign-email-thread-entity-body-dto.ts +52 -0
  97. package/models/assign-email-thread-entity-response-class.ts +31 -0
  98. package/models/catch-up-email-subscription-response-class.ts +30 -0
  99. package/models/catch-up-email-subscriptions-request-dto.ts +30 -0
  100. package/models/catch-up-email-subscriptions-response-class.ts +36 -0
  101. package/models/email-mailbox-class.ts +56 -0
  102. package/models/email-message-class.ts +108 -8
  103. package/models/email-message-summary-class.ts +133 -0
  104. package/models/email-subscription-class.ts +119 -0
  105. package/models/email-thread-class.ts +37 -5
  106. package/models/entity-ref-class.ts +46 -0
  107. package/models/get-email-subscription-response-class.ts +31 -0
  108. package/models/grpc-send-email-request-dto.ts +144 -0
  109. package/models/index.ts +22 -0
  110. package/models/inline-attachment-dto.ts +42 -0
  111. package/models/list-email-mailboxes-response-class.ts +49 -0
  112. package/models/list-email-subscriptions-response-class.ts +49 -0
  113. package/models/reconcile-email-subscriptions-request-dto.ts +30 -0
  114. package/models/reconcile-email-subscriptions-response-class.ts +54 -0
  115. package/models/renew-email-subscription-response-class.ts +31 -0
  116. package/models/resend-email-message-body-dto.ts +36 -0
  117. package/models/resend-email-message-response-class.ts +31 -0
  118. package/models/send-email-request-dto.ts +138 -0
  119. package/models/send-email-response-class.ts +30 -0
  120. package/models/send-notification-request-dto.ts +9 -2
  121. package/models/unassign-email-thread-entity-response-class.ts +31 -0
  122. package/package.json +2 -2
@@ -21,11 +21,17 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj
21
21
  // @ts-ignore
22
22
  import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
23
23
  // @ts-ignore
24
+ import { AssignEmailThreadEntityBodyDto } from '../models';
25
+ // @ts-ignore
26
+ import { AssignEmailThreadEntityResponseClass } from '../models';
27
+ // @ts-ignore
24
28
  import { GetEmailThreadResponseClass } from '../models';
25
29
  // @ts-ignore
26
30
  import { ListEmailMessagesResponseClass } from '../models';
27
31
  // @ts-ignore
28
32
  import { ListEmailThreadsResponseClass } from '../models';
33
+ // @ts-ignore
34
+ import { UnassignEmailThreadEntityResponseClass } from '../models';
29
35
  /**
30
36
  * EmailTrackingApi - axios parameter creator
31
37
  * @export
@@ -33,7 +39,64 @@ import { ListEmailThreadsResponseClass } from '../models';
33
39
  export const EmailTrackingApiAxiosParamCreator = function (configuration?: Configuration) {
34
40
  return {
35
41
  /**
36
- * undefined **Required Permissions** \"notification-management.email-messages.update\"
42
+ * Links the email thread, and every message in it, to the given entity, identified by code or by number (the code wins when both are set). Replaces the current link. The entity must exist. Messages that arrive in the thread later are linked to the same entity. **Required Permissions** \"notification-management.email-messages.update\"
43
+ * @summary Assign an email thread to an entity
44
+ * @param {string} code
45
+ * @param {AssignEmailThreadEntityBodyDto} assignEmailThreadEntityBodyDto
46
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
47
+ * @param {*} [options] Override http request option.
48
+ * @throws {RequiredError}
49
+ */
50
+ assignEntity: async (code: string, assignEmailThreadEntityBodyDto: AssignEmailThreadEntityBodyDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
51
+ // verify required parameter 'code' is not null or undefined
52
+ assertParamExists('assignEntity', 'code', code)
53
+ // verify required parameter 'assignEmailThreadEntityBodyDto' is not null or undefined
54
+ assertParamExists('assignEntity', 'assignEmailThreadEntityBodyDto', assignEmailThreadEntityBodyDto)
55
+ const localVarPath = `/notificationservice/v1/email-threads/{code}/entity`
56
+ .replace(`{${"code"}}`, encodeURIComponent(String(code)));
57
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
58
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
59
+ let baseOptions;
60
+ let baseAccessToken;
61
+ if (configuration) {
62
+ baseOptions = configuration.baseOptions;
63
+ baseAccessToken = configuration.accessToken;
64
+ }
65
+
66
+ const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
67
+ const localVarHeaderParameter = {} as any;
68
+ const localVarQueryParameter = {} as any;
69
+
70
+ // authentication bearer required
71
+ // http bearer authentication required
72
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
73
+
74
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
75
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
76
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
77
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
78
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
79
+ if (authorizationValue || authorizationKeepEmpty) {
80
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
81
+ }
82
+
83
+
84
+
85
+ localVarHeaderParameter['Content-Type'] = 'application/json';
86
+
87
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
88
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
89
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
90
+ localVarRequestOptions.data = serializeDataIfNeeded(assignEmailThreadEntityBodyDto, localVarRequestOptions, configuration)
91
+
92
+ return {
93
+ url: toPathString(localVarUrlObj),
94
+ options: localVarRequestOptions,
95
+ };
96
+ },
97
+ /**
98
+ * Closes the email thread with the given code and returns the updated thread. **Required Permissions** \"notification-management.email-messages.update\"
99
+ * @summary Close the email thread
37
100
  * @param {string} code
38
101
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
39
102
  * @param {*} [options] Override http request option.
@@ -61,8 +124,13 @@ export const EmailTrackingApiAxiosParamCreator = function (configuration?: Confi
61
124
  // http bearer authentication required
62
125
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
63
126
 
64
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
65
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
127
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
128
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
129
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
130
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
131
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
132
+ if (authorizationValue || authorizationKeepEmpty) {
133
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
66
134
  }
67
135
 
68
136
 
@@ -77,7 +145,8 @@ export const EmailTrackingApiAxiosParamCreator = function (configuration?: Confi
77
145
  };
78
146
  },
79
147
  /**
80
- * undefined **Required Permissions** \"notification-management.email-messages.view\"
148
+ * Retrieves the details of the email thread with the given code. **Required Permissions** \"notification-management.email-messages.view\"
149
+ * @summary Retrieve the email thread
81
150
  * @param {string} code
82
151
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
83
152
  * @param {*} [options] Override http request option.
@@ -105,8 +174,13 @@ export const EmailTrackingApiAxiosParamCreator = function (configuration?: Confi
105
174
  // http bearer authentication required
106
175
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
107
176
 
108
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
109
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
177
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
178
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
179
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
180
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
181
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
182
+ if (authorizationValue || authorizationKeepEmpty) {
183
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
110
184
  }
111
185
 
112
186
 
@@ -121,13 +195,13 @@ export const EmailTrackingApiAxiosParamCreator = function (configuration?: Confi
121
195
  };
122
196
  },
123
197
  /**
124
- * Lists all email messages for a thread **Required Permissions** \"notification-management.email-messages.view\"
198
+ * Returns the email messages of the email thread with the given code. For more information about pagination, read the Pagination documentation. **Required Permissions** \"notification-management.email-messages.view\"
125
199
  * @summary List email messages
126
200
  * @param {string} code
127
201
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
128
- * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, entityType, entityCode, direction, deliveryStatus, fromAddress, subject, notificationRequestId, sentAt, receivedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
129
- * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, entityType, entityCode, direction, deliveryStatus, fromAddress, subject, notificationRequestId, sentAt, receivedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
130
- * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, direction, deliveryStatus, fromAddress, subject, sentAt, receivedAt, createdAt, updatedAt&lt;/i&gt;
202
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, entityType, entityCode, entityNumber, direction, deliveryStatus, provider, mailbox, workflowStatus, resentFromMessageCode, resendReason, fromAddress, subject, notificationRequestId, sentAt, receivedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
203
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, entityType, entityCode, entityNumber, direction, deliveryStatus, provider, mailbox, workflowStatus, resentFromMessageCode, resendReason, fromAddress, subject, notificationRequestId, sentAt, receivedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
204
+ * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, direction, deliveryStatus, workflowStatus, fromAddress, subject, sentAt, receivedAt, createdAt, updatedAt&lt;/i&gt;
131
205
  * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: attachments&lt;i&gt;
132
206
  * @param {*} [options] Override http request option.
133
207
  * @throws {RequiredError}
@@ -170,8 +244,13 @@ export const EmailTrackingApiAxiosParamCreator = function (configuration?: Confi
170
244
  localVarQueryParameter['expand'] = expand;
171
245
  }
172
246
 
173
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
174
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
247
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
248
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
249
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
250
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
251
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
252
+ if (authorizationValue || authorizationKeepEmpty) {
253
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
175
254
  }
176
255
 
177
256
 
@@ -186,16 +265,16 @@ export const EmailTrackingApiAxiosParamCreator = function (configuration?: Confi
186
265
  };
187
266
  },
188
267
  /**
189
- * Lists all email threads with optional filters **Required Permissions** \"notification-management.email-messages.view\"
268
+ * Returns a list of email threads, newest first. A thread groups an email with its replies; each item carries the newest message of the thread in latestMessage and the number of messages in messageCount. Threads without a message yet are not listed. Filter on the newest message with latestDirection (inbox tabs), latestDeliveryStatus or latestWorkflowStatus (use latestWorkflowStatus==$null for threads whose newest message has no workflow). Add expand=messages to get every message of each thread, without bodies. For more information about pagination, read the Pagination documentation. **Required Permissions** \"notification-management.email-messages.view\"
190
269
  * @summary List email threads
191
270
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
192
271
  * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
193
272
  * @param {string} [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.
194
- * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, subject, status, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
273
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, entityNumber, subject, status, mailbox, messageCount, lastMessageAt, latestDirection, latestDeliveryStatus, latestWorkflowStatus, latestFromAddress, latestToAddresses, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
195
274
  * @param {string} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
196
- * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, subject, status, createdAt, updatedAt&lt;/i&gt;
275
+ * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, subject, status, mailbox, messageCount, lastMessageAt, latestDirection, latestDeliveryStatus, latestWorkflowStatus, createdAt, updatedAt&lt;/i&gt;
197
276
  * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: messages&lt;i&gt;
198
- * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, subject, status, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
277
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, entityNumber, subject, status, mailbox, messageCount, lastMessageAt, latestDirection, latestDeliveryStatus, latestWorkflowStatus, latestFromAddress, latestToAddresses, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
199
278
  * @param {*} [options] Override http request option.
200
279
  * @throws {RequiredError}
201
280
  */
@@ -246,8 +325,63 @@ export const EmailTrackingApiAxiosParamCreator = function (configuration?: Confi
246
325
  localVarQueryParameter['filters'] = filters;
247
326
  }
248
327
 
249
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
250
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
328
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
329
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
330
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
331
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
332
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
333
+ if (authorizationValue || authorizationKeepEmpty) {
334
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
335
+ }
336
+
337
+
338
+
339
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
340
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
341
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
342
+
343
+ return {
344
+ url: toPathString(localVarUrlObj),
345
+ options: localVarRequestOptions,
346
+ };
347
+ },
348
+ /**
349
+ * Removes the entity link from the email thread and every message in it, and marks the messages as unassigned. **Required Permissions** \"notification-management.email-messages.update\"
350
+ * @summary Unassign an email thread from its entity
351
+ * @param {string} code
352
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
353
+ * @param {*} [options] Override http request option.
354
+ * @throws {RequiredError}
355
+ */
356
+ unassignEntity: async (code: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
357
+ // verify required parameter 'code' is not null or undefined
358
+ assertParamExists('unassignEntity', 'code', code)
359
+ const localVarPath = `/notificationservice/v1/email-threads/{code}/entity`
360
+ .replace(`{${"code"}}`, encodeURIComponent(String(code)));
361
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
362
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
363
+ let baseOptions;
364
+ let baseAccessToken;
365
+ if (configuration) {
366
+ baseOptions = configuration.baseOptions;
367
+ baseAccessToken = configuration.accessToken;
368
+ }
369
+
370
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
371
+ const localVarHeaderParameter = {} as any;
372
+ const localVarQueryParameter = {} as any;
373
+
374
+ // authentication bearer required
375
+ // http bearer authentication required
376
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
377
+
378
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
379
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
380
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
381
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
382
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
383
+ if (authorizationValue || authorizationKeepEmpty) {
384
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
251
385
  }
252
386
 
253
387
 
@@ -272,7 +406,21 @@ export const EmailTrackingApiFp = function(configuration?: Configuration) {
272
406
  const localVarAxiosParamCreator = EmailTrackingApiAxiosParamCreator(configuration)
273
407
  return {
274
408
  /**
275
- * undefined **Required Permissions** \"notification-management.email-messages.update\"
409
+ * Links the email thread, and every message in it, to the given entity, identified by code or by number (the code wins when both are set). Replaces the current link. The entity must exist. Messages that arrive in the thread later are linked to the same entity. **Required Permissions** \"notification-management.email-messages.update\"
410
+ * @summary Assign an email thread to an entity
411
+ * @param {string} code
412
+ * @param {AssignEmailThreadEntityBodyDto} assignEmailThreadEntityBodyDto
413
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
414
+ * @param {*} [options] Override http request option.
415
+ * @throws {RequiredError}
416
+ */
417
+ async assignEntity(code: string, assignEmailThreadEntityBodyDto: AssignEmailThreadEntityBodyDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AssignEmailThreadEntityResponseClass>> {
418
+ const localVarAxiosArgs = await localVarAxiosParamCreator.assignEntity(code, assignEmailThreadEntityBodyDto, authorization, options);
419
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
420
+ },
421
+ /**
422
+ * Closes the email thread with the given code and returns the updated thread. **Required Permissions** \"notification-management.email-messages.update\"
423
+ * @summary Close the email thread
276
424
  * @param {string} code
277
425
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
278
426
  * @param {*} [options] Override http request option.
@@ -283,7 +431,8 @@ export const EmailTrackingApiFp = function(configuration?: Configuration) {
283
431
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
284
432
  },
285
433
  /**
286
- * undefined **Required Permissions** \"notification-management.email-messages.view\"
434
+ * Retrieves the details of the email thread with the given code. **Required Permissions** \"notification-management.email-messages.view\"
435
+ * @summary Retrieve the email thread
287
436
  * @param {string} code
288
437
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
289
438
  * @param {*} [options] Override http request option.
@@ -294,13 +443,13 @@ export const EmailTrackingApiFp = function(configuration?: Configuration) {
294
443
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
295
444
  },
296
445
  /**
297
- * Lists all email messages for a thread **Required Permissions** \"notification-management.email-messages.view\"
446
+ * Returns the email messages of the email thread with the given code. For more information about pagination, read the Pagination documentation. **Required Permissions** \"notification-management.email-messages.view\"
298
447
  * @summary List email messages
299
448
  * @param {string} code
300
449
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
301
- * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, entityType, entityCode, direction, deliveryStatus, fromAddress, subject, notificationRequestId, sentAt, receivedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
302
- * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, entityType, entityCode, direction, deliveryStatus, fromAddress, subject, notificationRequestId, sentAt, receivedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
303
- * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, direction, deliveryStatus, fromAddress, subject, sentAt, receivedAt, createdAt, updatedAt&lt;/i&gt;
450
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, entityType, entityCode, entityNumber, direction, deliveryStatus, provider, mailbox, workflowStatus, resentFromMessageCode, resendReason, fromAddress, subject, notificationRequestId, sentAt, receivedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
451
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, entityType, entityCode, entityNumber, direction, deliveryStatus, provider, mailbox, workflowStatus, resentFromMessageCode, resendReason, fromAddress, subject, notificationRequestId, sentAt, receivedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
452
+ * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, direction, deliveryStatus, workflowStatus, fromAddress, subject, sentAt, receivedAt, createdAt, updatedAt&lt;/i&gt;
304
453
  * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: attachments&lt;i&gt;
305
454
  * @param {*} [options] Override http request option.
306
455
  * @throws {RequiredError}
@@ -310,16 +459,16 @@ export const EmailTrackingApiFp = function(configuration?: Configuration) {
310
459
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
311
460
  },
312
461
  /**
313
- * Lists all email threads with optional filters **Required Permissions** \"notification-management.email-messages.view\"
462
+ * Returns a list of email threads, newest first. A thread groups an email with its replies; each item carries the newest message of the thread in latestMessage and the number of messages in messageCount. Threads without a message yet are not listed. Filter on the newest message with latestDirection (inbox tabs), latestDeliveryStatus or latestWorkflowStatus (use latestWorkflowStatus==$null for threads whose newest message has no workflow). Add expand=messages to get every message of each thread, without bodies. For more information about pagination, read the Pagination documentation. **Required Permissions** \"notification-management.email-messages.view\"
314
463
  * @summary List email threads
315
464
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
316
465
  * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
317
466
  * @param {string} [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.
318
- * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, subject, status, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
467
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, entityNumber, subject, status, mailbox, messageCount, lastMessageAt, latestDirection, latestDeliveryStatus, latestWorkflowStatus, latestFromAddress, latestToAddresses, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
319
468
  * @param {string} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
320
- * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, subject, status, createdAt, updatedAt&lt;/i&gt;
469
+ * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, subject, status, mailbox, messageCount, lastMessageAt, latestDirection, latestDeliveryStatus, latestWorkflowStatus, createdAt, updatedAt&lt;/i&gt;
321
470
  * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: messages&lt;i&gt;
322
- * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, subject, status, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
471
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, entityNumber, subject, status, mailbox, messageCount, lastMessageAt, latestDirection, latestDeliveryStatus, latestWorkflowStatus, latestFromAddress, latestToAddresses, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
323
472
  * @param {*} [options] Override http request option.
324
473
  * @throws {RequiredError}
325
474
  */
@@ -327,6 +476,18 @@ export const EmailTrackingApiFp = function(configuration?: Configuration) {
327
476
  const localVarAxiosArgs = await localVarAxiosParamCreator.listThreads(authorization, pageSize, pageToken, filter, search, order, expand, filters, options);
328
477
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
329
478
  },
479
+ /**
480
+ * Removes the entity link from the email thread and every message in it, and marks the messages as unassigned. **Required Permissions** \"notification-management.email-messages.update\"
481
+ * @summary Unassign an email thread from its entity
482
+ * @param {string} code
483
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
484
+ * @param {*} [options] Override http request option.
485
+ * @throws {RequiredError}
486
+ */
487
+ async unassignEntity(code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UnassignEmailThreadEntityResponseClass>> {
488
+ const localVarAxiosArgs = await localVarAxiosParamCreator.unassignEntity(code, authorization, options);
489
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
490
+ },
330
491
  }
331
492
  };
332
493
 
@@ -338,7 +499,20 @@ export const EmailTrackingApiFactory = function (configuration?: Configuration,
338
499
  const localVarFp = EmailTrackingApiFp(configuration)
339
500
  return {
340
501
  /**
341
- * undefined **Required Permissions** \"notification-management.email-messages.update\"
502
+ * Links the email thread, and every message in it, to the given entity, identified by code or by number (the code wins when both are set). Replaces the current link. The entity must exist. Messages that arrive in the thread later are linked to the same entity. **Required Permissions** \"notification-management.email-messages.update\"
503
+ * @summary Assign an email thread to an entity
504
+ * @param {string} code
505
+ * @param {AssignEmailThreadEntityBodyDto} assignEmailThreadEntityBodyDto
506
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
507
+ * @param {*} [options] Override http request option.
508
+ * @throws {RequiredError}
509
+ */
510
+ assignEntity(code: string, assignEmailThreadEntityBodyDto: AssignEmailThreadEntityBodyDto, authorization?: string, options?: any): AxiosPromise<AssignEmailThreadEntityResponseClass> {
511
+ return localVarFp.assignEntity(code, assignEmailThreadEntityBodyDto, authorization, options).then((request) => request(axios, basePath));
512
+ },
513
+ /**
514
+ * Closes the email thread with the given code and returns the updated thread. **Required Permissions** \"notification-management.email-messages.update\"
515
+ * @summary Close the email thread
342
516
  * @param {string} code
343
517
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
344
518
  * @param {*} [options] Override http request option.
@@ -348,7 +522,8 @@ export const EmailTrackingApiFactory = function (configuration?: Configuration,
348
522
  return localVarFp.closeThread(code, authorization, options).then((request) => request(axios, basePath));
349
523
  },
350
524
  /**
351
- * undefined **Required Permissions** \"notification-management.email-messages.view\"
525
+ * Retrieves the details of the email thread with the given code. **Required Permissions** \"notification-management.email-messages.view\"
526
+ * @summary Retrieve the email thread
352
527
  * @param {string} code
353
528
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
354
529
  * @param {*} [options] Override http request option.
@@ -358,13 +533,13 @@ export const EmailTrackingApiFactory = function (configuration?: Configuration,
358
533
  return localVarFp.getThread(code, authorization, options).then((request) => request(axios, basePath));
359
534
  },
360
535
  /**
361
- * Lists all email messages for a thread **Required Permissions** \"notification-management.email-messages.view\"
536
+ * Returns the email messages of the email thread with the given code. For more information about pagination, read the Pagination documentation. **Required Permissions** \"notification-management.email-messages.view\"
362
537
  * @summary List email messages
363
538
  * @param {string} code
364
539
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
365
- * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, entityType, entityCode, direction, deliveryStatus, fromAddress, subject, notificationRequestId, sentAt, receivedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
366
- * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, entityType, entityCode, direction, deliveryStatus, fromAddress, subject, notificationRequestId, sentAt, receivedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
367
- * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, direction, deliveryStatus, fromAddress, subject, sentAt, receivedAt, createdAt, updatedAt&lt;/i&gt;
540
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, entityType, entityCode, entityNumber, direction, deliveryStatus, provider, mailbox, workflowStatus, resentFromMessageCode, resendReason, fromAddress, subject, notificationRequestId, sentAt, receivedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
541
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, entityType, entityCode, entityNumber, direction, deliveryStatus, provider, mailbox, workflowStatus, resentFromMessageCode, resendReason, fromAddress, subject, notificationRequestId, sentAt, receivedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
542
+ * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, direction, deliveryStatus, workflowStatus, fromAddress, subject, sentAt, receivedAt, createdAt, updatedAt&lt;/i&gt;
368
543
  * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: attachments&lt;i&gt;
369
544
  * @param {*} [options] Override http request option.
370
545
  * @throws {RequiredError}
@@ -373,25 +548,64 @@ export const EmailTrackingApiFactory = function (configuration?: Configuration,
373
548
  return localVarFp.listMessages(code, authorization, filter, filters, order, expand, options).then((request) => request(axios, basePath));
374
549
  },
375
550
  /**
376
- * Lists all email threads with optional filters **Required Permissions** \"notification-management.email-messages.view\"
551
+ * Returns a list of email threads, newest first. A thread groups an email with its replies; each item carries the newest message of the thread in latestMessage and the number of messages in messageCount. Threads without a message yet are not listed. Filter on the newest message with latestDirection (inbox tabs), latestDeliveryStatus or latestWorkflowStatus (use latestWorkflowStatus==$null for threads whose newest message has no workflow). Add expand=messages to get every message of each thread, without bodies. For more information about pagination, read the Pagination documentation. **Required Permissions** \"notification-management.email-messages.view\"
377
552
  * @summary List email threads
378
553
  * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
379
554
  * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
380
555
  * @param {string} [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.
381
- * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, subject, status, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
556
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, entityNumber, subject, status, mailbox, messageCount, lastMessageAt, latestDirection, latestDeliveryStatus, latestWorkflowStatus, latestFromAddress, latestToAddresses, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
382
557
  * @param {string} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
383
- * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, subject, status, createdAt, updatedAt&lt;/i&gt;
558
+ * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, subject, status, mailbox, messageCount, lastMessageAt, latestDirection, latestDeliveryStatus, latestWorkflowStatus, createdAt, updatedAt&lt;/i&gt;
384
559
  * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: messages&lt;i&gt;
385
- * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, subject, status, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
560
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, entityNumber, subject, status, mailbox, messageCount, lastMessageAt, latestDirection, latestDeliveryStatus, latestWorkflowStatus, latestFromAddress, latestToAddresses, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
386
561
  * @param {*} [options] Override http request option.
387
562
  * @throws {RequiredError}
388
563
  */
389
564
  listThreads(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListEmailThreadsResponseClass> {
390
565
  return localVarFp.listThreads(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath));
391
566
  },
567
+ /**
568
+ * Removes the entity link from the email thread and every message in it, and marks the messages as unassigned. **Required Permissions** \"notification-management.email-messages.update\"
569
+ * @summary Unassign an email thread from its entity
570
+ * @param {string} code
571
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
572
+ * @param {*} [options] Override http request option.
573
+ * @throws {RequiredError}
574
+ */
575
+ unassignEntity(code: string, authorization?: string, options?: any): AxiosPromise<UnassignEmailThreadEntityResponseClass> {
576
+ return localVarFp.unassignEntity(code, authorization, options).then((request) => request(axios, basePath));
577
+ },
392
578
  };
393
579
  };
394
580
 
581
+ /**
582
+ * Request parameters for assignEntity operation in EmailTrackingApi.
583
+ * @export
584
+ * @interface EmailTrackingApiAssignEntityRequest
585
+ */
586
+ export interface EmailTrackingApiAssignEntityRequest {
587
+ /**
588
+ *
589
+ * @type {string}
590
+ * @memberof EmailTrackingApiAssignEntity
591
+ */
592
+ readonly code: string
593
+
594
+ /**
595
+ *
596
+ * @type {AssignEmailThreadEntityBodyDto}
597
+ * @memberof EmailTrackingApiAssignEntity
598
+ */
599
+ readonly assignEmailThreadEntityBodyDto: AssignEmailThreadEntityBodyDto
600
+
601
+ /**
602
+ * Bearer Token: provided by the login endpoint under the name accessToken.
603
+ * @type {string}
604
+ * @memberof EmailTrackingApiAssignEntity
605
+ */
606
+ readonly authorization?: string
607
+ }
608
+
395
609
  /**
396
610
  * Request parameters for closeThread operation in EmailTrackingApi.
397
611
  * @export
@@ -455,21 +669,21 @@ export interface EmailTrackingApiListMessagesRequest {
455
669
  readonly authorization?: string
456
670
 
457
671
  /**
458
- * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, entityType, entityCode, direction, deliveryStatus, fromAddress, subject, notificationRequestId, sentAt, receivedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
672
+ * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, entityType, entityCode, entityNumber, direction, deliveryStatus, provider, mailbox, workflowStatus, resentFromMessageCode, resendReason, fromAddress, subject, notificationRequestId, sentAt, receivedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
459
673
  * @type {string}
460
674
  * @memberof EmailTrackingApiListMessages
461
675
  */
462
676
  readonly filter?: string
463
677
 
464
678
  /**
465
- * Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, entityType, entityCode, direction, deliveryStatus, fromAddress, subject, notificationRequestId, sentAt, receivedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
679
+ * Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, entityType, entityCode, entityNumber, direction, deliveryStatus, provider, mailbox, workflowStatus, resentFromMessageCode, resendReason, fromAddress, subject, notificationRequestId, sentAt, receivedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
466
680
  * @type {string}
467
681
  * @memberof EmailTrackingApiListMessages
468
682
  */
469
683
  readonly filters?: string
470
684
 
471
685
  /**
472
- * Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, direction, deliveryStatus, fromAddress, subject, sentAt, receivedAt, createdAt, updatedAt&lt;/i&gt;
686
+ * Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, threadCode, direction, deliveryStatus, workflowStatus, fromAddress, subject, sentAt, receivedAt, createdAt, updatedAt&lt;/i&gt;
473
687
  * @type {string}
474
688
  * @memberof EmailTrackingApiListMessages
475
689
  */
@@ -511,7 +725,7 @@ export interface EmailTrackingApiListThreadsRequest {
511
725
  readonly pageToken?: string
512
726
 
513
727
  /**
514
- * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, subject, status, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
728
+ * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, entityNumber, subject, status, mailbox, messageCount, lastMessageAt, latestDirection, latestDeliveryStatus, latestWorkflowStatus, latestFromAddress, latestToAddresses, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
515
729
  * @type {string}
516
730
  * @memberof EmailTrackingApiListThreads
517
731
  */
@@ -525,7 +739,7 @@ export interface EmailTrackingApiListThreadsRequest {
525
739
  readonly search?: string
526
740
 
527
741
  /**
528
- * Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, subject, status, createdAt, updatedAt&lt;/i&gt;
742
+ * Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, subject, status, mailbox, messageCount, lastMessageAt, latestDirection, latestDeliveryStatus, latestWorkflowStatus, createdAt, updatedAt&lt;/i&gt;
529
743
  * @type {string}
530
744
  * @memberof EmailTrackingApiListThreads
531
745
  */
@@ -539,13 +753,34 @@ export interface EmailTrackingApiListThreadsRequest {
539
753
  readonly expand?: string
540
754
 
541
755
  /**
542
- * Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, subject, status, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
756
+ * Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, entityType, entityCode, entityNumber, subject, status, mailbox, messageCount, lastMessageAt, latestDirection, latestDeliveryStatus, latestWorkflowStatus, latestFromAddress, latestToAddresses, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
543
757
  * @type {string}
544
758
  * @memberof EmailTrackingApiListThreads
545
759
  */
546
760
  readonly filters?: string
547
761
  }
548
762
 
763
+ /**
764
+ * Request parameters for unassignEntity operation in EmailTrackingApi.
765
+ * @export
766
+ * @interface EmailTrackingApiUnassignEntityRequest
767
+ */
768
+ export interface EmailTrackingApiUnassignEntityRequest {
769
+ /**
770
+ *
771
+ * @type {string}
772
+ * @memberof EmailTrackingApiUnassignEntity
773
+ */
774
+ readonly code: string
775
+
776
+ /**
777
+ * Bearer Token: provided by the login endpoint under the name accessToken.
778
+ * @type {string}
779
+ * @memberof EmailTrackingApiUnassignEntity
780
+ */
781
+ readonly authorization?: string
782
+ }
783
+
549
784
  /**
550
785
  * EmailTrackingApi - object-oriented interface
551
786
  * @export
@@ -554,29 +789,43 @@ export interface EmailTrackingApiListThreadsRequest {
554
789
  */
555
790
  export class EmailTrackingApi extends BaseAPI {
556
791
  /**
557
- * undefined **Required Permissions** \"notification-management.email-messages.update\"
792
+ * Links the email thread, and every message in it, to the given entity, identified by code or by number (the code wins when both are set). Replaces the current link. The entity must exist. Messages that arrive in the thread later are linked to the same entity. **Required Permissions** \"notification-management.email-messages.update\"
793
+ * @summary Assign an email thread to an entity
794
+ * @param {EmailTrackingApiAssignEntityRequest} requestParameters Request parameters.
795
+ * @param {*} [options] Override http request option.
796
+ * @throws {RequiredError}
797
+ * @memberof EmailTrackingApi
798
+ */
799
+ public assignEntity(requestParameters: EmailTrackingApiAssignEntityRequest, options?: AxiosRequestConfig) {
800
+ return EmailTrackingApiFp(this.configuration).assignEntity(requestParameters.code, requestParameters.assignEmailThreadEntityBodyDto, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
801
+ }
802
+
803
+ /**
804
+ * Closes the email thread with the given code and returns the updated thread. **Required Permissions** \"notification-management.email-messages.update\"
805
+ * @summary Close the email thread
558
806
  * @param {EmailTrackingApiCloseThreadRequest} requestParameters Request parameters.
559
807
  * @param {*} [options] Override http request option.
560
808
  * @throws {RequiredError}
561
809
  * @memberof EmailTrackingApi
562
810
  */
563
811
  public closeThread(requestParameters: EmailTrackingApiCloseThreadRequest, options?: AxiosRequestConfig) {
564
- return EmailTrackingApiFp(this.configuration).closeThread(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
812
+ return EmailTrackingApiFp(this.configuration).closeThread(requestParameters.code, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
565
813
  }
566
814
 
567
815
  /**
568
- * undefined **Required Permissions** \"notification-management.email-messages.view\"
816
+ * Retrieves the details of the email thread with the given code. **Required Permissions** \"notification-management.email-messages.view\"
817
+ * @summary Retrieve the email thread
569
818
  * @param {EmailTrackingApiGetThreadRequest} requestParameters Request parameters.
570
819
  * @param {*} [options] Override http request option.
571
820
  * @throws {RequiredError}
572
821
  * @memberof EmailTrackingApi
573
822
  */
574
823
  public getThread(requestParameters: EmailTrackingApiGetThreadRequest, options?: AxiosRequestConfig) {
575
- return EmailTrackingApiFp(this.configuration).getThread(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
824
+ return EmailTrackingApiFp(this.configuration).getThread(requestParameters.code, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
576
825
  }
577
826
 
578
827
  /**
579
- * Lists all email messages for a thread **Required Permissions** \"notification-management.email-messages.view\"
828
+ * Returns the email messages of the email thread with the given code. For more information about pagination, read the Pagination documentation. **Required Permissions** \"notification-management.email-messages.view\"
580
829
  * @summary List email messages
581
830
  * @param {EmailTrackingApiListMessagesRequest} requestParameters Request parameters.
582
831
  * @param {*} [options] Override http request option.
@@ -584,11 +833,11 @@ export class EmailTrackingApi extends BaseAPI {
584
833
  * @memberof EmailTrackingApi
585
834
  */
586
835
  public listMessages(requestParameters: EmailTrackingApiListMessagesRequest, options?: AxiosRequestConfig) {
587
- return EmailTrackingApiFp(this.configuration).listMessages(requestParameters.code, requestParameters.authorization, requestParameters.filter, requestParameters.filters, requestParameters.order, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
836
+ return EmailTrackingApiFp(this.configuration).listMessages(requestParameters.code, requestParameters.authorization, requestParameters.filter, requestParameters.filters, requestParameters.order, requestParameters.expand, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
588
837
  }
589
838
 
590
839
  /**
591
- * Lists all email threads with optional filters **Required Permissions** \"notification-management.email-messages.view\"
840
+ * Returns a list of email threads, newest first. A thread groups an email with its replies; each item carries the newest message of the thread in latestMessage and the number of messages in messageCount. Threads without a message yet are not listed. Filter on the newest message with latestDirection (inbox tabs), latestDeliveryStatus or latestWorkflowStatus (use latestWorkflowStatus==$null for threads whose newest message has no workflow). Add expand=messages to get every message of each thread, without bodies. For more information about pagination, read the Pagination documentation. **Required Permissions** \"notification-management.email-messages.view\"
592
841
  * @summary List email threads
593
842
  * @param {EmailTrackingApiListThreadsRequest} requestParameters Request parameters.
594
843
  * @param {*} [options] Override http request option.
@@ -596,6 +845,18 @@ export class EmailTrackingApi extends BaseAPI {
596
845
  * @memberof EmailTrackingApi
597
846
  */
598
847
  public listThreads(requestParameters: EmailTrackingApiListThreadsRequest = {}, options?: AxiosRequestConfig) {
599
- return EmailTrackingApiFp(this.configuration).listThreads(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then((request) => request(this.axios, this.basePath));
848
+ return EmailTrackingApiFp(this.configuration).listThreads(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
849
+ }
850
+
851
+ /**
852
+ * Removes the entity link from the email thread and every message in it, and marks the messages as unassigned. **Required Permissions** \"notification-management.email-messages.update\"
853
+ * @summary Unassign an email thread from its entity
854
+ * @param {EmailTrackingApiUnassignEntityRequest} requestParameters Request parameters.
855
+ * @param {*} [options] Override http request option.
856
+ * @throws {RequiredError}
857
+ * @memberof EmailTrackingApi
858
+ */
859
+ public unassignEntity(requestParameters: EmailTrackingApiUnassignEntityRequest, options?: AxiosRequestConfig) {
860
+ return EmailTrackingApiFp(this.configuration).unassignEntity(requestParameters.code, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
600
861
  }
601
862
  }