/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { shipmentsCreate } from "../funcs/shipmentsCreate.js"; import { shipmentsGet } from "../funcs/shipmentsGet.js"; import { shipmentsList } from "../funcs/shipmentsList.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Shipments extends ClientSDK { /** * List all shipments * * @remarks * Returns a list of all shipment objects.

* In order to filter results, you must use the below path parameters. * A maximum date range of 90 days is permitted. * Provided dates should be ISO 8601 UTC dates (timezone offsets are currently not supported).

* * Optional path parameters:
* `object_created_gt`- object(s) created greater than a provided date time
* `object_created_gte` - object(s) created greater than or equal to a provided date time
* `object_created_lt` - object(s) created less than a provided date time
* `object_created_lte` - object(s) created less than or equal to a provided date time
* * Date format examples:
* `2017-01-01`
* `2017-01-01T03:30:30` or `2017-01-01T03:30:30.5`
* `2017-01-01T03:30:30Z`

* * Example URL:
* `https://api.goshippo.com/shipments/?object_created_gte=2017-01-01T00:00:30&object_created_lt=2017-04-01T00:00:30` */ async list( request: operations.ListShipmentsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(shipmentsList( this, request, options, )); } /** * Create a new shipment * * @remarks * Creates a new shipment object. */ async create( request: components.ShipmentCreateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(shipmentsCreate( this, request, options, )); } /** * Retrieve a shipment * * @remarks * Returns an existing shipment using an object ID */ async get( shipmentId: string, options?: RequestOptions, ): Promise { return unwrapAsync(shipmentsGet( this, shipmentId, options, )); } }