UNPKG

@lob/lob-typescript-sdk

Version:
196 lines (195 loc) 14.5 kB
/** * Lob * The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)? * * The version of the OpenAPI document: 1.3.0 * Contact: lob-openapi@lob.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; import { Configuration } from "../configuration"; import { RequestArgs, BaseAPI } from "../base"; import { Letter } from "../models"; import { LetterDeletion } from "../models"; import { LetterEditable } from "../models"; import { LetterList } from "../models"; import { MailType } from "../models"; /** * LettersApi - axios parameter creator * @export */ export declare const LettersApiAxiosParamCreator: (configuration?: Configuration) => { /** * Completely removes a letter from production. This can only be done if the letter has a `send_date` and the `send_date` has not yet passed. If the letter is successfully canceled, you will not be charged for it. Read more on [cancellation windows](#section/Cancellation-Windows) and [scheduling](#section/Scheduled-Mailings). Scheduling and cancellation is a premium feature. Upgrade to the appropriate [Print & Mail Edition](https://dashboard.lob.com/#/settings/editions) to gain access. * @summary cancel * @param {string} ltrId id of the letter * @param {*} [options] Override http request option. * @throws {RequiredError} */ letterCancel: (ltrId: string, options?: AxiosRequestConfig) => Promise<RequestArgs>; /** * Creates a new letter given information * @summary create * @param {LetterEditable} letterEditable * @param {string} [idempotencyKey] A string of no longer than 256 characters that uniquely identifies this resource. For more help integrating idempotency keys, refer to our [implementation guide](https://www.lob.com/guides#idempotent_request). * @param {*} [options] Override http request option. * @throws {RequiredError} */ letterCreate: (letterEditable: LetterEditable, idempotencyKey?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>; /** * Retrieves the details of an existing letter. You need only supply the unique letter identifier that was returned upon letter creation. * @summary get * @param {string} ltrId id of the letter * @param {*} [options] Override http request option. * @throws {RequiredError} */ letterRetrieve: (ltrId: string, options?: AxiosRequestConfig) => Promise<RequestArgs>; /** * Returns a list of your letters. The letters are returned sorted by creation date, with the most recently created letters appearing first. * @summary list * @param {number} [limit] How many results to return. * @param {string} [before] A reference to a list entry used for paginating to the previous set of entries. This field is pre-populated in the &#x60;previous_url&#x60; field in the return response. * @param {string} [after] A reference to a list entry used for paginating to the next set of entries. This field is pre-populated in the &#x60;next_url&#x60; field in the return response. * @param {Array<string>} [include] Request that the response include the total count by specifying &#x60;include[]&#x3D;total_count&#x60;. * @param {{ [key: string]: string; }} [dateCreated] Filter by date created. * @param {{ [key: string]: string; }} [metadata] Filter by metadata key-value pair&#x60;. * @param {boolean} [color] Set to &#x60;true&#x60; to return only color letters. Set to &#x60;false&#x60; to return only black &amp; white letters. * @param {boolean} [scheduled] * &#x60;true&#x60; - only return orders (past or future) where &#x60;send_date&#x60; is greater than &#x60;date_created&#x60; * &#x60;false&#x60; - only return orders where &#x60;send_date&#x60; is equal to &#x60;date_created&#x60; * @param {{ [key: string]: string; }} [sendDate] Filter by date sent. * @param {MailType} [mailType] A string designating the mail postage type: * &#x60;usps_first_class&#x60; - (default) * &#x60;usps_standard&#x60; - a [cheaper option](https://lob.com/pricing/print-mail#compare) which is less predictable and takes longer to deliver. &#x60;usps_standard&#x60; cannot be used with &#x60;4x6&#x60; postcards or for any postcards sent outside of the United States. * @param {object} [sortBy] Sorts items by ascending or descending dates. Use either &#x60;date_created&#x60; or &#x60;send_date&#x60;, not both. * @param {*} [options] Override http request option. * @throws {RequiredError} */ lettersList: (limit?: number, before?: string, after?: string, include?: Array<string>, dateCreated?: { [key: string]: string; } | undefined, metadata?: { [key: string]: string; } | undefined, color?: boolean, scheduled?: boolean, sendDate?: { [key: string]: string; } | undefined, mailType?: MailType, sortBy?: object, options?: AxiosRequestConfig) => Promise<RequestArgs>; }; /** * LettersApi - functional programming interface * @export */ export declare const LettersApiFp: (configuration?: Configuration) => { /** * Completely removes a letter from production. This can only be done if the letter has a `send_date` and the `send_date` has not yet passed. If the letter is successfully canceled, you will not be charged for it. Read more on [cancellation windows](#section/Cancellation-Windows) and [scheduling](#section/Scheduled-Mailings). Scheduling and cancellation is a premium feature. Upgrade to the appropriate [Print & Mail Edition](https://dashboard.lob.com/#/settings/editions) to gain access. * @summary cancel * @param {string} ltrId id of the letter * @param {*} [options] Override http request option. * @throws {RequiredError} */ letterCancel(ltrId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<LetterDeletion>>; /** * Creates a new letter given information * @summary create * @param {LetterEditable} letterEditable * @param {string} [idempotencyKey] A string of no longer than 256 characters that uniquely identifies this resource. For more help integrating idempotency keys, refer to our [implementation guide](https://www.lob.com/guides#idempotent_request). * @param {*} [options] Override http request option. * @throws {RequiredError} */ letterCreate(letterEditable: LetterEditable, idempotencyKey?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Letter>>; /** * Retrieves the details of an existing letter. You need only supply the unique letter identifier that was returned upon letter creation. * @summary get * @param {string} ltrId id of the letter * @param {*} [options] Override http request option. * @throws {RequiredError} */ letterRetrieve(ltrId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Letter>>; /** * Returns a list of your letters. The letters are returned sorted by creation date, with the most recently created letters appearing first. * @summary list * @param {number} [limit] How many results to return. * @param {string} [before] A reference to a list entry used for paginating to the previous set of entries. This field is pre-populated in the &#x60;previous_url&#x60; field in the return response. * @param {string} [after] A reference to a list entry used for paginating to the next set of entries. This field is pre-populated in the &#x60;next_url&#x60; field in the return response. * @param {Array<string>} [include] Request that the response include the total count by specifying &#x60;include[]&#x3D;total_count&#x60;. * @param {{ [key: string]: string; }} [dateCreated] Filter by date created. * @param {{ [key: string]: string; }} [metadata] Filter by metadata key-value pair&#x60;. * @param {boolean} [color] Set to &#x60;true&#x60; to return only color letters. Set to &#x60;false&#x60; to return only black &amp; white letters. * @param {boolean} [scheduled] * &#x60;true&#x60; - only return orders (past or future) where &#x60;send_date&#x60; is greater than &#x60;date_created&#x60; * &#x60;false&#x60; - only return orders where &#x60;send_date&#x60; is equal to &#x60;date_created&#x60; * @param {{ [key: string]: string; }} [sendDate] Filter by date sent. * @param {MailType} [mailType] A string designating the mail postage type: * &#x60;usps_first_class&#x60; - (default) * &#x60;usps_standard&#x60; - a [cheaper option](https://lob.com/pricing/print-mail#compare) which is less predictable and takes longer to deliver. &#x60;usps_standard&#x60; cannot be used with &#x60;4x6&#x60; postcards or for any postcards sent outside of the United States. * @param {object} [sortBy] Sorts items by ascending or descending dates. Use either &#x60;date_created&#x60; or &#x60;send_date&#x60;, not both. * @param {*} [options] Override http request option. * @throws {RequiredError} */ lettersList(limit?: number, before?: string, after?: string, include?: Array<string>, dateCreated?: { [key: string]: string; } | undefined, metadata?: { [key: string]: string; } | undefined, color?: boolean, scheduled?: boolean, sendDate?: { [key: string]: string; } | undefined, mailType?: MailType, sortBy?: object, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<LetterList>>; }; /** * LettersApi - object-oriented interface * @export * @class LettersApi * @extends {BaseAPI} */ export declare class LettersApi extends BaseAPI { /** * Completely removes a letter from production. This can only be done if the letter has a `send_date` and the `send_date` has not yet passed. If the letter is successfully canceled, you will not be charged for it. Read more on [cancellation windows](#section/Cancellation-Windows) and [scheduling](#section/Scheduled-Mailings). Scheduling and cancellation is a premium feature. Upgrade to the appropriate [Print & Mail Edition](https://dashboard.lob.com/#/settings/editions) to gain access. * @summary cancel * @param {string} ltrId id of the letter * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LettersApi */ cancel(ltrId: string, options?: AxiosRequestConfig): Promise<LetterDeletion>; /** * Creates a new letter given information * @summary create * @param {LetterEditable} letterEditable * @param {string} [idempotencyKey] A string of no longer than 256 characters that uniquely identifies this resource. For more help integrating idempotency keys, refer to our [implementation guide](https://www.lob.com/guides#idempotent_request). * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LettersApi */ create(letterEditable: LetterEditable, idempotencyKey?: string, options?: AxiosRequestConfig): Promise<Letter>; /** * Retrieves the details of an existing letter. You need only supply the unique letter identifier that was returned upon letter creation. * @summary get * @param {string} ltrId id of the letter * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LettersApi */ get(ltrId: string, options?: AxiosRequestConfig): Promise<Letter>; /** * Returns a list of your letters. The letters are returned sorted by creation date, with the most recently created letters appearing first. * @summary list * @param {number} [limit] How many results to return. * @param {string} [before] A reference to a list entry used for paginating to the previous set of entries. This field is pre-populated in the &#x60;previous_url&#x60; field in the return response. * @param {string} [after] A reference to a list entry used for paginating to the next set of entries. This field is pre-populated in the &#x60;next_url&#x60; field in the return response. * @param {Array<string>} [include] Request that the response include the total count by specifying &#x60;include[]&#x3D;total_count&#x60;. * @param {{ [key: string]: string; }} [dateCreated] Filter by date created. * @param {{ [key: string]: string; }} [metadata] Filter by metadata key-value pair&#x60;. * @param {boolean} [color] Set to &#x60;true&#x60; to return only color letters. Set to &#x60;false&#x60; to return only black &amp; white letters. * @param {boolean} [scheduled] * &#x60;true&#x60; - only return orders (past or future) where &#x60;send_date&#x60; is greater than &#x60;date_created&#x60; * &#x60;false&#x60; - only return orders where &#x60;send_date&#x60; is equal to &#x60;date_created&#x60; * @param {{ [key: string]: string; }} [sendDate] Filter by date sent. * @param {MailType} [mailType] A string designating the mail postage type: * &#x60;usps_first_class&#x60; - (default) * &#x60;usps_standard&#x60; - a [cheaper option](https://lob.com/pricing/print-mail#compare) which is less predictable and takes longer to deliver. &#x60;usps_standard&#x60; cannot be used with &#x60;4x6&#x60; postcards or for any postcards sent outside of the United States. * @param {object} [sortBy] Sorts items by ascending or descending dates. Use either &#x60;date_created&#x60; or &#x60;send_date&#x60;, not both. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LettersApi */ list(limit?: number, before?: string, after?: string, include?: Array<string>, dateCreated?: { [key: string]: string; }, metadata?: { [key: string]: string; }, color?: boolean, scheduled?: boolean, sendDate?: { [key: string]: string; }, mailType?: MailType, sortBy?: object, options?: AxiosRequestConfig): Promise<LetterList>; } /** * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */