@lob/lob-typescript-sdk
Version:
Lob API wrapper
196 lines (195 loc) • 14.5 kB
TypeScript
/**
* 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 `previous_url` 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 `next_url` field in the return response.
* @param {Array<string>} [include] Request that the response include the total count by specifying `include[]=total_count`.
* @param {{ [key: string]: string; }} [dateCreated] Filter by date created.
* @param {{ [key: string]: string; }} [metadata] Filter by metadata key-value pair`.
* @param {boolean} [color] Set to `true` to return only color letters. Set to `false` to return only black & white letters.
* @param {boolean} [scheduled] * `true` - only return orders (past or future) where `send_date` is greater than `date_created` * `false` - only return orders where `send_date` is equal to `date_created`
* @param {{ [key: string]: string; }} [sendDate] Filter by date sent.
* @param {MailType} [mailType] A string designating the mail postage type: * `usps_first_class` - (default) * `usps_standard` - a [cheaper option](https://lob.com/pricing/print-mail#compare) which is less predictable and takes longer to deliver. `usps_standard` cannot be used with `4x6` postcards or for any postcards sent outside of the United States.
* @param {object} [sortBy] Sorts items by ascending or descending dates. Use either `date_created` or `send_date`, 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 `previous_url` 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 `next_url` field in the return response.
* @param {Array<string>} [include] Request that the response include the total count by specifying `include[]=total_count`.
* @param {{ [key: string]: string; }} [dateCreated] Filter by date created.
* @param {{ [key: string]: string; }} [metadata] Filter by metadata key-value pair`.
* @param {boolean} [color] Set to `true` to return only color letters. Set to `false` to return only black & white letters.
* @param {boolean} [scheduled] * `true` - only return orders (past or future) where `send_date` is greater than `date_created` * `false` - only return orders where `send_date` is equal to `date_created`
* @param {{ [key: string]: string; }} [sendDate] Filter by date sent.
* @param {MailType} [mailType] A string designating the mail postage type: * `usps_first_class` - (default) * `usps_standard` - a [cheaper option](https://lob.com/pricing/print-mail#compare) which is less predictable and takes longer to deliver. `usps_standard` cannot be used with `4x6` postcards or for any postcards sent outside of the United States.
* @param {object} [sortBy] Sorts items by ascending or descending dates. Use either `date_created` or `send_date`, 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 `previous_url` 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 `next_url` field in the return response.
* @param {Array<string>} [include] Request that the response include the total count by specifying `include[]=total_count`.
* @param {{ [key: string]: string; }} [dateCreated] Filter by date created.
* @param {{ [key: string]: string; }} [metadata] Filter by metadata key-value pair`.
* @param {boolean} [color] Set to `true` to return only color letters. Set to `false` to return only black & white letters.
* @param {boolean} [scheduled] * `true` - only return orders (past or future) where `send_date` is greater than `date_created` * `false` - only return orders where `send_date` is equal to `date_created`
* @param {{ [key: string]: string; }} [sendDate] Filter by date sent.
* @param {MailType} [mailType] A string designating the mail postage type: * `usps_first_class` - (default) * `usps_standard` - a [cheaper option](https://lob.com/pricing/print-mail#compare) which is less predictable and takes longer to deliver. `usps_standard` cannot be used with `4x6` postcards or for any postcards sent outside of the United States.
* @param {object} [sortBy] Sorts items by ascending or descending dates. Use either `date_created` or `send_date`, 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.
*/