/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { userParcelTemplatesCreate } from "../funcs/userParcelTemplatesCreate.js"; import { userParcelTemplatesDelete } from "../funcs/userParcelTemplatesDelete.js"; import { userParcelTemplatesGet } from "../funcs/userParcelTemplatesGet.js"; import { userParcelTemplatesList } from "../funcs/userParcelTemplatesList.js"; import { userParcelTemplatesUpdate } from "../funcs/userParcelTemplatesUpdate.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 UserParcelTemplates extends ClientSDK { /** * List all user parcel templates * * @remarks * Returns a list all of all user parcel template objects. */ async list( request: operations.ListUserParcelTemplatesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(userParcelTemplatesList( this, request, options, )); } /** * Create a new user parcel template * * @remarks * Creates a new user parcel template.
You can choose to create a * parcel template using a preset carrier template as a starting point, or * you can create an entirely custom one. To use a preset carrier template, * pass in a unique template token from this list * plus the weight fields (**weight** and **weight_unit**). Otherwise, omit * the template field and pass the other fields, for the weight, length, height, * and depth, as well as their units." */ async create( request: components.UserParcelTemplateCreateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(userParcelTemplatesCreate( this, request, options, )); } /** * Delete a user parcel template * * @remarks * Deletes a user parcel template using an object ID. */ async delete( userParcelTemplateObjectId: string, options?: RequestOptions, ): Promise { return unwrapAsync(userParcelTemplatesDelete( this, userParcelTemplateObjectId, options, )); } /** * Retrieves a user parcel template * * @remarks * Returns the parcel template information for a specific user parcel * template, identified by the object ID. */ async get( userParcelTemplateObjectId: string, options?: RequestOptions, ): Promise { return unwrapAsync(userParcelTemplatesGet( this, userParcelTemplateObjectId, options, )); } /** * Update an existing user parcel template * * @remarks * Updates an existing user parcel template. */ async update( userParcelTemplateObjectId: string, userParcelTemplateUpdateRequest?: | components.UserParcelTemplateUpdateRequest | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(userParcelTemplatesUpdate( this, userParcelTemplateObjectId, userParcelTemplateUpdateRequest, options, )); } }