Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"namespaceExport": "Samsara",
"generateWireTests": true
},
"sdkVersion": "5.11.0"
"sdkVersion": "6.0.1"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@samsarahq/samsara",
"version": "5.11.0",
"version": "6.0.1",
"private": false,
"repository": {
"type": "git",
Expand Down
160 changes: 77 additions & 83 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -5119,6 +5119,78 @@ await client.betaApIs.getRidershipPassenger({
</dl>


</dd>
</dl>
</details>

<details><summary><code>client.betaApIs.<a href="/src/api/resources/betaApIs/client/Client.ts">listRidershipRouteSetups</a>({ ...params }) -> Samsara.RidershipRouteSetupsListRidershipRouteSetupsResponseBody</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

List all route setups for a ridership account.

<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>).

To use this endpoint, select **Read Ridership** under the Ridership 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>


**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.
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```typescript
await client.betaApIs.listRidershipRouteSetups({
accountId: "accountId"
});

```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**request:** `Samsara.ListRidershipRouteSetupsRequest`

</dd>
</dl>

<dl>
<dd>

**requestOptions:** `BetaApIsClient.RequestOptions`

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>
Expand All @@ -5135,7 +5207,7 @@ await client.betaApIs.getRidershipPassenger({
<dl>
<dd>

Create or replace the passenger assignment setup for a route.
Create the passenger assignment setup for a route.

<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>).

Expand Down Expand Up @@ -17590,7 +17662,7 @@ await client.organizationInfo.getOrganizationInfo();
</details>

## Preview APIs
<details><summary><code>client.previewApIs.<a href="/src/api/resources/previewApIs/client/Client.ts">listDeviceRecoveryAssets</a>({ ...params }) -> Samsara.DeviceRecoveryListDeviceRecoveryAssetsResponseBody</code></summary>
<details><summary><code>client.previewApIs.<a href="/src/api/resources/previewApIs/client/Client.ts">listDeviceRecoveryMissingAssets</a>({ ...params }) -> Samsara.DeviceRecoveryListDeviceRecoveryMissingAssetsResponseBody</code></summary>
<dl>
<dd>

Expand All @@ -17602,7 +17674,7 @@ await client.organizationInfo.getOrganizationInfo();
<dl>
<dd>

List all assets that have a device recovery state for the organization. Optionally filter by one or more statuses (UNKNOWN, MISSING, LOCATED, RECOVERED).
List all assets that are currently marked as missing for the organization.

<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>).

Expand Down Expand Up @@ -17630,7 +17702,7 @@ Endpoints in this section are in Preview. These APIs are not functional and are
<dd>

```typescript
await client.previewApIs.listDeviceRecoveryAssets();
await client.previewApIs.listDeviceRecoveryMissingAssets();

```
</dd>
Expand All @@ -17646,7 +17718,7 @@ await client.previewApIs.listDeviceRecoveryAssets();
<dl>
<dd>

**request:** `Samsara.ListDeviceRecoveryAssetsRequest`
**request:** `Samsara.ListDeviceRecoveryMissingAssetsRequest`

</dd>
</dl>
Expand Down Expand Up @@ -17821,84 +17893,6 @@ await client.previewApIs.recoverAsset({
</dl>


</dd>
</dl>
</details>

<details><summary><code>client.previewApIs.<a href="/src/api/resources/previewApIs/client/Client.ts">getAssetRecoveryState</a>({ ...params }) -> Samsara.DeviceRecoveryGetAssetRecoveryStateResponseBody</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

Get the current recovery state for a specific asset, including recovery photos and notification recipients.

<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>).

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>

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

- Samsara may change the structure of a preview API's interface without versioning or any notice to API users.

- When an endpoint becomes generally available, it will be announced in the API [changelog](https://developers.samsara.com/changelog).


**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.
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```typescript
await client.previewApIs.getAssetRecoveryState({
id: "id"
});

```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**request:** `Samsara.GetAssetRecoveryStateRequest`

</dd>
</dl>

<dl>
<dd>

**requestOptions:** `PreviewApIsClient.RequestOptions`

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>
Expand Down
4 changes: 2 additions & 2 deletions src/BaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export function normalizeClientOptions<T extends BaseClientOptions = BaseClientO
{
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@samsarahq/samsara",
"X-Fern-SDK-Version": "5.11.0",
"User-Agent": "@samsarahq/samsara/5.11.0",
"X-Fern-SDK-Version": "6.0.1",
"User-Agent": "@samsarahq/samsara/6.0.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
"X-Samsara-Version": options?.version ?? "2025-06-11",
Expand Down
109 changes: 108 additions & 1 deletion src/api/resources/betaApIs/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5456,7 +5456,114 @@ export class BetaApIsClient {
}

/**
* Create or replace the passenger assignment setup for a route.
* List all route setups for a ridership account.
*
* <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>).
*
* To use this endpoint, select **Read Ridership** under the Ridership 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>
*
*
* **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.
*
* @param {Samsara.ListRidershipRouteSetupsRequest} request
* @param {BetaApIsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Samsara.UnauthorizedError}
* @throws {@link Samsara.NotFoundError}
* @throws {@link Samsara.MethodNotAllowedError}
* @throws {@link Samsara.TooManyRequestsError}
* @throws {@link Samsara.InternalServerError}
* @throws {@link Samsara.NotImplementedError}
* @throws {@link Samsara.BadGatewayError}
* @throws {@link Samsara.ServiceUnavailableError}
* @throws {@link Samsara.GatewayTimeoutError}
*
* @example
* await client.betaApIs.listRidershipRouteSetups({
* accountId: "accountId"
* })
*/
public listRidershipRouteSetups(
request: Samsara.ListRidershipRouteSetupsRequest,
requestOptions?: BetaApIsClient.RequestOptions,
): core.HttpResponsePromise<Samsara.RidershipRouteSetupsListRidershipRouteSetupsResponseBody> {
return core.HttpResponsePromise.fromPromise(this.__listRidershipRouteSetups(request, requestOptions));
}

private async __listRidershipRouteSetups(
request: Samsara.ListRidershipRouteSetupsRequest,
requestOptions?: BetaApIsClient.RequestOptions,
): Promise<core.WithRawResponse<Samsara.RidershipRouteSetupsListRidershipRouteSetupsResponseBody>> {
const { accountId, after, limit } = request;
const _queryParams: Record<string, unknown> = {
accountId,
after,
limit,
};
const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
_authRequest.headers,
this._options?.headers,
mergeOnlyDefinedHeaders({ "X-Samsara-Version": requestOptions?.version }),
requestOptions?.headers,
);
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.SamsaraEnvironment.ProductionApi,
"ridership/route-setups",
),
method: "GET",
headers: _headers,
queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
fetchFn: this._options?.fetch,
logging: this._options.logging,
});
if (_response.ok) {
return {
data: _response.body as Samsara.RidershipRouteSetupsListRidershipRouteSetupsResponseBody,
rawResponse: _response.rawResponse,
};
}

if (_response.error.reason === "status-code") {
switch (_response.error.statusCode) {
case 401:
throw new Samsara.UnauthorizedError(_response.error.body as unknown, _response.rawResponse);
case 404:
throw new Samsara.NotFoundError(_response.error.body as unknown, _response.rawResponse);
case 405:
throw new Samsara.MethodNotAllowedError(_response.error.body as unknown, _response.rawResponse);
case 429:
throw new Samsara.TooManyRequestsError(_response.error.body as unknown, _response.rawResponse);
case 500:
throw new Samsara.InternalServerError(_response.error.body as unknown, _response.rawResponse);
case 501:
throw new Samsara.NotImplementedError(_response.error.body as unknown, _response.rawResponse);
case 502:
throw new Samsara.BadGatewayError(_response.error.body as unknown, _response.rawResponse);
case 503:
throw new Samsara.ServiceUnavailableError(_response.error.body as unknown, _response.rawResponse);
case 504:
throw new Samsara.GatewayTimeoutError(_response.error.body as unknown, _response.rawResponse);
default:
throw new errors.SamsaraError({
statusCode: _response.error.statusCode,
body: _response.error.body,
rawResponse: _response.rawResponse,
});
}
}

return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/ridership/route-setups");
}

/**
* Create the passenger assignment setup for a route.
*
* <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>).
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface GetDetectionsRequest {
driverIds?: string | string[];
/** Optional string of comma separated asset IDs. If asset ID is present, events for the specified asset(s) will be returned. Max for this value is 2000 objects. (Example: 281474982859091,281471982957527) */
assetIds?: string | string[];
/** Optional string of comma separated labels to filter behavior labels. Uses OR semantics for filtering. An empty list allows all values. Valid values: `acceleration`, `braking`, `crash`, `drowsy`, `eatingDrinking`, `edgeRailroadCrossingViolation`, `followingDistance`, `forwardCollisionWarning`, `genericDistraction`, `harshTurn`, `heavySpeeding`, `laneDeparture`, `lightSpeeding`, `maxSpeed`, `mobileUsage`, `moderateSpeeding`, `noSeatbelt`, `obstructedCamera`, `passenger`, `policyViolationMask`, `ranRedLight`, `rearCollisionWarning`, `rollingStop`, `rolloverProtection`, `severeSpeeding`, `smoking`, `speeding`, `unsafeParking`, `vehicleInBlindSpotWarning`, `vulnerableRoadUserCollisionWarning`, `yawControl`. (Example: rollingStop,obstructedCamera,noSeatbelt) */
/** Optional string of comma separated labels to filter behavior labels. Uses OR semantics for filtering. An empty list allows all values. Valid values: `acceleration`, `braking`, `crash`, `drowsy`, `eatingDrinking`, `edgeRailroadCrossingViolation`, `followingDistance`, `forwardCollisionWarning`, `genericDistraction`, `harshTurn`, `heavySpeeding`, `laneDeparture`, `lightSpeeding`, `maxSpeed`, `mobileUsage`, `moderateSpeeding`, `noSeatbelt`, `obstructedCamera`, `passenger`, `policyViolationMask`, `ranRedLight`, `rearCollisionWarning`, `reversing`, `rollingStop`, `rolloverProtection`, `severeSpeeding`, `smoking`, `speeding`, `unsafeParking`, `vehicleInBlindSpotWarning`, `vulnerableRoadUserCollisionWarning`, `yawControl`. (Example: rollingStop,obstructedCamera,noSeatbelt) */
detectionBehaviorLabels?: string | string[];
/** Optional string of comma separated reasons to filter detections. Uses OR semantics for filtering. An empty list allows all values. Valid values: `overDailyLimit`, `overHourlyLimit`, `overTripLimit`, `belowConfidenceThreshold`, `belowSeverityThreshold`, `overEventRateLimit`, `geofenceFilter`, `belowNudgeThreshold`, `belowSpeedThreshold`, `nighttimeFilter`, `speedingFilter`, `inCabAlertOnly`, `unknown`. (Example: overDailyLimit,overHourlyLimit,belowConfidenceThreshold) */
inboxFilterReason?: string | string[];
Expand Down
Loading