@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
@@ -44,8 +44,8 @@ function normalizeClientOptions(options) {
44
44
  const headers = (0, headers_js_1.mergeHeaders)({
45
45
  "X-Fern-Language": "JavaScript",
46
46
  "X-Fern-SDK-Name": "@samsarahq/samsara",
47
- "X-Fern-SDK-Version": "6.3.1",
48
- "User-Agent": "@samsarahq/samsara/6.3.1",
47
+ "X-Fern-SDK-Version": "7.0.0",
48
+ "User-Agent": "@samsarahq/samsara/7.0.0",
49
49
  "X-Fern-Runtime": core.RUNTIME.type,
50
50
  "X-Fern-Runtime-Version": core.RUNTIME.version,
51
51
  "X-Samsara-Version": (_a = options === null || options === void 0 ? void 0 : options.version) !== null && _a !== void 0 ? _a : "2025-06-11",
@@ -491,6 +491,97 @@ export declare class BetaApIsClient {
491
491
  */
492
492
  getDevices(request?: Samsara.GetDevicesRequest, requestOptions?: BetaApIsClient.RequestOptions): core.HttpResponsePromise<Samsara.DevicesGetDevicesResponseBody>;
493
493
  private __getDevices;
494
+ /**
495
+ * List all assets that are currently marked as missing for the organization.
496
+ *
497
+ * <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>).
498
+ *
499
+ * 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>
500
+ *
501
+ *
502
+ * **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.
503
+ *
504
+ * @param {Samsara.ListDeviceRecoveryMissingAssetsRequest} request
505
+ * @param {BetaApIsClient.RequestOptions} requestOptions - Request-specific configuration.
506
+ *
507
+ * @throws {@link Samsara.UnauthorizedError}
508
+ * @throws {@link Samsara.NotFoundError}
509
+ * @throws {@link Samsara.MethodNotAllowedError}
510
+ * @throws {@link Samsara.TooManyRequestsError}
511
+ * @throws {@link Samsara.InternalServerError}
512
+ * @throws {@link Samsara.NotImplementedError}
513
+ * @throws {@link Samsara.BadGatewayError}
514
+ * @throws {@link Samsara.ServiceUnavailableError}
515
+ * @throws {@link Samsara.GatewayTimeoutError}
516
+ *
517
+ * @example
518
+ * await client.betaApIs.listDeviceRecoveryMissingAssets()
519
+ */
520
+ listDeviceRecoveryMissingAssets(request?: Samsara.ListDeviceRecoveryMissingAssetsRequest, requestOptions?: BetaApIsClient.RequestOptions): core.HttpResponsePromise<Samsara.DeviceRecoveryListDeviceRecoveryMissingAssetsResponseBody>;
521
+ private __listDeviceRecoveryMissingAssets;
522
+ /**
523
+ * Mark an asset as missing. Optionally specify a note and notification recipients who will receive email updates.
524
+ *
525
+ * <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>).
526
+ *
527
+ * 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>
528
+ *
529
+ *
530
+ * **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.
531
+ *
532
+ * @param {Samsara.DeviceRecoveryMarkAssetMissingRequestBody} request
533
+ * @param {BetaApIsClient.RequestOptions} requestOptions - Request-specific configuration.
534
+ *
535
+ * @throws {@link Samsara.UnauthorizedError}
536
+ * @throws {@link Samsara.NotFoundError}
537
+ * @throws {@link Samsara.MethodNotAllowedError}
538
+ * @throws {@link Samsara.TooManyRequestsError}
539
+ * @throws {@link Samsara.InternalServerError}
540
+ * @throws {@link Samsara.NotImplementedError}
541
+ * @throws {@link Samsara.BadGatewayError}
542
+ * @throws {@link Samsara.ServiceUnavailableError}
543
+ * @throws {@link Samsara.GatewayTimeoutError}
544
+ *
545
+ * @example
546
+ * await client.betaApIs.markAssetMissing({
547
+ * id: "id"
548
+ * })
549
+ */
550
+ markAssetMissing(request: Samsara.DeviceRecoveryMarkAssetMissingRequestBody, requestOptions?: BetaApIsClient.RequestOptions): core.HttpResponsePromise<Samsara.DeviceRecoveryMarkAssetMissingResponseBody>;
551
+ private __markAssetMissing;
552
+ /**
553
+ * Mark a missing asset as recovered. Provide the recovery status, reason for being missing, and optional additional details.
554
+ *
555
+ * <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>).
556
+ *
557
+ * 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>
558
+ *
559
+ *
560
+ * **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.
561
+ *
562
+ * @param {Samsara.DeviceRecoveryRecoverAssetRequestBody} request
563
+ * @param {BetaApIsClient.RequestOptions} requestOptions - Request-specific configuration.
564
+ *
565
+ * @throws {@link Samsara.UnauthorizedError}
566
+ * @throws {@link Samsara.NotFoundError}
567
+ * @throws {@link Samsara.MethodNotAllowedError}
568
+ * @throws {@link Samsara.TooManyRequestsError}
569
+ * @throws {@link Samsara.InternalServerError}
570
+ * @throws {@link Samsara.NotImplementedError}
571
+ * @throws {@link Samsara.BadGatewayError}
572
+ * @throws {@link Samsara.ServiceUnavailableError}
573
+ * @throws {@link Samsara.GatewayTimeoutError}
574
+ *
575
+ * @example
576
+ * await client.betaApIs.recoverAsset({
577
+ * id: "id",
578
+ * missing_reason: "MISPLACED",
579
+ * recovery_status: "YES",
580
+ * status: "RECOVERED"
581
+ * })
582
+ */
583
+ recoverAsset(request: Samsara.DeviceRecoveryRecoverAssetRequestBody, requestOptions?: BetaApIsClient.RequestOptions): core.HttpResponsePromise<Samsara.DeviceRecoveryRecoverAssetResponseBody>;
584
+ private __recoverAsset;
494
585
  /**
495
586
  * Returns a paginated list of vehicles enrolled in the CARB CTC program with their latest compliance status. Results can be filtered by tag IDs and test status.
496
587
  *
@@ -1500,6 +1500,271 @@ class BetaApIsClient {
1500
1500
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/devices");
1501
1501
  });
1502
1502
  }
1503
+ /**
1504
+ * List all assets that are currently marked as missing for the organization.
1505
+ *
1506
+ * <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>).
1507
+ *
1508
+ * 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>
1509
+ *
1510
+ *
1511
+ * **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.
1512
+ *
1513
+ * @param {Samsara.ListDeviceRecoveryMissingAssetsRequest} request
1514
+ * @param {BetaApIsClient.RequestOptions} requestOptions - Request-specific configuration.
1515
+ *
1516
+ * @throws {@link Samsara.UnauthorizedError}
1517
+ * @throws {@link Samsara.NotFoundError}
1518
+ * @throws {@link Samsara.MethodNotAllowedError}
1519
+ * @throws {@link Samsara.TooManyRequestsError}
1520
+ * @throws {@link Samsara.InternalServerError}
1521
+ * @throws {@link Samsara.NotImplementedError}
1522
+ * @throws {@link Samsara.BadGatewayError}
1523
+ * @throws {@link Samsara.ServiceUnavailableError}
1524
+ * @throws {@link Samsara.GatewayTimeoutError}
1525
+ *
1526
+ * @example
1527
+ * await client.betaApIs.listDeviceRecoveryMissingAssets()
1528
+ */
1529
+ listDeviceRecoveryMissingAssets(request = {}, requestOptions) {
1530
+ return core.HttpResponsePromise.fromPromise(this.__listDeviceRecoveryMissingAssets(request, requestOptions));
1531
+ }
1532
+ __listDeviceRecoveryMissingAssets() {
1533
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
1534
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1535
+ const { after } = request;
1536
+ const _queryParams = {
1537
+ after,
1538
+ };
1539
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1540
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Samsara-Version": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1541
+ const _response = yield core.fetcher({
1542
+ 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, "fleet/assets/device-recovery-missing"),
1543
+ method: "GET",
1544
+ headers: _headers,
1545
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
1546
+ 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,
1547
+ 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,
1548
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1549
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
1550
+ logging: this._options.logging,
1551
+ });
1552
+ if (_response.ok) {
1553
+ return {
1554
+ data: _response.body,
1555
+ rawResponse: _response.rawResponse,
1556
+ };
1557
+ }
1558
+ if (_response.error.reason === "status-code") {
1559
+ switch (_response.error.statusCode) {
1560
+ case 401:
1561
+ throw new Samsara.UnauthorizedError(_response.error.body, _response.rawResponse);
1562
+ case 404:
1563
+ throw new Samsara.NotFoundError(_response.error.body, _response.rawResponse);
1564
+ case 405:
1565
+ throw new Samsara.MethodNotAllowedError(_response.error.body, _response.rawResponse);
1566
+ case 429:
1567
+ throw new Samsara.TooManyRequestsError(_response.error.body, _response.rawResponse);
1568
+ case 500:
1569
+ throw new Samsara.InternalServerError(_response.error.body, _response.rawResponse);
1570
+ case 501:
1571
+ throw new Samsara.NotImplementedError(_response.error.body, _response.rawResponse);
1572
+ case 502:
1573
+ throw new Samsara.BadGatewayError(_response.error.body, _response.rawResponse);
1574
+ case 503:
1575
+ throw new Samsara.ServiceUnavailableError(_response.error.body, _response.rawResponse);
1576
+ case 504:
1577
+ throw new Samsara.GatewayTimeoutError(_response.error.body, _response.rawResponse);
1578
+ default:
1579
+ throw new errors.SamsaraError({
1580
+ statusCode: _response.error.statusCode,
1581
+ body: _response.error.body,
1582
+ rawResponse: _response.rawResponse,
1583
+ });
1584
+ }
1585
+ }
1586
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/fleet/assets/device-recovery-missing");
1587
+ });
1588
+ }
1589
+ /**
1590
+ * Mark an asset as missing. Optionally specify a note and notification recipients who will receive email updates.
1591
+ *
1592
+ * <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>).
1593
+ *
1594
+ * 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>
1595
+ *
1596
+ *
1597
+ * **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.
1598
+ *
1599
+ * @param {Samsara.DeviceRecoveryMarkAssetMissingRequestBody} request
1600
+ * @param {BetaApIsClient.RequestOptions} requestOptions - Request-specific configuration.
1601
+ *
1602
+ * @throws {@link Samsara.UnauthorizedError}
1603
+ * @throws {@link Samsara.NotFoundError}
1604
+ * @throws {@link Samsara.MethodNotAllowedError}
1605
+ * @throws {@link Samsara.TooManyRequestsError}
1606
+ * @throws {@link Samsara.InternalServerError}
1607
+ * @throws {@link Samsara.NotImplementedError}
1608
+ * @throws {@link Samsara.BadGatewayError}
1609
+ * @throws {@link Samsara.ServiceUnavailableError}
1610
+ * @throws {@link Samsara.GatewayTimeoutError}
1611
+ *
1612
+ * @example
1613
+ * await client.betaApIs.markAssetMissing({
1614
+ * id: "id"
1615
+ * })
1616
+ */
1617
+ markAssetMissing(request, requestOptions) {
1618
+ return core.HttpResponsePromise.fromPromise(this.__markAssetMissing(request, requestOptions));
1619
+ }
1620
+ __markAssetMissing(request, requestOptions) {
1621
+ return __awaiter(this, void 0, void 0, function* () {
1622
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1623
+ const { id } = request, _body = __rest(request, ["id"]);
1624
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1625
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Samsara-Version": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1626
+ const _response = yield core.fetcher({
1627
+ 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, `fleet/assets/device-recovery/${core.url.encodePathParam(id)}/missing`),
1628
+ method: "POST",
1629
+ headers: _headers,
1630
+ contentType: "application/json",
1631
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1632
+ requestType: "json",
1633
+ body: _body,
1634
+ 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,
1635
+ 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,
1636
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1637
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
1638
+ logging: this._options.logging,
1639
+ });
1640
+ if (_response.ok) {
1641
+ return {
1642
+ data: _response.body,
1643
+ rawResponse: _response.rawResponse,
1644
+ };
1645
+ }
1646
+ if (_response.error.reason === "status-code") {
1647
+ switch (_response.error.statusCode) {
1648
+ case 401:
1649
+ throw new Samsara.UnauthorizedError(_response.error.body, _response.rawResponse);
1650
+ case 404:
1651
+ throw new Samsara.NotFoundError(_response.error.body, _response.rawResponse);
1652
+ case 405:
1653
+ throw new Samsara.MethodNotAllowedError(_response.error.body, _response.rawResponse);
1654
+ case 429:
1655
+ throw new Samsara.TooManyRequestsError(_response.error.body, _response.rawResponse);
1656
+ case 500:
1657
+ throw new Samsara.InternalServerError(_response.error.body, _response.rawResponse);
1658
+ case 501:
1659
+ throw new Samsara.NotImplementedError(_response.error.body, _response.rawResponse);
1660
+ case 502:
1661
+ throw new Samsara.BadGatewayError(_response.error.body, _response.rawResponse);
1662
+ case 503:
1663
+ throw new Samsara.ServiceUnavailableError(_response.error.body, _response.rawResponse);
1664
+ case 504:
1665
+ throw new Samsara.GatewayTimeoutError(_response.error.body, _response.rawResponse);
1666
+ default:
1667
+ throw new errors.SamsaraError({
1668
+ statusCode: _response.error.statusCode,
1669
+ body: _response.error.body,
1670
+ rawResponse: _response.rawResponse,
1671
+ });
1672
+ }
1673
+ }
1674
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/fleet/assets/device-recovery/{id}/missing");
1675
+ });
1676
+ }
1677
+ /**
1678
+ * Mark a missing asset as recovered. Provide the recovery status, reason for being missing, and optional additional details.
1679
+ *
1680
+ * <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>).
1681
+ *
1682
+ * 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>
1683
+ *
1684
+ *
1685
+ * **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.
1686
+ *
1687
+ * @param {Samsara.DeviceRecoveryRecoverAssetRequestBody} request
1688
+ * @param {BetaApIsClient.RequestOptions} requestOptions - Request-specific configuration.
1689
+ *
1690
+ * @throws {@link Samsara.UnauthorizedError}
1691
+ * @throws {@link Samsara.NotFoundError}
1692
+ * @throws {@link Samsara.MethodNotAllowedError}
1693
+ * @throws {@link Samsara.TooManyRequestsError}
1694
+ * @throws {@link Samsara.InternalServerError}
1695
+ * @throws {@link Samsara.NotImplementedError}
1696
+ * @throws {@link Samsara.BadGatewayError}
1697
+ * @throws {@link Samsara.ServiceUnavailableError}
1698
+ * @throws {@link Samsara.GatewayTimeoutError}
1699
+ *
1700
+ * @example
1701
+ * await client.betaApIs.recoverAsset({
1702
+ * id: "id",
1703
+ * missing_reason: "MISPLACED",
1704
+ * recovery_status: "YES",
1705
+ * status: "RECOVERED"
1706
+ * })
1707
+ */
1708
+ recoverAsset(request, requestOptions) {
1709
+ return core.HttpResponsePromise.fromPromise(this.__recoverAsset(request, requestOptions));
1710
+ }
1711
+ __recoverAsset(request, requestOptions) {
1712
+ return __awaiter(this, void 0, void 0, function* () {
1713
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1714
+ const { id } = request, _body = __rest(request, ["id"]);
1715
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1716
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Samsara-Version": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1717
+ const _response = yield core.fetcher({
1718
+ 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, `fleet/assets/device-recovery/${core.url.encodePathParam(id)}/recovered`),
1719
+ method: "POST",
1720
+ headers: _headers,
1721
+ contentType: "application/json",
1722
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1723
+ requestType: "json",
1724
+ body: _body,
1725
+ 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,
1726
+ 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,
1727
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1728
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
1729
+ logging: this._options.logging,
1730
+ });
1731
+ if (_response.ok) {
1732
+ return {
1733
+ data: _response.body,
1734
+ rawResponse: _response.rawResponse,
1735
+ };
1736
+ }
1737
+ if (_response.error.reason === "status-code") {
1738
+ switch (_response.error.statusCode) {
1739
+ case 401:
1740
+ throw new Samsara.UnauthorizedError(_response.error.body, _response.rawResponse);
1741
+ case 404:
1742
+ throw new Samsara.NotFoundError(_response.error.body, _response.rawResponse);
1743
+ case 405:
1744
+ throw new Samsara.MethodNotAllowedError(_response.error.body, _response.rawResponse);
1745
+ case 429:
1746
+ throw new Samsara.TooManyRequestsError(_response.error.body, _response.rawResponse);
1747
+ case 500:
1748
+ throw new Samsara.InternalServerError(_response.error.body, _response.rawResponse);
1749
+ case 501:
1750
+ throw new Samsara.NotImplementedError(_response.error.body, _response.rawResponse);
1751
+ case 502:
1752
+ throw new Samsara.BadGatewayError(_response.error.body, _response.rawResponse);
1753
+ case 503:
1754
+ throw new Samsara.ServiceUnavailableError(_response.error.body, _response.rawResponse);
1755
+ case 504:
1756
+ throw new Samsara.GatewayTimeoutError(_response.error.body, _response.rawResponse);
1757
+ default:
1758
+ throw new errors.SamsaraError({
1759
+ statusCode: _response.error.statusCode,
1760
+ body: _response.error.body,
1761
+ rawResponse: _response.rawResponse,
1762
+ });
1763
+ }
1764
+ }
1765
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/fleet/assets/device-recovery/{id}/recovered");
1766
+ });
1767
+ }
1503
1768
  /**
1504
1769
  * Returns a paginated list of vehicles enrolled in the CARB CTC program with their latest compliance status. Results can be filtered by tag IDs and test status.
1505
1770
  *
@@ -3,7 +3,7 @@
3
3
  * {}
4
4
  */
5
5
  export interface ListMaintenanceVendorsRequest {
6
- /** A comma-separated list of up to 100 vendor IDs to filter on. Accepts Samsara UUIDs or external IDs in key:value format. The default external ID key is samsara.vendorId (e.g. samsara.vendorId:V-12345). See [external IDs](https://developers.samsara.com/docs/external-ids). */
6
+ /** A comma-separated list of up to 100 vendor IDs to filter on. Accepts Samsara UUIDs or external IDs in key:value format. See [external IDs](https://developers.samsara.com/docs/external-ids). */
7
7
  ids?: string | string[];
8
8
  /** When true, include externalIds on each vendor in the response. Default false. */
9
9
  includeExternalIds?: boolean;
@@ -2,6 +2,8 @@ export type { DeleteJobRequest } from "./DeleteJobRequest.js";
2
2
  export type { DeleteRidershipAccountRequest } from "./DeleteRidershipAccountRequest.js";
3
3
  export type { DeleteRidershipPassengerRequest } from "./DeleteRidershipPassengerRequest.js";
4
4
  export type { DeleteRidershipRouteSetupRequest } from "./DeleteRidershipRouteSetupRequest.js";
5
+ export type { DeviceRecoveryMarkAssetMissingRequestBody } from "./DeviceRecoveryMarkAssetMissingRequestBody.js";
6
+ export { DeviceRecoveryRecoverAssetRequestBody } from "./DeviceRecoveryRecoverAssetRequestBody.js";
5
7
  export type { EngineImmobilizerUpdateEngineImmobilizerStateRequestBody } from "./EngineImmobilizerUpdateEngineImmobilizerStateRequestBody.js";
6
8
  export type { EquipmentPatchEquipmentRequestBody } from "./EquipmentPatchEquipmentRequestBody.js";
7
9
  export type { FunctionsStartFunctionRunRequestBody } from "./FunctionsStartFunctionRunRequestBody.js";
@@ -40,6 +42,7 @@ export type { JobsCreateJobRequestBody } from "./JobsCreateJobRequestBody.js";
40
42
  export type { JobsPatchJobRequestBody } from "./JobsPatchJobRequestBody.js";
41
43
  export type { ListCarbCtcVehicleHistoryRequest } from "./ListCarbCtcVehicleHistoryRequest.js";
42
44
  export type { ListCarbCtcVehiclesRequest } from "./ListCarbCtcVehiclesRequest.js";
45
+ export type { ListDeviceRecoveryMissingAssetsRequest } from "./ListDeviceRecoveryMissingAssetsRequest.js";
43
46
  export type { ListHubCustomPropertiesRequest } from "./ListHubCustomPropertiesRequest.js";
44
47
  export type { ListMaintenanceVendorsRequest } from "./ListMaintenanceVendorsRequest.js";
45
48
  export type { ListReadingsDefinitionsRequest } from "./ListReadingsDefinitionsRequest.js";
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RidershipPassengersUpdateRidershipPassengerRequestBody = exports.RidershipPassengersCreateRidershipPassengerRequestBody = void 0;
3
+ exports.RidershipPassengersUpdateRidershipPassengerRequestBody = exports.RidershipPassengersCreateRidershipPassengerRequestBody = exports.DeviceRecoveryRecoverAssetRequestBody = void 0;
4
+ var DeviceRecoveryRecoverAssetRequestBody_js_1 = require("./DeviceRecoveryRecoverAssetRequestBody.js");
5
+ Object.defineProperty(exports, "DeviceRecoveryRecoverAssetRequestBody", { enumerable: true, get: function () { return DeviceRecoveryRecoverAssetRequestBody_js_1.DeviceRecoveryRecoverAssetRequestBody; } });
4
6
  var RidershipPassengersCreateRidershipPassengerRequestBody_js_1 = require("./RidershipPassengersCreateRidershipPassengerRequestBody.js");
5
7
  Object.defineProperty(exports, "RidershipPassengersCreateRidershipPassengerRequestBody", { enumerable: true, get: function () { return RidershipPassengersCreateRidershipPassengerRequestBody_js_1.RidershipPassengersCreateRidershipPassengerRequestBody; } });
6
8
  var RidershipPassengersUpdateRidershipPassengerRequestBody_js_1 = require("./RidershipPassengersUpdateRidershipPassengerRequestBody.js");
@@ -10,115 +10,6 @@ export declare namespace PreviewApIsClient {
10
10
  export declare class PreviewApIsClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<PreviewApIsClient.Options>;
12
12
  constructor(options?: PreviewApIsClient.Options);
13
- /**
14
- * List all assets that are currently marked as missing for the organization.
15
- *
16
- * <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>).
17
- *
18
- * 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>
19
- *
20
- * 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
21
- *
22
- * - Samsara may change the structure of a preview API's interface without versioning or any notice to API users.
23
- *
24
- * - When an endpoint becomes generally available, it will be announced in the API [changelog](https://developers.samsara.com/changelog).
25
- *
26
- *
27
- * **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.
28
- *
29
- * @param {Samsara.ListDeviceRecoveryMissingAssetsRequest} request
30
- * @param {PreviewApIsClient.RequestOptions} requestOptions - Request-specific configuration.
31
- *
32
- * @throws {@link Samsara.UnauthorizedError}
33
- * @throws {@link Samsara.NotFoundError}
34
- * @throws {@link Samsara.MethodNotAllowedError}
35
- * @throws {@link Samsara.TooManyRequestsError}
36
- * @throws {@link Samsara.InternalServerError}
37
- * @throws {@link Samsara.NotImplementedError}
38
- * @throws {@link Samsara.BadGatewayError}
39
- * @throws {@link Samsara.ServiceUnavailableError}
40
- * @throws {@link Samsara.GatewayTimeoutError}
41
- *
42
- * @example
43
- * await client.previewApIs.listDeviceRecoveryMissingAssets()
44
- */
45
- listDeviceRecoveryMissingAssets(request?: Samsara.ListDeviceRecoveryMissingAssetsRequest, requestOptions?: PreviewApIsClient.RequestOptions): core.HttpResponsePromise<Samsara.DeviceRecoveryListDeviceRecoveryMissingAssetsResponseBody>;
46
- private __listDeviceRecoveryMissingAssets;
47
- /**
48
- * Mark an asset as missing. Optionally specify a note and notification recipients who will receive email updates.
49
- *
50
- * <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>).
51
- *
52
- * 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>
53
- *
54
- * 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
55
- *
56
- * - Samsara may change the structure of a preview API's interface without versioning or any notice to API users.
57
- *
58
- * - When an endpoint becomes generally available, it will be announced in the API [changelog](https://developers.samsara.com/changelog).
59
- *
60
- *
61
- * **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.
62
- *
63
- * @param {Samsara.DeviceRecoveryMarkAssetMissingRequestBody} request
64
- * @param {PreviewApIsClient.RequestOptions} requestOptions - Request-specific configuration.
65
- *
66
- * @throws {@link Samsara.UnauthorizedError}
67
- * @throws {@link Samsara.NotFoundError}
68
- * @throws {@link Samsara.MethodNotAllowedError}
69
- * @throws {@link Samsara.TooManyRequestsError}
70
- * @throws {@link Samsara.InternalServerError}
71
- * @throws {@link Samsara.NotImplementedError}
72
- * @throws {@link Samsara.BadGatewayError}
73
- * @throws {@link Samsara.ServiceUnavailableError}
74
- * @throws {@link Samsara.GatewayTimeoutError}
75
- *
76
- * @example
77
- * await client.previewApIs.markAssetMissing({
78
- * id: "id"
79
- * })
80
- */
81
- markAssetMissing(request: Samsara.DeviceRecoveryMarkAssetMissingRequestBody, requestOptions?: PreviewApIsClient.RequestOptions): core.HttpResponsePromise<Samsara.DeviceRecoveryMarkAssetMissingResponseBody>;
82
- private __markAssetMissing;
83
- /**
84
- * Mark a missing asset as recovered. Provide the recovery status, reason for being missing, and optional additional details.
85
- *
86
- * <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>).
87
- *
88
- * 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>
89
- *
90
- * 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
91
- *
92
- * - Samsara may change the structure of a preview API's interface without versioning or any notice to API users.
93
- *
94
- * - When an endpoint becomes generally available, it will be announced in the API [changelog](https://developers.samsara.com/changelog).
95
- *
96
- *
97
- * **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.
98
- *
99
- * @param {Samsara.DeviceRecoveryRecoverAssetRequestBody} request
100
- * @param {PreviewApIsClient.RequestOptions} requestOptions - Request-specific configuration.
101
- *
102
- * @throws {@link Samsara.UnauthorizedError}
103
- * @throws {@link Samsara.NotFoundError}
104
- * @throws {@link Samsara.MethodNotAllowedError}
105
- * @throws {@link Samsara.TooManyRequestsError}
106
- * @throws {@link Samsara.InternalServerError}
107
- * @throws {@link Samsara.NotImplementedError}
108
- * @throws {@link Samsara.BadGatewayError}
109
- * @throws {@link Samsara.ServiceUnavailableError}
110
- * @throws {@link Samsara.GatewayTimeoutError}
111
- *
112
- * @example
113
- * await client.previewApIs.recoverAsset({
114
- * id: "id",
115
- * missing_reason: "MISPLACED",
116
- * recovery_status: "YES",
117
- * status: "RECOVERED"
118
- * })
119
- */
120
- recoverAsset(request: Samsara.DeviceRecoveryRecoverAssetRequestBody, requestOptions?: PreviewApIsClient.RequestOptions): core.HttpResponsePromise<Samsara.DeviceRecoveryRecoverAssetResponseBody>;
121
- private __recoverAsset;
122
13
  /**
123
14
  * Creates a short-lived auth token for a driver.
124
15
  *