@lob/lob-typescript-sdk
Version:
Lob API wrapper
197 lines (196 loc) • 14.8 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 { 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 `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 {Array<PostcardSize>} [size] Specifies the size of the postcard. Only `4x6` postcards can be sent to international destinations.
* @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}
*/
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 `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 {Array<PostcardSize>} [size] Specifies the size of the postcard. Only `4x6` postcards can be sent to international destinations.
* @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}
*/
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 `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 {Array<PostcardSize>} [size] Specifies the size of the postcard. Only `4x6` postcards can be sent to international destinations.
* @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 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.
*/