UNPKG

@lob/lob-typescript-sdk

Version:
197 lines (196 loc) 14.8 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 { MailType } from "../models"; import { Postcard } from "../models"; import { PostcardDeletion } from "../models"; import { PostcardEditable } from "../models"; import { PostcardList } from "../models"; import { PostcardSize } from "../models"; /** * PostcardsApi - axios parameter creator * @export */ export declare const PostcardsApiAxiosParamCreator: (configuration?: Configuration) => { /** * Creates a new postcard given information * @summary create * @param {PostcardEditable} postcardEditable * @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} */ postcardCreate: (postcardEditable: PostcardEditable, idempotencyKey?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>; /** * Completely removes a postcard from production. This can only be done if the postcard has a `send_date` and the `send_date` has not yet passed. If the postcard 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} pscId id of the postcard * @param {*} [options] Override http request option. * @throws {RequiredError} */ postcardDelete: (pscId: string, options?: AxiosRequestConfig) => Promise<RequestArgs>; /** * Retrieves the details of an existing postcard. You need only supply the unique customer identifier that was returned upon postcard creation. * @summary get * @param {string} pscId id of the postcard * @param {*} [options] Override http request option. * @throws {RequiredError} */ postcardRetrieve: (pscId: string, options?: AxiosRequestConfig) => Promise<RequestArgs>; /** * Returns a list of your postcards. The addresses are returned sorted by creation date, with the most recently created addresses 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 {Array<PostcardSize>} [size] Specifies the size of the postcard. Only &#x60;4x6&#x60; postcards can be sent to international destinations. * @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} */ postcardsList: (limit?: number, before?: string, after?: string, include?: Array<string>, dateCreated?: { [key: string]: string; } | undefined, metadata?: { [key: string]: string; } | undefined, size?: Array<PostcardSize>, scheduled?: boolean, sendDate?: { [key: string]: string; } | undefined, mailType?: MailType, sortBy?: object, options?: AxiosRequestConfig) => Promise<RequestArgs>; }; /** * PostcardsApi - functional programming interface * @export */ export declare const PostcardsApiFp: (configuration?: Configuration) => { /** * Creates a new postcard given information * @summary create * @param {PostcardEditable} postcardEditable * @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} */ postcardCreate(postcardEditable: PostcardEditable, idempotencyKey?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Postcard>>; /** * Completely removes a postcard from production. This can only be done if the postcard has a `send_date` and the `send_date` has not yet passed. If the postcard 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} pscId id of the postcard * @param {*} [options] Override http request option. * @throws {RequiredError} */ postcardDelete(pscId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PostcardDeletion>>; /** * Retrieves the details of an existing postcard. You need only supply the unique customer identifier that was returned upon postcard creation. * @summary get * @param {string} pscId id of the postcard * @param {*} [options] Override http request option. * @throws {RequiredError} */ postcardRetrieve(pscId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Postcard>>; /** * Returns a list of your postcards. The addresses are returned sorted by creation date, with the most recently created addresses 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 {Array<PostcardSize>} [size] Specifies the size of the postcard. Only &#x60;4x6&#x60; postcards can be sent to international destinations. * @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} */ postcardsList(limit?: number, before?: string, after?: string, include?: Array<string>, dateCreated?: { [key: string]: string; } | undefined, metadata?: { [key: string]: string; } | undefined, size?: Array<PostcardSize>, scheduled?: boolean, sendDate?: { [key: string]: string; } | undefined, mailType?: MailType, sortBy?: object, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PostcardList>>; }; /** * PostcardsApi - object-oriented interface * @export * @class PostcardsApi * @extends {BaseAPI} */ export declare class PostcardsApi extends BaseAPI { /** * Creates a new postcard given information * @summary create * @param {PostcardEditable} postcardEditable * @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 PostcardsApi */ create(postcardEditable: PostcardEditable, idempotencyKey?: string, options?: AxiosRequestConfig): Promise<Postcard>; /** * Completely removes a postcard from production. This can only be done if the postcard has a `send_date` and the `send_date` has not yet passed. If the postcard 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} pscId id of the postcard * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PostcardsApi */ cancel(pscId: string, options?: AxiosRequestConfig): Promise<PostcardDeletion>; /** * Retrieves the details of an existing postcard. You need only supply the unique customer identifier that was returned upon postcard creation. * @summary get * @param {string} pscId id of the postcard * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PostcardsApi */ get(pscId: string, options?: AxiosRequestConfig): Promise<Postcard>; /** * Returns a list of your postcards. The addresses are returned sorted by creation date, with the most recently created addresses 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 {Array<PostcardSize>} [size] Specifies the size of the postcard. Only &#x60;4x6&#x60; postcards can be sent to international destinations. * @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 PostcardsApi */ list(limit?: number, before?: string, after?: string, include?: Array<string>, dateCreated?: { [key: string]: string; }, metadata?: { [key: string]: string; }, size?: Array<PostcardSize>, scheduled?: boolean, sendDate?: { [key: string]: string; }, mailType?: MailType, sortBy?: object, options?: AxiosRequestConfig): Promise<PostcardList>; } /** * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */