teleleo 0.0.0-stage → 0.2.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 (140) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/LICENSE +21 -0
  3. package/README.md +236 -2
  4. package/api.md +187 -0
  5. package/dist/client.d.ts +28 -0
  6. package/dist/client.d.ts.map +1 -0
  7. package/dist/client.js +27 -0
  8. package/dist/client.js.map +1 -0
  9. package/dist/core.d.ts +66 -0
  10. package/dist/core.d.ts.map +1 -0
  11. package/dist/core.js +195 -0
  12. package/dist/core.js.map +1 -0
  13. package/dist/errors.d.ts +92 -0
  14. package/dist/errors.d.ts.map +1 -0
  15. package/dist/errors.js +163 -0
  16. package/dist/errors.js.map +1 -0
  17. package/dist/index.d.ts +23 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +23 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/pagination.d.ts +41 -0
  22. package/dist/pagination.d.ts.map +1 -0
  23. package/dist/pagination.js +98 -0
  24. package/dist/pagination.js.map +1 -0
  25. package/dist/resource.d.ts +7 -0
  26. package/dist/resource.d.ts.map +1 -0
  27. package/dist/resource.js +8 -0
  28. package/dist/resource.js.map +1 -0
  29. package/dist/resources/call-scenarios.d.ts +77 -0
  30. package/dist/resources/call-scenarios.d.ts.map +1 -0
  31. package/dist/resources/call-scenarios.js +137 -0
  32. package/dist/resources/call-scenarios.js.map +1 -0
  33. package/dist/resources/calls.d.ts +69 -0
  34. package/dist/resources/calls.d.ts.map +1 -0
  35. package/dist/resources/calls.js +109 -0
  36. package/dist/resources/calls.js.map +1 -0
  37. package/dist/resources/contact-groups.d.ts +65 -0
  38. package/dist/resources/contact-groups.d.ts.map +1 -0
  39. package/dist/resources/contact-groups.js +99 -0
  40. package/dist/resources/contact-groups.js.map +1 -0
  41. package/dist/resources/contacts.d.ts +75 -0
  42. package/dist/resources/contacts.d.ts.map +1 -0
  43. package/dist/resources/contacts.js +132 -0
  44. package/dist/resources/contacts.js.map +1 -0
  45. package/dist/resources/dongles.d.ts +201 -0
  46. package/dist/resources/dongles.d.ts.map +1 -0
  47. package/dist/resources/dongles.js +296 -0
  48. package/dist/resources/dongles.js.map +1 -0
  49. package/dist/resources/files.d.ts +52 -0
  50. package/dist/resources/files.d.ts.map +1 -0
  51. package/dist/resources/files.js +73 -0
  52. package/dist/resources/files.js.map +1 -0
  53. package/dist/resources/follow-up-sms-settings.d.ts +65 -0
  54. package/dist/resources/follow-up-sms-settings.d.ts.map +1 -0
  55. package/dist/resources/follow-up-sms-settings.js +111 -0
  56. package/dist/resources/follow-up-sms-settings.js.map +1 -0
  57. package/dist/resources/index.d.ts +50 -0
  58. package/dist/resources/index.d.ts.map +1 -0
  59. package/dist/resources/index.js +36 -0
  60. package/dist/resources/index.js.map +1 -0
  61. package/dist/resources/mailings.d.ts +85 -0
  62. package/dist/resources/mailings.d.ts.map +1 -0
  63. package/dist/resources/mailings.js +191 -0
  64. package/dist/resources/mailings.js.map +1 -0
  65. package/dist/resources/public-vpn.d.ts +51 -0
  66. package/dist/resources/public-vpn.d.ts.map +1 -0
  67. package/dist/resources/public-vpn.js +67 -0
  68. package/dist/resources/public-vpn.js.map +1 -0
  69. package/dist/resources/redirections.d.ts +65 -0
  70. package/dist/resources/redirections.d.ts.map +1 -0
  71. package/dist/resources/redirections.js +113 -0
  72. package/dist/resources/redirections.js.map +1 -0
  73. package/dist/resources/sip-users.d.ts +30 -0
  74. package/dist/resources/sip-users.d.ts.map +1 -0
  75. package/dist/resources/sip-users.js +40 -0
  76. package/dist/resources/sip-users.js.map +1 -0
  77. package/dist/resources/sms.d.ts +116 -0
  78. package/dist/resources/sms.d.ts.map +1 -0
  79. package/dist/resources/sms.js +203 -0
  80. package/dist/resources/sms.js.map +1 -0
  81. package/dist/resources/socks-proxies.d.ts +65 -0
  82. package/dist/resources/socks-proxies.d.ts.map +1 -0
  83. package/dist/resources/socks-proxies.js +91 -0
  84. package/dist/resources/socks-proxies.js.map +1 -0
  85. package/dist/resources/ussd.d.ts +71 -0
  86. package/dist/resources/ussd.d.ts.map +1 -0
  87. package/dist/resources/ussd.js +89 -0
  88. package/dist/resources/ussd.js.map +1 -0
  89. package/dist/types/enums.d.ts +280 -0
  90. package/dist/types/enums.d.ts.map +1 -0
  91. package/dist/types/enums.js +233 -0
  92. package/dist/types/enums.js.map +1 -0
  93. package/dist/types/index.d.ts +4 -0
  94. package/dist/types/index.d.ts.map +1 -0
  95. package/dist/types/index.js +5 -0
  96. package/dist/types/index.js.map +1 -0
  97. package/dist/types/models.d.ts +686 -0
  98. package/dist/types/models.d.ts.map +1 -0
  99. package/dist/types/models.js +3 -0
  100. package/dist/types/models.js.map +1 -0
  101. package/dist/types/params.d.ts +711 -0
  102. package/dist/types/params.d.ts.map +1 -0
  103. package/dist/types/params.js +3 -0
  104. package/dist/types/params.js.map +1 -0
  105. package/dist/utils.d.ts +32 -0
  106. package/dist/utils.d.ts.map +1 -0
  107. package/dist/utils.js +118 -0
  108. package/dist/utils.js.map +1 -0
  109. package/dist/version.d.ts +2 -0
  110. package/dist/version.d.ts.map +1 -0
  111. package/dist/version.js +2 -0
  112. package/dist/version.js.map +1 -0
  113. package/package.json +63 -4
  114. package/src/client.ts +42 -0
  115. package/src/core.ts +278 -0
  116. package/src/errors.ts +170 -0
  117. package/src/index.ts +46 -0
  118. package/src/pagination.ts +110 -0
  119. package/src/resource.ts +10 -0
  120. package/src/resources/call-scenarios.ts +154 -0
  121. package/src/resources/calls.ts +117 -0
  122. package/src/resources/contact-groups.ts +115 -0
  123. package/src/resources/contacts.ts +149 -0
  124. package/src/resources/dongles.ts +346 -0
  125. package/src/resources/files.ts +79 -0
  126. package/src/resources/follow-up-sms-settings.ts +130 -0
  127. package/src/resources/index.ts +86 -0
  128. package/src/resources/mailings.ts +207 -0
  129. package/src/resources/public-vpn.ts +72 -0
  130. package/src/resources/redirections.ts +129 -0
  131. package/src/resources/sip-users.ts +44 -0
  132. package/src/resources/sms.ts +232 -0
  133. package/src/resources/socks-proxies.ts +107 -0
  134. package/src/resources/ussd.ts +97 -0
  135. package/src/types/enums.ts +300 -0
  136. package/src/types/index.ts +5 -0
  137. package/src/types/models.ts +747 -0
  138. package/src/types/params.ts +767 -0
  139. package/src/utils.ts +123 -0
  140. package/src/version.ts +1 -0
@@ -0,0 +1,296 @@
1
+ // File generated from spec/openapi.yaml by scripts/generate.mjs. Do not edit by hand.
2
+ import { APIResource } from '../resource.js';
3
+ import { asArray, asResult, asStatus, pathParam } from '../utils.js';
4
+ /** Modems of the account and their commands: reboot, Wi-Fi, Wi-Fi extender, number, network info. */
5
+ export class DonglesResource extends APIResource {
6
+ /**
7
+ * List modems.
8
+ *
9
+ * Modems of the account. In full mode every field of the Dongle schema that the list serves is returned; dongle_setting and public_vpn_server are present in full mode only. The cheapest call is GET /dongle?is_short=1&limit=1: use it to check that an API key works. Newest first by default (created_at descending, then the id descending).
10
+ *
11
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION.
12
+ *
13
+ * Capability the role of an organization API key needs: `device.view`.
14
+ */
15
+ list(params = {}, options) {
16
+ return this._client.getPage('/dongle', {
17
+ query: {
18
+ page: params.page,
19
+ limit: params.limit,
20
+ 'dongle_ids[]': params.dongle_ids,
21
+ order_by: params.order_by,
22
+ order: params.order,
23
+ is_active: params.is_active,
24
+ is_short: params.is_short,
25
+ is_tariff_package_active: params.is_tariff_package_active,
26
+ is_tariff_package_enabled: params.is_tariff_package_enabled,
27
+ 'dongle_call_type_ids[]': params.dongle_call_type_ids,
28
+ name: params.name,
29
+ number: params.number,
30
+ },
31
+ itemKey: 'dongles',
32
+ options,
33
+ });
34
+ }
35
+ /**
36
+ * Reboot modem.
37
+ *
38
+ * 200 means the reboot is accepted, not done: dongle_online_status becomes 7 (REBOOTING) at once and goes back to an online or offline status when the modem returns. A repeated call while a reboot is in progress (about 180 s for the API stage, then the SMS stage) is a no-op that also answers 200. The reboot is accepted regardless of the subscription and of the online state; track progress through dongle_online_status in GET /dongle or GET /dongle/{dongle_id}.
39
+ *
40
+ * @param dongleId - Identifier in the path
41
+ *
42
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION.
43
+ *
44
+ * Capability the role of an organization API key needs: `device.manage`.
45
+ */
46
+ reboot(dongleId, options) {
47
+ return this._client.request('POST', `/dongle/${pathParam(dongleId)}/reboot`, { options }).then(asStatus);
48
+ }
49
+ /**
50
+ * List devices on modem Wi-Fi.
51
+ *
52
+ * Devices connected to the Wi-Fi hotspot of the modem. The modem is asked only when this is called; its answer, a failure included, is kept for 20 seconds: a call within that time gets it without asking the modem again, and updated_at tells when the modem answered. Turning Wi-Fi on or off and new Wi-Fi credentials drop the kept answer. The computer on USB is not in the list. Available from modem firmware 4.5.8; older firmware answers 409 DONGLE_WIFI_CLIENT_LIST_NOT_SUPPORTED_EXCEPTION.
53
+ *
54
+ * @param dongleId - ID of the dongle
55
+ *
56
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_WIFI_CLIENT_LIST_DONGLE_OFFLINE_EXCEPTION, DONGLE_WIFI_CLIENT_LIST_DONGLE_BUSY_EXCEPTION, DONGLE_WIFI_CLIENT_LIST_NOT_SUPPORTED_EXCEPTION, DONGLE_WIFI_CLIENT_LIST_DONGLE_UNAVAILABLE_EXCEPTION.
57
+ *
58
+ * Capability the role of an organization API key needs: `network.view`.
59
+ *
60
+ * Needs modem firmware 4.5.8 or later.
61
+ */
62
+ getWifiClients(dongleId, options) {
63
+ return this._client
64
+ .request('GET', `/dongle/${pathParam(dongleId)}/wifi/clients`, { options })
65
+ .then((data) => data);
66
+ }
67
+ /**
68
+ * Enable modem Wi-Fi.
69
+ *
70
+ * Turns the Wi-Fi hotspot of the modem on; the modem must be online. Answers {"status": true} when the command is accepted; is_hotspot_enable in GET /dongle/{dongle_id} follows once the modem applied it.
71
+ *
72
+ * @param dongleId - ID of the dongle
73
+ *
74
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_WIFI_ALREADY_IN_THE_SAME_STATUS_EXCEPTION, DONGLE_API_CONNECTION_EXCEPTION, DONGLE_API_HTTP_RESPONSE_EXCEPTION.
75
+ *
76
+ * Capability the role of an organization API key needs: `device.manage`.
77
+ */
78
+ enableWifi(dongleId, options) {
79
+ return this._client
80
+ .request('POST', `/dongle/${pathParam(dongleId)}/wifi/enable`, { options })
81
+ .then(asStatus);
82
+ }
83
+ /**
84
+ * Disable modem Wi-Fi.
85
+ *
86
+ * Turns the Wi-Fi hotspot of the modem off; the modem must be online. Answers {"status": true} when the command is accepted.
87
+ *
88
+ * @param dongleId - ID of the dongle
89
+ *
90
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_WIFI_ALREADY_IN_THE_SAME_STATUS_EXCEPTION, DONGLE_API_CONNECTION_EXCEPTION, DONGLE_API_HTTP_RESPONSE_EXCEPTION.
91
+ *
92
+ * Capability the role of an organization API key needs: `device.manage`.
93
+ */
94
+ disableWifi(dongleId, options) {
95
+ return this._client
96
+ .request('POST', `/dongle/${pathParam(dongleId)}/wifi/disable`, { options })
97
+ .then(asStatus);
98
+ }
99
+ /**
100
+ * Set modem Wi-Fi credentials.
101
+ *
102
+ * Sets the name and the password of the Wi-Fi hotspot of the modem.
103
+ *
104
+ * @param dongleId - ID of the dongle
105
+ *
106
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_WIFI_INVALID_SSID_EXCEPTION, DONGLE_WIFI_INVALID_PASSWORD_EXCEPTION, DONGLE_WIFI_API_EXCEPTION.
107
+ *
108
+ * Capability the role of an organization API key needs: `device.manage`.
109
+ */
110
+ setWifiCredentials(dongleId, params, options) {
111
+ return this._client
112
+ .request('POST', `/dongle/${pathParam(dongleId)}/wifi/credentials`, {
113
+ body: { hotspot_name: params.hotspot_name, hotspot_password: params.hotspot_password },
114
+ options,
115
+ })
116
+ .then(asStatus);
117
+ }
118
+ /**
119
+ * Enable Wi-Fi extender.
120
+ *
121
+ * Connects the modem to an external Wi-Fi network as a client (extender mode); the modem must be online. is_wifi_extender_processing is true in GET /dongle while the modem applies the command.
122
+ *
123
+ * @param dongleId - ID of the dongle
124
+ *
125
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, DONGLE_WIFI_EXTENDER_LOCKED_EXCEPTION, DONGLE_API_CONNECTION_EXCEPTION, DONGLE_API_HTTP_RESPONSE_EXCEPTION.
126
+ *
127
+ * Capability the role of an organization API key needs: `device.manage`.
128
+ */
129
+ enableWifiExtender(dongleId, params, options) {
130
+ return this._client
131
+ .request('POST', `/dongle/${pathParam(dongleId)}/wifi-extender/enable`, {
132
+ body: { ssid: params.ssid, password: params.password, wifi_extender_mode: params.wifi_extender_mode },
133
+ options,
134
+ })
135
+ .then(asStatus);
136
+ }
137
+ /**
138
+ * Disable Wi-Fi extender.
139
+ *
140
+ * Disconnects the modem from the external Wi-Fi network; the modem must be online.
141
+ *
142
+ * @param dongleId - ID of the dongle
143
+ *
144
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_WIFI_EXTENDER_LOCKED_EXCEPTION, DONGLE_API_CONNECTION_EXCEPTION, DONGLE_API_HTTP_RESPONSE_EXCEPTION.
145
+ *
146
+ * Capability the role of an organization API key needs: `device.manage`.
147
+ */
148
+ disableWifiExtender(dongleId, options) {
149
+ return this._client
150
+ .request('POST', `/dongle/${pathParam(dongleId)}/wifi-extender/disable`, { options })
151
+ .then(asStatus);
152
+ }
153
+ /**
154
+ * Scan Wi-Fi networks.
155
+ *
156
+ * Asks the modem to scan the Wi-Fi networks around it; the modem must be online.
157
+ *
158
+ * @param dongleId - ID of the dongle
159
+ *
160
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, DONGLE_API_CONNECTION_EXCEPTION, DONGLE_API_HTTP_RESPONSE_EXCEPTION.
161
+ *
162
+ * Capability the role of an organization API key needs: `device.manage`.
163
+ */
164
+ scanWifiNetworks(dongleId, options) {
165
+ return this._client
166
+ .request('POST', `/dongle/${pathParam(dongleId)}/wifi-extender/networks`, { options })
167
+ .then(asStatus);
168
+ }
169
+ /**
170
+ * Set offline notification.
171
+ *
172
+ * Turns the e-mail to the owner about the modem going offline on or off; shown as dongle_setting.is_offline_notification_enabled in GET /dongle.
173
+ *
174
+ * @param dongleId - ID of the dongle
175
+ *
176
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_SETTING_NOT_FOUND.
177
+ *
178
+ * Capability the role of an organization API key needs: `device.manage`.
179
+ */
180
+ updateOfflineNotification(dongleId, params, options) {
181
+ return this._client
182
+ .request('PUT', `/dongle/${pathParam(dongleId)}/setting/offline-notification`, {
183
+ body: { is_enabled: params.is_enabled },
184
+ options,
185
+ })
186
+ .then(asStatus);
187
+ }
188
+ /**
189
+ * Set modem number.
190
+ *
191
+ * Accepted asynchronously: the number is verified through the dongle and stored on success; 200 means queued.
192
+ *
193
+ * @param dongleId - ID of the dongle
194
+ *
195
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_MANUAL_PHONE_DETERMINATION_NUMBER_EXCEPTION, DONGLE_MANUAL_PHONE_DETERMINATION_ALREADY_IN_PROGRESS_EXCEPTION.
196
+ *
197
+ * Capability the role of an organization API key needs: `device.manage`.
198
+ */
199
+ setNumber(dongleId, params, options) {
200
+ return this._client
201
+ .request('PUT', `/dongle/${pathParam(dongleId)}/number`, { body: { number: params.number }, options })
202
+ .then(asStatus);
203
+ }
204
+ /**
205
+ * Get modem.
206
+ *
207
+ * One modem of the account with its counters and hardware identity.
208
+ *
209
+ * @param dongleId - Identifier in the path
210
+ *
211
+ * Error codes (`errorMessage`): DONGLE_ERROR_DONGLE_NOT_FOUND.
212
+ *
213
+ * Capability the role of an organization API key needs: `device.view`.
214
+ */
215
+ get(dongleId, options) {
216
+ return this._client
217
+ .request('GET', `/dongle/${pathParam(dongleId)}`, { options })
218
+ .then((data) => data);
219
+ }
220
+ /**
221
+ * Update modem.
222
+ *
223
+ * Only the listed body fields are read; unknown fields are ignored. An omitted field keeps its value. The billing fields tariff_package_id, is_tariff_package_enabled, order_dongle_id, is_deleted and is_active and the field imei_fake are outside the public API: a body with any of them is refused as a whole with 403 PUBLIC_API_FIELD_FORBIDDEN.
224
+ *
225
+ * @param dongleId - Identifier in the path
226
+ *
227
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_ERROR_DONGLE_NOT_FOUND, PUBLIC_API_FIELD_FORBIDDEN.
228
+ *
229
+ * Capability the role of an organization API key needs: `device.manage`.
230
+ */
231
+ update(dongleId, params = {}, options) {
232
+ return this._client
233
+ .request('PUT', `/dongle/${pathParam(dongleId)}`, {
234
+ body: {
235
+ name: params.name,
236
+ number: params.number,
237
+ is_mute_incoming_call: params.is_mute_incoming_call,
238
+ dongle_call_type_id: params.dongle_call_type_id,
239
+ },
240
+ options,
241
+ })
242
+ .then((data) => data);
243
+ }
244
+ /**
245
+ * Get modem network info.
246
+ *
247
+ * Asks the online modem for its radio state and returns it in the answer: networks, roaming, network type and signal. DONGLE_MANAGEMENT_API_ERROR_IDENTIFIER_HTTP_RESPONSE and DONGLE_MANAGEMENT_API_ERROR_IDENTIFIER_INVALID_CONTENT mean the modem did not answer or answered malformed data: a temporary state, the request can be repeated.
248
+ *
249
+ * @param dongleId - Identifier in the path
250
+ *
251
+ * Error codes (`errorMessage`): DONGLE_ERROR_DONGLE_NOT_FOUND, DONGLE_MANAGEMENT_API_ERROR_IDENTIFIER_HTTP_RESPONSE, DONGLE_MANAGEMENT_API_ERROR_IDENTIFIER_INVALID_CONTENT.
252
+ *
253
+ * Capability the role of an organization API key needs: `device.view`.
254
+ */
255
+ getNetworkInfo(dongleId, options) {
256
+ return this._client
257
+ .request('POST', `/dongle/${pathParam(dongleId)}/mobile-network-info`, { options })
258
+ .then((data) => asResult(data));
259
+ }
260
+ /**
261
+ * Get modem SIM identifiers.
262
+ *
263
+ * Asks the online modem for the identifiers of its SIM card and returns them in the answer. DONGLE_MANAGEMENT_API_ERROR_IDENTIFIER_HTTP_RESPONSE and DONGLE_MANAGEMENT_API_ERROR_IDENTIFIER_INVALID_CONTENT mean the modem did not answer or answered malformed data: a temporary state, the request can be repeated.
264
+ *
265
+ * @param dongleId - Identifier in the path
266
+ *
267
+ * Error codes (`errorMessage`): DONGLE_ERROR_DONGLE_NOT_FOUND, DONGLE_MANAGEMENT_API_ERROR_IDENTIFIER_HTTP_RESPONSE, DONGLE_MANAGEMENT_API_ERROR_IDENTIFIER_INVALID_CONTENT.
268
+ *
269
+ * Capability the role of an organization API key needs: `device.view`.
270
+ */
271
+ getSimIdentifiers(dongleId, options) {
272
+ return this._client
273
+ .request('POST', `/dongle/${pathParam(dongleId)}/mobile-network-ids`, { options })
274
+ .then((data) => asResult(data));
275
+ }
276
+ /**
277
+ * List modem traffic statistics.
278
+ *
279
+ * Traffic samples of the modem: read and write are the byte counters reported for the sample taken at time. Oldest first: sorted by time ascending. Without from and to the whole history is returned.
280
+ *
281
+ * @param dongleId - Identifier in the path
282
+ *
283
+ * Error codes (`errorMessage`): PARSING_DATE_TIME_EXCEPTION, DONGLE_ERROR_DONGLE_NOT_FOUND.
284
+ *
285
+ * Capability the role of an organization API key needs: `device.view`.
286
+ */
287
+ listStatistics(dongleId, params = {}, options) {
288
+ return this._client
289
+ .request('GET', `/dongle/${pathParam(dongleId)}/statistic`, {
290
+ query: { from: params.from, to: params.to },
291
+ options,
292
+ })
293
+ .then((data) => asArray(data));
294
+ }
295
+ }
296
+ //# sourceMappingURL=dongles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dongles.js","sourceRoot":"","sources":["../../src/resources/dongles.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAItF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAkB7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACrE,qGAAqG;AACrG,MAAM,OAAO,eAAgB,SAAQ,WAAW;IAC9C;;;;;;;;OAQG;IACH,IAAI,CAAC,SAA4B,EAAE,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAiB,SAAS,EAAE;YACrD,KAAK,EAAE;gBACL,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,cAAc,EAAE,MAAM,CAAC,UAAU;gBACjC,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,wBAAwB,EAAE,MAAM,CAAC,wBAAwB;gBACzD,yBAAyB,EAAE,MAAM,CAAC,yBAAyB;gBAC3D,wBAAwB,EAAE,MAAM,CAAC,oBAAoB;gBACrD,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,MAAM,EAAE,MAAM,CAAC,MAAM;aACtB;YACD,OAAO,EAAE,SAAS;YAClB,OAAO;SACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO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,QAAQ,CAAC,IAAI,CAAsB,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;;;;;OAUG;IACH,iBAAiB,CAAC,QAAgB,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO;aAChB,OAAO,CAAC,MAAM,EAAE,WAAW,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,EAAE,OAAO,EAAE,CAAC;aACjF,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAyB,CAAC,CAAC;IAC5D,CAAC;IAED;;;;;;;;;;OAUG;IACH,cAAc,CACZ,QAAgB,EAChB,SAAsC,EAAE,EACxC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO;aAChB,OAAO,CAAC,KAAK,EAAE,WAAW,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE;YAC1D,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE;YAC3C,OAAO;SACR,CAAC;aACD,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAA2B,CAAC,CAAC;IAC7D,CAAC;CACF"}
@@ -0,0 +1,52 @@
1
+ import type { RequestOptions } from '../core.js';
2
+ import { APIResource } from '../resource.js';
3
+ import type { TmpFile } from '../types/models.js';
4
+ import type { FilesGenerateSpeechParams, FilesUploadTmpParams } from '../types/params.js';
5
+ /** Downloads, temporary audio uploads and text-to-speech. */
6
+ export declare class FilesResource extends APIResource {
7
+ /**
8
+ * Get file.
9
+ *
10
+ * Downloads a file of the account: a call recording, or the audio of a call scenario or a mailing. The file_id comes from those objects (file_id, call_scenario_file_id).
11
+ *
12
+ * @param fileId -
13
+ *
14
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, FILE_NOT_FOUND_EXCEPTION.
15
+ *
16
+ * Capability the role of an organization API key needs: `device.view`.
17
+ */
18
+ download(fileId: number, options?: RequestOptions): Promise<Uint8Array>;
19
+ /**
20
+ * Get temporary file.
21
+ *
22
+ * Served only to the user who uploaded the file. A missing file and somebody else's upload both answer 404 TMP_FILE_NOT_FOUND.
23
+ *
24
+ * @param fileId - tmp_file_id as returned by POST /file/upload-tmp or POST /file/generate-speech: `<2 hex>/<32 hex>/<file name>`. Put it into the path as is: the slashes are path separators and must not be percent-encoded (most SDK generators encode `/` in a path parameter by default; turn it off for this one). Percent-encode only characters of the file name that are not allowed in a path segment.
25
+ *
26
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, TMP_FILE_NOT_FOUND.
27
+ *
28
+ * Capability the role of an organization API key needs: `automation.manage`.
29
+ */
30
+ downloadTmp(fileId: string, options?: RequestOptions): Promise<Uint8Array>;
31
+ /**
32
+ * Upload temporary file.
33
+ *
34
+ * Uploads an audio file as a temporary file, converted to the modem format; pass the returned tmp_file_id to a call scenario or a call mailing.
35
+ *
36
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, FILE_ERROR_IDENTIFIER_EMPTY_FIELDS, FILE_ERROR_FILE_NOT_VALID_BASE_64, FILE_ERROR_FILE_WRONG_TYPE, FILE_ERROR_FILE_NOT_VALID_SIZE, FILE_ERROR_CONVERT_TO_DONGLE_AUDIO, FILE_ERROR_DONGLE_AUDIO_TOO_LARGE, FILE_ERROR_IDENTIFIER_UNKNOWN_SCENARIO.
37
+ *
38
+ * Capability the role of an organization API key needs: `automation.manage`.
39
+ */
40
+ uploadTmp(params: FilesUploadTmpParams, options?: RequestOptions): Promise<TmpFile>;
41
+ /**
42
+ * Generate speech.
43
+ *
44
+ * Synthesises the text into a temporary audio file for a call scenario or a call mailing; pass the returned tmp_file_id as the audio of those. Limited to 5 calls per day per account, per organization for an organization API key: the 6th answers 429 RATE_LIMIT_EXCEEDED.
45
+ *
46
+ * Error codes (`errorMessage`): RATE_LIMIT_EXCEEDED, FILE_GENERATE_SPEECH_IDENTIFIER_EMPTY_FIELDS, FILE_GENERATE_SPEECH_IDENTIFIER_NOT_ALLOWED_VOICE, FILE_GENERATE_SPEECH_IDENTIFIER_NOT_ALLOWED_LANGUAGE, FILE_GENERATE_SPEECH_IDENTIFIER_LONG_TEXT.
47
+ *
48
+ * Capability the role of an organization API key needs: `automation.manage`.
49
+ */
50
+ generateSpeech(params: FilesGenerateSpeechParams, options?: RequestOptions): Promise<TmpFile>;
51
+ }
52
+ //# sourceMappingURL=files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/resources/files.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1F,6DAA6D;AAC7D,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAIvE;;;;;;;;;;OAUG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAI1E;;;;;;;;OAQG;IACH,SAAS,CAAC,MAAM,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAanF;;;;;;;;OAQG;IACH,cAAc,CAAC,MAAM,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;CAQ9F"}
@@ -0,0 +1,73 @@
1
+ // File generated from spec/openapi.yaml by scripts/generate.mjs. Do not edit by hand.
2
+ import { APIResource } from '../resource.js';
3
+ import { pathParam } from '../utils.js';
4
+ /** Downloads, temporary audio uploads and text-to-speech. */
5
+ export class FilesResource extends APIResource {
6
+ /**
7
+ * Get file.
8
+ *
9
+ * Downloads a file of the account: a call recording, or the audio of a call scenario or a mailing. The file_id comes from those objects (file_id, call_scenario_file_id).
10
+ *
11
+ * @param fileId -
12
+ *
13
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, FILE_NOT_FOUND_EXCEPTION.
14
+ *
15
+ * Capability the role of an organization API key needs: `device.view`.
16
+ */
17
+ download(fileId, options) {
18
+ return this._client.requestBytes('GET', `/file/${pathParam(fileId)}`, { options });
19
+ }
20
+ /**
21
+ * Get temporary file.
22
+ *
23
+ * Served only to the user who uploaded the file. A missing file and somebody else's upload both answer 404 TMP_FILE_NOT_FOUND.
24
+ *
25
+ * @param fileId - tmp_file_id as returned by POST /file/upload-tmp or POST /file/generate-speech: `<2 hex>/<32 hex>/<file name>`. Put it into the path as is: the slashes are path separators and must not be percent-encoded (most SDK generators encode `/` in a path parameter by default; turn it off for this one). Percent-encode only characters of the file name that are not allowed in a path segment.
26
+ *
27
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, TMP_FILE_NOT_FOUND.
28
+ *
29
+ * Capability the role of an organization API key needs: `automation.manage`.
30
+ */
31
+ downloadTmp(fileId, options) {
32
+ return this._client.requestBytes('GET', `/file/tmp/${pathParam(fileId, true)}`, { options });
33
+ }
34
+ /**
35
+ * Upload temporary file.
36
+ *
37
+ * Uploads an audio file as a temporary file, converted to the modem format; pass the returned tmp_file_id to a call scenario or a call mailing.
38
+ *
39
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, FILE_ERROR_IDENTIFIER_EMPTY_FIELDS, FILE_ERROR_FILE_NOT_VALID_BASE_64, FILE_ERROR_FILE_WRONG_TYPE, FILE_ERROR_FILE_NOT_VALID_SIZE, FILE_ERROR_CONVERT_TO_DONGLE_AUDIO, FILE_ERROR_DONGLE_AUDIO_TOO_LARGE, FILE_ERROR_IDENTIFIER_UNKNOWN_SCENARIO.
40
+ *
41
+ * Capability the role of an organization API key needs: `automation.manage`.
42
+ */
43
+ uploadTmp(params, options) {
44
+ return this._client
45
+ .request('POST', '/file/upload-tmp', {
46
+ body: {
47
+ file_base64: params.file_base64,
48
+ file_name: params.file_name,
49
+ scenario: params.scenario ?? 'SCENARIO_CONVERT_TO_DONGLE_AUDIO_AND_UPLOAD_TMP',
50
+ },
51
+ options,
52
+ })
53
+ .then((data) => data);
54
+ }
55
+ /**
56
+ * Generate speech.
57
+ *
58
+ * Synthesises the text into a temporary audio file for a call scenario or a call mailing; pass the returned tmp_file_id as the audio of those. Limited to 5 calls per day per account, per organization for an organization API key: the 6th answers 429 RATE_LIMIT_EXCEEDED.
59
+ *
60
+ * Error codes (`errorMessage`): RATE_LIMIT_EXCEEDED, FILE_GENERATE_SPEECH_IDENTIFIER_EMPTY_FIELDS, FILE_GENERATE_SPEECH_IDENTIFIER_NOT_ALLOWED_VOICE, FILE_GENERATE_SPEECH_IDENTIFIER_NOT_ALLOWED_LANGUAGE, FILE_GENERATE_SPEECH_IDENTIFIER_LONG_TEXT.
61
+ *
62
+ * Capability the role of an organization API key needs: `automation.manage`.
63
+ */
64
+ generateSpeech(params, options) {
65
+ return this._client
66
+ .request('POST', '/file/generate-speech', {
67
+ body: { text: params.text, voice: params.voice, language: params.language },
68
+ options,
69
+ })
70
+ .then((data) => data);
71
+ }
72
+ }
73
+ //# sourceMappingURL=files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/resources/files.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAGtF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,6DAA6D;AAC7D,MAAM,OAAO,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,MAAc,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,EAAE,SAAS,SAAS,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;;;;;OAUG;IACH,WAAW,CAAC,MAAc,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,EAAE,aAAa,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/F,CAAC;IAED;;;;;;;;OAQG;IACH,SAAS,CAAC,MAA4B,EAAE,OAAwB;QAC9D,OAAO,IAAI,CAAC,OAAO;aAChB,OAAO,CAAC,MAAM,EAAE,kBAAkB,EAAE;YACnC,IAAI,EAAE;gBACJ,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,iDAAiD;aAC/E;YACD,OAAO;SACR,CAAC;aACD,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAe,CAAC,CAAC;IACrC,CAAC;IAED;;;;;;;;OAQG;IACH,cAAc,CAAC,MAAiC,EAAE,OAAwB;QACxE,OAAO,IAAI,CAAC,OAAO;aAChB,OAAO,CAAC,MAAM,EAAE,uBAAuB,EAAE;YACxC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE;YAC3E,OAAO;SACR,CAAC;aACD,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAe,CAAC,CAAC;IACrC,CAAC;CACF"}
@@ -0,0 +1,65 @@
1
+ import type { RequestOptions } from '../core.js';
2
+ import type { PagePromise } from '../pagination.js';
3
+ import { APIResource } from '../resource.js';
4
+ import type { FollowUpSmsSetting } from '../types/models.js';
5
+ import type { FollowUpSmsSettingsCreateParams, FollowUpSmsSettingsListParams, FollowUpSmsSettingsUpdateParams } from '../types/params.js';
6
+ /** SMS a modem sends to a caller after a call. */
7
+ export declare class FollowUpSmsSettingsResource extends APIResource {
8
+ /**
9
+ * List follow-up SMS settings.
10
+ *
11
+ * Follow-up SMS settings of the account: the SMS a modem sends to a caller after a call. Newest first by default (the id descending).
12
+ *
13
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION.
14
+ *
15
+ * Capability the role of an organization API key needs: `automation.view`.
16
+ */
17
+ list(params?: FollowUpSmsSettingsListParams, options?: RequestOptions): PagePromise<FollowUpSmsSetting>;
18
+ /**
19
+ * Create follow-up SMS setting.
20
+ *
21
+ * Creates a follow-up SMS setting for a modem.
22
+ *
23
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, INVALID_DONGLE_TYPE, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, INVALID_RINGING_DURATION_TIMEOUT, INVALID_CALL_DURATION_TIMEOUT, INVALID_DAILY_SMS_LIMIT, DUPLICATE_DONGLE_FOLLOW_UP_SMS_SETTING, SMS_ERROR_IDENTIFIER_EMPTY_MESSAGE.
24
+ *
25
+ * Capability the role of an organization API key needs: `automation.manage`.
26
+ */
27
+ create(params: FollowUpSmsSettingsCreateParams, options?: RequestOptions): Promise<FollowUpSmsSetting>;
28
+ /**
29
+ * Get follow-up SMS setting.
30
+ *
31
+ * One follow-up SMS setting of the account.
32
+ *
33
+ * @param followUpSmsSettingId - Follow Up Sms Setting ID
34
+ *
35
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, FOLLOW_UP_SMS_SETTING_NOT_FOUND_EXCEPTION.
36
+ *
37
+ * Capability the role of an organization API key needs: `automation.view`.
38
+ */
39
+ get(followUpSmsSettingId: number, options?: RequestOptions): Promise<FollowUpSmsSetting>;
40
+ /**
41
+ * Update follow-up SMS setting.
42
+ *
43
+ * Replaces the follow-up SMS setting.
44
+ *
45
+ * @param followUpSmsSettingId - Follow-up SMS setting ID
46
+ *
47
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, FOLLOW_UP_SMS_SETTING_NOT_FOUND_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, INVALID_DONGLE_TYPE, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, INVALID_RINGING_DURATION_TIMEOUT, INVALID_CALL_DURATION_TIMEOUT, INVALID_DAILY_SMS_LIMIT, DUPLICATE_DONGLE_FOLLOW_UP_SMS_SETTING, SMS_ERROR_IDENTIFIER_EMPTY_MESSAGE.
48
+ *
49
+ * Capability the role of an organization API key needs: `automation.manage`.
50
+ */
51
+ update(followUpSmsSettingId: number, params: FollowUpSmsSettingsUpdateParams, options?: RequestOptions): Promise<FollowUpSmsSetting>;
52
+ /**
53
+ * Delete follow-up SMS setting.
54
+ *
55
+ * Deletes the follow-up SMS setting.
56
+ *
57
+ * @param followUpSmsSettingId - Follow-up SMS setting ID
58
+ *
59
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, FOLLOW_UP_SMS_SETTING_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
60
+ *
61
+ * Capability the role of an organization API key needs: `automation.manage`.
62
+ */
63
+ delete(followUpSmsSettingId: number, options?: RequestOptions): Promise<boolean>;
64
+ }
65
+ //# sourceMappingURL=follow-up-sms-settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"follow-up-sms-settings.d.ts","sourceRoot":"","sources":["../../src/resources/follow-up-sms-settings.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EACV,+BAA+B,EAC/B,6BAA6B,EAC7B,+BAA+B,EAChC,MAAM,oBAAoB,CAAC;AAE5B,kDAAkD;AAClD,qBAAa,2BAA4B,SAAQ,WAAW;IAC1D;;;;;;;;OAQG;IACH,IAAI,CACF,MAAM,GAAE,6BAAkC,EAC1C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,kBAAkB,CAAC;IAclC;;;;;;;;OAQG;IACH,MAAM,CAAC,MAAM,EAAE,+BAA+B,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAgBtG;;;;;;;;;;OAUG;IACH,GAAG,CAAC,oBAAoB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAMxF;;;;;;;;;;OAUG;IACH,MAAM,CACJ,oBAAoB,EAAE,MAAM,EAC5B,MAAM,EAAE,+BAA+B,EACvC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,kBAAkB,CAAC;IAgB9B;;;;;;;;;;OAUG;IACH,MAAM,CAAC,oBAAoB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;CAKjF"}
@@ -0,0 +1,111 @@
1
+ // File generated from spec/openapi.yaml by scripts/generate.mjs. Do not edit by hand.
2
+ import { APIResource } from '../resource.js';
3
+ import { asStatus, pathParam } from '../utils.js';
4
+ /** SMS a modem sends to a caller after a call. */
5
+ export class FollowUpSmsSettingsResource extends APIResource {
6
+ /**
7
+ * List follow-up SMS settings.
8
+ *
9
+ * Follow-up SMS settings of the account: the SMS a modem sends to a caller after a call. Newest first by default (the id descending).
10
+ *
11
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION.
12
+ *
13
+ * Capability the role of an organization API key needs: `automation.view`.
14
+ */
15
+ list(params = {}, options) {
16
+ return this._client.getPage('/follow-up-sms-setting', {
17
+ query: {
18
+ 'dongle_ids[]': params.dongle_ids,
19
+ page: params.page,
20
+ limit: params.limit,
21
+ order_by: params.order_by,
22
+ order: params.order,
23
+ },
24
+ itemKey: 'follow_up_sms_settings',
25
+ options,
26
+ });
27
+ }
28
+ /**
29
+ * Create follow-up SMS setting.
30
+ *
31
+ * Creates a follow-up SMS setting for a modem.
32
+ *
33
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, INVALID_DONGLE_TYPE, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, INVALID_RINGING_DURATION_TIMEOUT, INVALID_CALL_DURATION_TIMEOUT, INVALID_DAILY_SMS_LIMIT, DUPLICATE_DONGLE_FOLLOW_UP_SMS_SETTING, SMS_ERROR_IDENTIFIER_EMPTY_MESSAGE.
34
+ *
35
+ * Capability the role of an organization API key needs: `automation.manage`.
36
+ */
37
+ create(params, options) {
38
+ return this._client
39
+ .request('POST', '/follow-up-sms-setting', {
40
+ body: {
41
+ dongle_id: params.dongle_id,
42
+ name: params.name,
43
+ text: params.text,
44
+ ringing_duration_timeout: params.ringing_duration_timeout,
45
+ call_duration_timeout: params.call_duration_timeout,
46
+ daily_sms_limit: params.daily_sms_limit,
47
+ },
48
+ options,
49
+ })
50
+ .then((data) => data);
51
+ }
52
+ /**
53
+ * Get follow-up SMS setting.
54
+ *
55
+ * One follow-up SMS setting of the account.
56
+ *
57
+ * @param followUpSmsSettingId - Follow Up Sms Setting ID
58
+ *
59
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, FOLLOW_UP_SMS_SETTING_NOT_FOUND_EXCEPTION.
60
+ *
61
+ * Capability the role of an organization API key needs: `automation.view`.
62
+ */
63
+ get(followUpSmsSettingId, options) {
64
+ return this._client
65
+ .request('GET', `/follow-up-sms-setting/${pathParam(followUpSmsSettingId)}`, { options })
66
+ .then((data) => data);
67
+ }
68
+ /**
69
+ * Update follow-up SMS setting.
70
+ *
71
+ * Replaces the follow-up SMS setting.
72
+ *
73
+ * @param followUpSmsSettingId - Follow-up SMS setting ID
74
+ *
75
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, FOLLOW_UP_SMS_SETTING_NOT_FOUND_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, INVALID_DONGLE_TYPE, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, INVALID_RINGING_DURATION_TIMEOUT, INVALID_CALL_DURATION_TIMEOUT, INVALID_DAILY_SMS_LIMIT, DUPLICATE_DONGLE_FOLLOW_UP_SMS_SETTING, SMS_ERROR_IDENTIFIER_EMPTY_MESSAGE.
76
+ *
77
+ * Capability the role of an organization API key needs: `automation.manage`.
78
+ */
79
+ update(followUpSmsSettingId, params, options) {
80
+ return this._client
81
+ .request('PUT', `/follow-up-sms-setting/${pathParam(followUpSmsSettingId)}`, {
82
+ body: {
83
+ dongle_id: params.dongle_id,
84
+ name: params.name,
85
+ text: params.text,
86
+ ringing_duration_timeout: params.ringing_duration_timeout,
87
+ call_duration_timeout: params.call_duration_timeout,
88
+ daily_sms_limit: params.daily_sms_limit,
89
+ },
90
+ options,
91
+ })
92
+ .then((data) => data);
93
+ }
94
+ /**
95
+ * Delete follow-up SMS setting.
96
+ *
97
+ * Deletes the follow-up SMS setting.
98
+ *
99
+ * @param followUpSmsSettingId - Follow-up SMS setting ID
100
+ *
101
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, FOLLOW_UP_SMS_SETTING_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
102
+ *
103
+ * Capability the role of an organization API key needs: `automation.manage`.
104
+ */
105
+ delete(followUpSmsSettingId, options) {
106
+ return this._client
107
+ .request('DELETE', `/follow-up-sms-setting/${pathParam(followUpSmsSettingId)}`, { options })
108
+ .then(asStatus);
109
+ }
110
+ }
111
+ //# sourceMappingURL=follow-up-sms-settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"follow-up-sms-settings.js","sourceRoot":"","sources":["../../src/resources/follow-up-sms-settings.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAItF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAO7C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAClD,kDAAkD;AAClD,MAAM,OAAO,2BAA4B,SAAQ,WAAW;IAC1D;;;;;;;;OAQG;IACH,IAAI,CACF,SAAwC,EAAE,EAC1C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAqB,wBAAwB,EAAE;YACxE,KAAK,EAAE;gBACL,cAAc,EAAE,MAAM,CAAC,UAAU;gBACjC,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,KAAK,EAAE,MAAM,CAAC,KAAK;aACpB;YACD,OAAO,EAAE,wBAAwB;YACjC,OAAO;SACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,MAAuC,EAAE,OAAwB;QACtE,OAAO,IAAI,CAAC,OAAO;aAChB,OAAO,CAAC,MAAM,EAAE,wBAAwB,EAAE;YACzC,IAAI,EAAE;gBACJ,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,wBAAwB,EAAE,MAAM,CAAC,wBAAwB;gBACzD,qBAAqB,EAAE,MAAM,CAAC,qBAAqB;gBACnD,eAAe,EAAE,MAAM,CAAC,eAAe;aACxC;YACD,OAAO;SACR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