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": "7.1.0"
"sdkVersion": "7.2.0"
}
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": "7.1.0",
"version": "7.2.0",
"private": false,
"repository": {
"type": "git",
Expand Down
73 changes: 73 additions & 0 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2997,6 +2997,79 @@ await client.betaApIs.listCarbCtcVehicleHistory({
</dl>


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

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

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

Resolves a driver by name within an organization via voice sign-in, then creates a driver-vehicle assignment via the Driver Assignment Service.

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

To use this endpoint, select **Write Assignments** under the Assignments 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.resolveAssignmentByDetails({
driverName: "Jane Doe",
vehicleId: "281474978683353"
});

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

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**request:** `Samsara.ResolveAssignmentByDetailsResolveAssignmentByDetailsRequestBody`

</dd>
</dl>

<dl>
<dd>

**requestOptions:** `BetaApIsClient.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": "7.1.0",
"User-Agent": "@samsarahq/samsara/7.1.0",
"X-Fern-SDK-Version": "7.2.0",
"User-Agent": "@samsarahq/samsara/7.2.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
"X-Samsara-Version": options?.version ?? "2025-06-11",
Expand Down
110 changes: 110 additions & 0 deletions src/api/resources/betaApIs/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2330,6 +2330,116 @@ export class BetaApIsClient {
);
}

/**
* Resolves a driver by name within an organization via voice sign-in, then creates a driver-vehicle assignment via the Driver Assignment Service.
*
* <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>).
*
* To use this endpoint, select **Write Assignments** under the Assignments 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.ResolveAssignmentByDetailsResolveAssignmentByDetailsRequestBody} 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.resolveAssignmentByDetails({
* driverName: "Jane Doe",
* vehicleId: "281474978683353"
* })
*/
public resolveAssignmentByDetails(
request: Samsara.ResolveAssignmentByDetailsResolveAssignmentByDetailsRequestBody,
requestOptions?: BetaApIsClient.RequestOptions,
): core.HttpResponsePromise<Samsara.ResolveAssignmentByDetailsResolveAssignmentByDetailsResponseBody> {
return core.HttpResponsePromise.fromPromise(this.__resolveAssignmentByDetails(request, requestOptions));
}

private async __resolveAssignmentByDetails(
request: Samsara.ResolveAssignmentByDetailsResolveAssignmentByDetailsRequestBody,
requestOptions?: BetaApIsClient.RequestOptions,
): Promise<core.WithRawResponse<Samsara.ResolveAssignmentByDetailsResolveAssignmentByDetailsResponseBody>> {
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,
"fleet/drivers/voice-sign-in/resolve-assignment",
),
method: "POST",
headers: _headers,
contentType: "application/json",
queryParameters: requestOptions?.queryParams,
requestType: "json",
body: request,
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.ResolveAssignmentByDetailsResolveAssignmentByDetailsResponseBody,
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,
"POST",
"/fleet/drivers/voice-sign-in/resolve-assignment",
);
}

/**
* Returns the list of vendor categories available for maintenance vendors.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// This file was auto-generated by Fern from our API Definition.

/**
* @example
* {
* driverName: "Jane Doe",
* vehicleId: "281474978683353"
* }
*/
export interface ResolveAssignmentByDetailsResolveAssignmentByDetailsRequestBody {
/** The full name of the driver to resolve. */
driverName: string;
/** The vehicle ID. This can be either a unique Samsara ID or an external ID for the vehicle. */
vehicleId: string;
}
1 change: 1 addition & 0 deletions src/api/resources/betaApIs/client/requests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export type { QualificationsPostQualificationRecordRequestBody } from "./Qualifi
export type { QualificationsUnarchiveQualificationRecordRequestBody } from "./QualificationsUnarchiveQualificationRecordRequestBody.js";
export type { ReadingsPostReadingsRequestBody } from "./ReadingsPostReadingsRequestBody.js";
export type { ReportsCreateReportRunRequestBody } from "./ReportsCreateReportRunRequestBody.js";
export type { ResolveAssignmentByDetailsResolveAssignmentByDetailsRequestBody } from "./ResolveAssignmentByDetailsResolveAssignmentByDetailsRequestBody.js";
export type { RidershipAccountsCreateRidershipAccountRequestBody } from "./RidershipAccountsCreateRidershipAccountRequestBody.js";
export type { RidershipAccountsUpdateRidershipAccountRequestBody } from "./RidershipAccountsUpdateRidershipAccountRequestBody.js";
export { RidershipPassengersCreateRidershipPassengerRequestBody } from "./RidershipPassengersCreateRidershipPassengerRequestBody.js";
Expand Down
14 changes: 14 additions & 0 deletions src/api/types/DvirDefectsObjectV20220913ResponseBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ export interface DvirDefectsObjectV20220913ResponseBody {
comment?: string | undefined;
/** Time when the defect was created. UTC timestamp in RFC 3339 format. */
createdAtTime: string;
/** The severity of the DVIR defect. Valid values: `minor`, `major`, `unspecified` */
defectSeverity?: DvirDefectsObjectV20220913ResponseBody.DefectSeverity | undefined;
/** The type of DVIR defect. */
defectType: string;
/** The ID of the DVIR defect type. */
defectTypeId?: string | undefined;
/** The ID of the defect. */
id: string;
/** Signifies if this defect is resolved. */
Expand All @@ -26,3 +30,13 @@ export interface DvirDefectsObjectV20220913ResponseBody {
trailer?: Samsara.GoaTrailerTinyResponseResponseBody | undefined;
vehicle?: Samsara.VehicleWithGatewayTinyResponseResponseBody | undefined;
}

export namespace DvirDefectsObjectV20220913ResponseBody {
/** The severity of the DVIR defect. Valid values: `minor`, `major`, `unspecified` */
export const DefectSeverity = {
Minor: "minor",
Major: "major",
Unspecified: "unspecified",
} as const;
export type DefectSeverity = (typeof DefectSeverity)[keyof typeof DefectSeverity];
}
13 changes: 11 additions & 2 deletions src/api/types/MissingStateResponseBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,19 @@ export interface MissingStateResponseBody {
note?: string | undefined;
/** Users subscribed to location update notifications for this asset. */
notification_recipients?: Samsara.NotificationRecipientResponseResponseBody[] | undefined;
/** The source of the last update to this recovery state. Defaults to `dashboard` if not explicitly set. Valid values: `dashboard`, `api` */
update_source?: MissingStateResponseBody.UpdateSource | undefined;
/** Timestamp when the asset was marked as missing, in milliseconds since epoch. */
updated_at_ms: number;
/** The ID of the user who marked the asset as missing. */
updated_by_user_id?: number | undefined;
/** The unique UUID of this recovery state record. */
uuid: string;
}

export namespace MissingStateResponseBody {
/** The source of the last update to this recovery state. Defaults to `dashboard` if not explicitly set. Valid values: `dashboard`, `api` */
export const UpdateSource = {
Dashboard: "dashboard",
Api: "api",
} as const;
export type UpdateSource = (typeof UpdateSource)[keyof typeof UpdateSource];
}
13 changes: 11 additions & 2 deletions src/api/types/RecoveryStateResponseBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,19 @@ export interface RecoveryStateResponseBody {
notification_recipients?: Samsara.NotificationRecipientResponseResponseBody[] | undefined;
/** Photos associated with the recovery event. URLs are temporary and expire at url_expires_at_ms. */
recovery_photos?: Samsara.RecoveryPhotoResponseBody[] | undefined;
/** The source of the last update to this recovery state. Defaults to `dashboard` if not explicitly set. Valid values: `dashboard`, `api` */
update_source?: RecoveryStateResponseBody.UpdateSource | undefined;
/** Timestamp when the recovery state was last updated, in milliseconds since epoch. */
updated_at_ms: number;
/** The ID of the user who last updated the recovery state. */
updated_by_user_id?: number | undefined;
/** The unique UUID of this recovery state record. */
uuid: string;
}

export namespace RecoveryStateResponseBody {
/** The source of the last update to this recovery state. Defaults to `dashboard` if not explicitly set. Valid values: `dashboard`, `api` */
export const UpdateSource = {
Dashboard: "dashboard",
Api: "api",
} as const;
export type UpdateSource = (typeof UpdateSource)[keyof typeof UpdateSource];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file was auto-generated by Fern from our API Definition.

/**
* Bad Gateway
*/
export interface ResolveAssignmentByDetailsResolveAssignmentByDetailsBadGatewayErrorResponseBody {
/** Message of error */
message: string;
/** The request ID; used when reaching out to support for issues with requests. */
requestId: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file was auto-generated by Fern from our API Definition.

/**
* Gateway timeout
*/
export interface ResolveAssignmentByDetailsResolveAssignmentByDetailsGatewayTimeoutErrorResponseBody {
/** Message of error */
message: string;
/** The request ID; used when reaching out to support for issues with requests. */
requestId: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file was auto-generated by Fern from our API Definition.

/**
* An internal server error occurred
*/
export interface ResolveAssignmentByDetailsResolveAssignmentByDetailsInternalServerErrorResponseBody {
/** Message of error */
message: string;
/** The request ID; used when reaching out to support for issues with requests. */
requestId: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file was auto-generated by Fern from our API Definition.

/**
* Method not allowed
*/
export interface ResolveAssignmentByDetailsResolveAssignmentByDetailsMethodNotAllowedErrorResponseBody {
/** Message of error */
message: string;
/** The request ID; used when reaching out to support for issues with requests. */
requestId: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file was auto-generated by Fern from our API Definition.

/**
* Resource not found
*/
export interface ResolveAssignmentByDetailsResolveAssignmentByDetailsNotFoundErrorResponseBody {
/** Message of error */
message: string;
/** The request ID; used when reaching out to support for issues with requests. */
requestId: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file was auto-generated by Fern from our API Definition.

/**
* Requested endpoint is not yet implemented
*/
export interface ResolveAssignmentByDetailsResolveAssignmentByDetailsNotImplementedErrorResponseBody {
/** Message of error */
message: string;
/** The request ID; used when reaching out to support for issues with requests. */
requestId: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This file was auto-generated by Fern from our API Definition.

import type * as Samsara from "../index.js";

export interface ResolveAssignmentByDetailsResolveAssignmentByDetailsResponseBody {
data: Samsara.ResolveAssignmentByDetailsResponseBodyResponseBody;
}
Loading
Loading