@samsarahq/samsara 6.3.1 → 7.0.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 (56) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/betaApIs/client/Client.d.ts +91 -0
  3. package/dist/cjs/api/resources/betaApIs/client/Client.js +265 -0
  4. package/dist/cjs/api/resources/betaApIs/client/requests/ListMaintenanceVendorsRequest.d.ts +1 -1
  5. package/dist/cjs/api/resources/betaApIs/client/requests/index.d.ts +3 -0
  6. package/dist/cjs/api/resources/betaApIs/client/requests/index.js +3 -1
  7. package/dist/cjs/api/resources/previewApIs/client/Client.d.ts +0 -109
  8. package/dist/cjs/api/resources/previewApIs/client/Client.js +0 -294
  9. package/dist/cjs/api/resources/previewApIs/client/requests/index.d.ts +0 -3
  10. package/dist/cjs/api/resources/previewApIs/client/requests/index.js +0 -3
  11. package/dist/cjs/api/types/MissingStateResponseBody.d.ts +1 -1
  12. package/dist/cjs/api/types/NotificationRecipientResponseResponseBody.d.ts +23 -0
  13. package/dist/cjs/api/types/NotificationRecipientResponseResponseBody.js +14 -0
  14. package/dist/cjs/api/types/RecoveryStateResponseBody.d.ts +1 -1
  15. package/dist/cjs/api/types/VendorObjectResponseBody.d.ts +2 -0
  16. package/dist/cjs/api/types/index.d.ts +1 -1
  17. package/dist/cjs/api/types/index.js +1 -1
  18. package/dist/cjs/version.d.ts +1 -1
  19. package/dist/cjs/version.js +1 -1
  20. package/dist/esm/BaseClient.mjs +2 -2
  21. package/dist/esm/api/resources/betaApIs/client/Client.d.mts +91 -0
  22. package/dist/esm/api/resources/betaApIs/client/Client.mjs +265 -0
  23. package/dist/esm/api/resources/betaApIs/client/requests/ListMaintenanceVendorsRequest.d.mts +1 -1
  24. package/dist/esm/api/resources/betaApIs/client/requests/index.d.mts +3 -0
  25. package/dist/esm/api/resources/betaApIs/client/requests/index.mjs +1 -0
  26. package/dist/esm/api/resources/previewApIs/client/Client.d.mts +0 -109
  27. package/dist/esm/api/resources/previewApIs/client/Client.mjs +0 -294
  28. package/dist/esm/api/resources/previewApIs/client/requests/index.d.mts +0 -3
  29. package/dist/esm/api/resources/previewApIs/client/requests/index.mjs +1 -1
  30. package/dist/esm/api/types/MissingStateResponseBody.d.mts +1 -1
  31. package/dist/esm/api/types/NotificationRecipientResponseResponseBody.d.mts +23 -0
  32. package/dist/esm/api/types/NotificationRecipientResponseResponseBody.mjs +11 -0
  33. package/dist/esm/api/types/RecoveryStateResponseBody.d.mts +1 -1
  34. package/dist/esm/api/types/VendorObjectResponseBody.d.mts +2 -0
  35. package/dist/esm/api/types/index.d.mts +1 -1
  36. package/dist/esm/api/types/index.mjs +1 -1
  37. package/dist/esm/version.d.mts +1 -1
  38. package/dist/esm/version.mjs +1 -1
  39. package/package.json +1 -1
  40. package/reference.md +217 -235
  41. package/dist/cjs/api/types/NotificationRecipientResponseBody.d.ts +0 -19
  42. package/dist/cjs/api/types/NotificationRecipientResponseBody.js +0 -14
  43. package/dist/esm/api/types/NotificationRecipientResponseBody.d.mts +0 -19
  44. package/dist/esm/api/types/NotificationRecipientResponseBody.mjs +0 -11
  45. /package/dist/cjs/api/resources/{previewApIs → betaApIs}/client/requests/DeviceRecoveryMarkAssetMissingRequestBody.d.ts +0 -0
  46. /package/dist/cjs/api/resources/{previewApIs → betaApIs}/client/requests/DeviceRecoveryMarkAssetMissingRequestBody.js +0 -0
  47. /package/dist/cjs/api/resources/{previewApIs → betaApIs}/client/requests/DeviceRecoveryRecoverAssetRequestBody.d.ts +0 -0
  48. /package/dist/cjs/api/resources/{previewApIs → betaApIs}/client/requests/DeviceRecoveryRecoverAssetRequestBody.js +0 -0
  49. /package/dist/cjs/api/resources/{previewApIs → betaApIs}/client/requests/ListDeviceRecoveryMissingAssetsRequest.d.ts +0 -0
  50. /package/dist/cjs/api/resources/{previewApIs → betaApIs}/client/requests/ListDeviceRecoveryMissingAssetsRequest.js +0 -0
  51. /package/dist/esm/api/resources/{previewApIs → betaApIs}/client/requests/DeviceRecoveryMarkAssetMissingRequestBody.d.mts +0 -0
  52. /package/dist/esm/api/resources/{previewApIs → betaApIs}/client/requests/DeviceRecoveryMarkAssetMissingRequestBody.mjs +0 -0
  53. /package/dist/esm/api/resources/{previewApIs → betaApIs}/client/requests/DeviceRecoveryRecoverAssetRequestBody.d.mts +0 -0
  54. /package/dist/esm/api/resources/{previewApIs → betaApIs}/client/requests/DeviceRecoveryRecoverAssetRequestBody.mjs +0 -0
  55. /package/dist/esm/api/resources/{previewApIs → betaApIs}/client/requests/ListDeviceRecoveryMissingAssetsRequest.d.mts +0 -0
  56. /package/dist/esm/api/resources/{previewApIs → betaApIs}/client/requests/ListDeviceRecoveryMissingAssetsRequest.mjs +0 -0
@@ -8,17 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __rest = (this && this.__rest) || function (s, e) {
12
- var t = {};
13
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
- t[p] = s[p];
15
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
- t[p[i]] = s[p[i]];
19
- }
20
- return t;
21
- };
22
11
  import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
23
12
  import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
24
13
  import * as core from "../../../../core/index.mjs";
@@ -30,289 +19,6 @@ export class PreviewApIsClient {
30
19
  constructor(options = {}) {
31
20
  this._options = normalizeClientOptionsWithAuth(options);
32
21
  }
33
- /**
34
- * List all assets that are currently marked as missing for the organization.
35
- *
36
- * <b>Rate limit:</b> 5 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
37
- *
38
- * To use this endpoint, select **Read Assets** under the Assets category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>
39
- *
40
- * Endpoints in this section are in Preview. These APIs are not functional and are instead for soliciting feedback from our API users on the intended design of this API. Additionally, it is not guaranteed that we will be releasing an endpoint included in this section to production. This means that developers should **NOT** rely on these APIs to build business critical applications
41
- *
42
- * - Samsara may change the structure of a preview API's interface without versioning or any notice to API users.
43
- *
44
- * - When an endpoint becomes generally available, it will be announced in the API [changelog](https://developers.samsara.com/changelog).
45
- *
46
- *
47
- * **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.
48
- *
49
- * @param {Samsara.ListDeviceRecoveryMissingAssetsRequest} request
50
- * @param {PreviewApIsClient.RequestOptions} requestOptions - Request-specific configuration.
51
- *
52
- * @throws {@link Samsara.UnauthorizedError}
53
- * @throws {@link Samsara.NotFoundError}
54
- * @throws {@link Samsara.MethodNotAllowedError}
55
- * @throws {@link Samsara.TooManyRequestsError}
56
- * @throws {@link Samsara.InternalServerError}
57
- * @throws {@link Samsara.NotImplementedError}
58
- * @throws {@link Samsara.BadGatewayError}
59
- * @throws {@link Samsara.ServiceUnavailableError}
60
- * @throws {@link Samsara.GatewayTimeoutError}
61
- *
62
- * @example
63
- * await client.previewApIs.listDeviceRecoveryMissingAssets()
64
- */
65
- listDeviceRecoveryMissingAssets(request = {}, requestOptions) {
66
- return core.HttpResponsePromise.fromPromise(this.__listDeviceRecoveryMissingAssets(request, requestOptions));
67
- }
68
- __listDeviceRecoveryMissingAssets() {
69
- return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
70
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
71
- const { after } = request;
72
- const _queryParams = {
73
- after,
74
- };
75
- const _authRequest = yield this._options.authProvider.getAuthRequest();
76
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Samsara-Version": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
77
- const _response = yield core.fetcher({
78
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SamsaraEnvironment.ProductionApi, "preview/fleet/assets/device-recovery-missing"),
79
- method: "GET",
80
- headers: _headers,
81
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
82
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
83
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
84
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
85
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
86
- logging: this._options.logging,
87
- });
88
- if (_response.ok) {
89
- return {
90
- data: _response.body,
91
- rawResponse: _response.rawResponse,
92
- };
93
- }
94
- if (_response.error.reason === "status-code") {
95
- switch (_response.error.statusCode) {
96
- case 401:
97
- throw new Samsara.UnauthorizedError(_response.error.body, _response.rawResponse);
98
- case 404:
99
- throw new Samsara.NotFoundError(_response.error.body, _response.rawResponse);
100
- case 405:
101
- throw new Samsara.MethodNotAllowedError(_response.error.body, _response.rawResponse);
102
- case 429:
103
- throw new Samsara.TooManyRequestsError(_response.error.body, _response.rawResponse);
104
- case 500:
105
- throw new Samsara.InternalServerError(_response.error.body, _response.rawResponse);
106
- case 501:
107
- throw new Samsara.NotImplementedError(_response.error.body, _response.rawResponse);
108
- case 502:
109
- throw new Samsara.BadGatewayError(_response.error.body, _response.rawResponse);
110
- case 503:
111
- throw new Samsara.ServiceUnavailableError(_response.error.body, _response.rawResponse);
112
- case 504:
113
- throw new Samsara.GatewayTimeoutError(_response.error.body, _response.rawResponse);
114
- default:
115
- throw new errors.SamsaraError({
116
- statusCode: _response.error.statusCode,
117
- body: _response.error.body,
118
- rawResponse: _response.rawResponse,
119
- });
120
- }
121
- }
122
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/preview/fleet/assets/device-recovery-missing");
123
- });
124
- }
125
- /**
126
- * Mark an asset as missing. Optionally specify a note and notification recipients who will receive email updates.
127
- *
128
- * <b>Rate limit:</b> 100 requests/min (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
129
- *
130
- * To use this endpoint, select **Write Assets** under the Assets category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>
131
- *
132
- * Endpoints in this section are in Preview. These APIs are not functional and are instead for soliciting feedback from our API users on the intended design of this API. Additionally, it is not guaranteed that we will be releasing an endpoint included in this section to production. This means that developers should **NOT** rely on these APIs to build business critical applications
133
- *
134
- * - Samsara may change the structure of a preview API's interface without versioning or any notice to API users.
135
- *
136
- * - When an endpoint becomes generally available, it will be announced in the API [changelog](https://developers.samsara.com/changelog).
137
- *
138
- *
139
- * **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.
140
- *
141
- * @param {Samsara.DeviceRecoveryMarkAssetMissingRequestBody} request
142
- * @param {PreviewApIsClient.RequestOptions} requestOptions - Request-specific configuration.
143
- *
144
- * @throws {@link Samsara.UnauthorizedError}
145
- * @throws {@link Samsara.NotFoundError}
146
- * @throws {@link Samsara.MethodNotAllowedError}
147
- * @throws {@link Samsara.TooManyRequestsError}
148
- * @throws {@link Samsara.InternalServerError}
149
- * @throws {@link Samsara.NotImplementedError}
150
- * @throws {@link Samsara.BadGatewayError}
151
- * @throws {@link Samsara.ServiceUnavailableError}
152
- * @throws {@link Samsara.GatewayTimeoutError}
153
- *
154
- * @example
155
- * await client.previewApIs.markAssetMissing({
156
- * id: "id"
157
- * })
158
- */
159
- markAssetMissing(request, requestOptions) {
160
- return core.HttpResponsePromise.fromPromise(this.__markAssetMissing(request, requestOptions));
161
- }
162
- __markAssetMissing(request, requestOptions) {
163
- return __awaiter(this, void 0, void 0, function* () {
164
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
165
- const { id } = request, _body = __rest(request, ["id"]);
166
- const _authRequest = yield this._options.authProvider.getAuthRequest();
167
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Samsara-Version": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
168
- const _response = yield core.fetcher({
169
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SamsaraEnvironment.ProductionApi, `preview/fleet/assets/device-recovery/${core.url.encodePathParam(id)}/missing`),
170
- method: "POST",
171
- headers: _headers,
172
- contentType: "application/json",
173
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
174
- requestType: "json",
175
- body: _body,
176
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
177
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
178
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
179
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
180
- logging: this._options.logging,
181
- });
182
- if (_response.ok) {
183
- return {
184
- data: _response.body,
185
- rawResponse: _response.rawResponse,
186
- };
187
- }
188
- if (_response.error.reason === "status-code") {
189
- switch (_response.error.statusCode) {
190
- case 401:
191
- throw new Samsara.UnauthorizedError(_response.error.body, _response.rawResponse);
192
- case 404:
193
- throw new Samsara.NotFoundError(_response.error.body, _response.rawResponse);
194
- case 405:
195
- throw new Samsara.MethodNotAllowedError(_response.error.body, _response.rawResponse);
196
- case 429:
197
- throw new Samsara.TooManyRequestsError(_response.error.body, _response.rawResponse);
198
- case 500:
199
- throw new Samsara.InternalServerError(_response.error.body, _response.rawResponse);
200
- case 501:
201
- throw new Samsara.NotImplementedError(_response.error.body, _response.rawResponse);
202
- case 502:
203
- throw new Samsara.BadGatewayError(_response.error.body, _response.rawResponse);
204
- case 503:
205
- throw new Samsara.ServiceUnavailableError(_response.error.body, _response.rawResponse);
206
- case 504:
207
- throw new Samsara.GatewayTimeoutError(_response.error.body, _response.rawResponse);
208
- default:
209
- throw new errors.SamsaraError({
210
- statusCode: _response.error.statusCode,
211
- body: _response.error.body,
212
- rawResponse: _response.rawResponse,
213
- });
214
- }
215
- }
216
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/preview/fleet/assets/device-recovery/{id}/missing");
217
- });
218
- }
219
- /**
220
- * Mark a missing asset as recovered. Provide the recovery status, reason for being missing, and optional additional details.
221
- *
222
- * <b>Rate limit:</b> 100 requests/min (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
223
- *
224
- * To use this endpoint, select **Write Assets** under the Assets category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>
225
- *
226
- * Endpoints in this section are in Preview. These APIs are not functional and are instead for soliciting feedback from our API users on the intended design of this API. Additionally, it is not guaranteed that we will be releasing an endpoint included in this section to production. This means that developers should **NOT** rely on these APIs to build business critical applications
227
- *
228
- * - Samsara may change the structure of a preview API's interface without versioning or any notice to API users.
229
- *
230
- * - When an endpoint becomes generally available, it will be announced in the API [changelog](https://developers.samsara.com/changelog).
231
- *
232
- *
233
- * **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.
234
- *
235
- * @param {Samsara.DeviceRecoveryRecoverAssetRequestBody} request
236
- * @param {PreviewApIsClient.RequestOptions} requestOptions - Request-specific configuration.
237
- *
238
- * @throws {@link Samsara.UnauthorizedError}
239
- * @throws {@link Samsara.NotFoundError}
240
- * @throws {@link Samsara.MethodNotAllowedError}
241
- * @throws {@link Samsara.TooManyRequestsError}
242
- * @throws {@link Samsara.InternalServerError}
243
- * @throws {@link Samsara.NotImplementedError}
244
- * @throws {@link Samsara.BadGatewayError}
245
- * @throws {@link Samsara.ServiceUnavailableError}
246
- * @throws {@link Samsara.GatewayTimeoutError}
247
- *
248
- * @example
249
- * await client.previewApIs.recoverAsset({
250
- * id: "id",
251
- * missing_reason: "MISPLACED",
252
- * recovery_status: "YES",
253
- * status: "RECOVERED"
254
- * })
255
- */
256
- recoverAsset(request, requestOptions) {
257
- return core.HttpResponsePromise.fromPromise(this.__recoverAsset(request, requestOptions));
258
- }
259
- __recoverAsset(request, requestOptions) {
260
- return __awaiter(this, void 0, void 0, function* () {
261
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
262
- const { id } = request, _body = __rest(request, ["id"]);
263
- const _authRequest = yield this._options.authProvider.getAuthRequest();
264
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Samsara-Version": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
265
- const _response = yield core.fetcher({
266
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SamsaraEnvironment.ProductionApi, `preview/fleet/assets/device-recovery/${core.url.encodePathParam(id)}/recovered`),
267
- method: "POST",
268
- headers: _headers,
269
- contentType: "application/json",
270
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
271
- requestType: "json",
272
- body: _body,
273
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
274
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
275
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
276
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
277
- logging: this._options.logging,
278
- });
279
- if (_response.ok) {
280
- return {
281
- data: _response.body,
282
- rawResponse: _response.rawResponse,
283
- };
284
- }
285
- if (_response.error.reason === "status-code") {
286
- switch (_response.error.statusCode) {
287
- case 401:
288
- throw new Samsara.UnauthorizedError(_response.error.body, _response.rawResponse);
289
- case 404:
290
- throw new Samsara.NotFoundError(_response.error.body, _response.rawResponse);
291
- case 405:
292
- throw new Samsara.MethodNotAllowedError(_response.error.body, _response.rawResponse);
293
- case 429:
294
- throw new Samsara.TooManyRequestsError(_response.error.body, _response.rawResponse);
295
- case 500:
296
- throw new Samsara.InternalServerError(_response.error.body, _response.rawResponse);
297
- case 501:
298
- throw new Samsara.NotImplementedError(_response.error.body, _response.rawResponse);
299
- case 502:
300
- throw new Samsara.BadGatewayError(_response.error.body, _response.rawResponse);
301
- case 503:
302
- throw new Samsara.ServiceUnavailableError(_response.error.body, _response.rawResponse);
303
- case 504:
304
- throw new Samsara.GatewayTimeoutError(_response.error.body, _response.rawResponse);
305
- default:
306
- throw new errors.SamsaraError({
307
- statusCode: _response.error.statusCode,
308
- body: _response.error.body,
309
- rawResponse: _response.rawResponse,
310
- });
311
- }
312
- }
313
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/preview/fleet/assets/device-recovery/{id}/recovered");
314
- });
315
- }
316
22
  /**
317
23
  * Creates a short-lived auth token for a driver.
318
24
  *
@@ -1,6 +1,3 @@
1
- export type { DeviceRecoveryMarkAssetMissingRequestBody } from "./DeviceRecoveryMarkAssetMissingRequestBody.mjs";
2
- export { DeviceRecoveryRecoverAssetRequestBody } from "./DeviceRecoveryRecoverAssetRequestBody.mjs";
3
1
  export type { DriversAuthTokenCreateDriverAuthTokenRequestBody } from "./DriversAuthTokenCreateDriverAuthTokenRequestBody.mjs";
4
- export type { ListDeviceRecoveryMissingAssetsRequest } from "./ListDeviceRecoveryMissingAssetsRequest.mjs";
5
2
  export type { LockVehicleRequest } from "./LockVehicleRequest.mjs";
6
3
  export type { UnlockVehicleRequest } from "./UnlockVehicleRequest.mjs";
@@ -1 +1 @@
1
- export { DeviceRecoveryRecoverAssetRequestBody } from "./DeviceRecoveryRecoverAssetRequestBody.mjs";
1
+ export {};
@@ -10,7 +10,7 @@ export interface MissingStateResponseBody {
10
10
  /** A note associated with the missing asset. */
11
11
  note?: string | undefined;
12
12
  /** Users subscribed to location update notifications for this asset. */
13
- notification_recipients?: Samsara.NotificationRecipientResponseBody[] | undefined;
13
+ notification_recipients?: Samsara.NotificationRecipientResponseResponseBody[] | undefined;
14
14
  /** Timestamp when the asset was marked as missing, in milliseconds since epoch. */
15
15
  updated_at_ms: number;
16
16
  /** The ID of the user who marked the asset as missing. */
@@ -0,0 +1,23 @@
1
+ /**
2
+ * A user subscribed to recovery state change notifications, including their name and email.
3
+ */
4
+ export interface NotificationRecipientResponseResponseBody {
5
+ /** The email address of the user. */
6
+ email: string;
7
+ /** The display name of the user. */
8
+ name: string;
9
+ /** How the user is notified. */
10
+ notification_types: NotificationRecipientResponseResponseBody.NotificationTypes.Item[];
11
+ /** The ID of the user. */
12
+ user_id: number;
13
+ }
14
+ export declare namespace NotificationRecipientResponseResponseBody {
15
+ type NotificationTypes = NotificationTypes.Item[];
16
+ namespace NotificationTypes {
17
+ /** The type of notification. Valid values: `email` */
18
+ const Item: {
19
+ readonly Email: "email";
20
+ };
21
+ type Item = (typeof Item)[keyof typeof Item];
22
+ }
23
+ }
@@ -0,0 +1,11 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var NotificationRecipientResponseResponseBody;
3
+ (function (NotificationRecipientResponseResponseBody) {
4
+ let NotificationTypes;
5
+ (function (NotificationTypes) {
6
+ /** The type of notification. Valid values: `email` */
7
+ NotificationTypes.Item = {
8
+ Email: "email",
9
+ };
10
+ })(NotificationTypes = NotificationRecipientResponseResponseBody.NotificationTypes || (NotificationRecipientResponseResponseBody.NotificationTypes = {}));
11
+ })(NotificationRecipientResponseResponseBody || (NotificationRecipientResponseResponseBody = {}));
@@ -10,7 +10,7 @@ export interface RecoveryStateResponseBody {
10
10
  /** A note associated with the recovery. */
11
11
  note?: string | undefined;
12
12
  /** Users subscribed to location update notifications for this asset. */
13
- notification_recipients?: Samsara.NotificationRecipientResponseBody[] | undefined;
13
+ notification_recipients?: Samsara.NotificationRecipientResponseResponseBody[] | undefined;
14
14
  /** Photos associated with the recovery event. URLs are temporary and expire at url_expires_at_ms. */
15
15
  recovery_photos?: Samsara.RecoveryPhotoResponseBody[] | undefined;
16
16
  /** Timestamp when the recovery state was last updated, in milliseconds since epoch. */
@@ -12,4 +12,6 @@ export interface VendorObjectResponseBody {
12
12
  id: string;
13
13
  /** Description of services provided by the vendor. */
14
14
  servicesProvided?: string | undefined;
15
+ /** The vendor's legacy vendor ID from the source system. Multiple vendor locations may share the same vendorId if they belong to the same parent company. */
16
+ vendorId?: string | undefined;
15
17
  }
@@ -1592,7 +1592,7 @@ export * from "./MultipleChoiceFieldTypeMetaDataObjectResponseBody.mjs";
1592
1592
  export * from "./MultipleChoiceValueObjectRequestBody.mjs";
1593
1593
  export * from "./MultipleChoiceValueObjectResponseBody.mjs";
1594
1594
  export * from "./NotificationRecipientRequestBody.mjs";
1595
- export * from "./NotificationRecipientResponseBody.mjs";
1595
+ export * from "./NotificationRecipientResponseResponseBody.mjs";
1596
1596
  export * from "./NumberDataPoint.mjs";
1597
1597
  export * from "./NumberFieldTypeMetaDataObjectResponseBody.mjs";
1598
1598
  export * from "./OperationalSettingsObjectRequestBody.mjs";
@@ -1592,7 +1592,7 @@ export * from "./MultipleChoiceFieldTypeMetaDataObjectResponseBody.mjs";
1592
1592
  export * from "./MultipleChoiceValueObjectRequestBody.mjs";
1593
1593
  export * from "./MultipleChoiceValueObjectResponseBody.mjs";
1594
1594
  export * from "./NotificationRecipientRequestBody.mjs";
1595
- export * from "./NotificationRecipientResponseBody.mjs";
1595
+ export * from "./NotificationRecipientResponseResponseBody.mjs";
1596
1596
  export * from "./NumberDataPoint.mjs";
1597
1597
  export * from "./NumberFieldTypeMetaDataObjectResponseBody.mjs";
1598
1598
  export * from "./OperationalSettingsObjectRequestBody.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "6.3.1";
1
+ export declare const SDK_VERSION = "7.0.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "6.3.1";
1
+ export const SDK_VERSION = "7.0.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@samsarahq/samsara",
3
- "version": "6.3.1",
3
+ "version": "7.0.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",