@lob/lob-typescript-sdk
Version:
Lob API wrapper
197 lines (196 loc) • 13.6 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 { SelfMailer } from "../models";
import { SelfMailerDeletion } from "../models";
import { SelfMailerEditable } from "../models";
import { SelfMailerList } from "../models";
import { SelfMailerSize } from "../models";
/**
* SelfMailersApi - axios parameter creator
* @export
*/
export declare const SelfMailersApiAxiosParamCreator: (configuration?: Configuration) => {
/**
* Creates a new self_mailer given information
* @summary create
* @param {SelfMailerEditable} selfMailerEditable
* @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}
*/
selfMailerCreate: (selfMailerEditable: SelfMailerEditable, idempotencyKey?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
/**
* Completely removes a self mailer from production. This can only be done if the self mailer\'s `send_date` has not yet passed.
* @summary delete
* @param {string} sfmId id of the self_mailer
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
selfMailerDelete: (sfmId: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
/**
* Retrieves the details of an existing self_mailer. You need only supply the unique self_mailer identifier that was returned upon self_mailer creation.
* @summary get
* @param {string} sfmId id of the self_mailer
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
selfMailerRetrieve: (sfmId: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
/**
* Returns a list of your self_mailers. The self_mailers are returned sorted by creation date, with the most recently created self_mailers 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<SelfMailerSize>} [size] The self mailer sizes to be returned.
* @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}
*/
selfMailersList: (limit?: number, before?: string, after?: string, include?: Array<string>, dateCreated?: {
[key: string]: string;
} | undefined, metadata?: {
[key: string]: string;
} | undefined, size?: Array<SelfMailerSize>, scheduled?: boolean, sendDate?: {
[key: string]: string;
} | undefined, mailType?: MailType, sortBy?: object, options?: AxiosRequestConfig) => Promise<RequestArgs>;
};
/**
* SelfMailersApi - functional programming interface
* @export
*/
export declare const SelfMailersApiFp: (configuration?: Configuration) => {
/**
* Creates a new self_mailer given information
* @summary create
* @param {SelfMailerEditable} selfMailerEditable
* @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}
*/
selfMailerCreate(selfMailerEditable: SelfMailerEditable, idempotencyKey?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SelfMailer>>;
/**
* Completely removes a self mailer from production. This can only be done if the self mailer\'s `send_date` has not yet passed.
* @summary delete
* @param {string} sfmId id of the self_mailer
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
selfMailerDelete(sfmId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SelfMailerDeletion>>;
/**
* Retrieves the details of an existing self_mailer. You need only supply the unique self_mailer identifier that was returned upon self_mailer creation.
* @summary get
* @param {string} sfmId id of the self_mailer
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
selfMailerRetrieve(sfmId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SelfMailer>>;
/**
* Returns a list of your self_mailers. The self_mailers are returned sorted by creation date, with the most recently created self_mailers 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<SelfMailerSize>} [size] The self mailer sizes to be returned.
* @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}
*/
selfMailersList(limit?: number, before?: string, after?: string, include?: Array<string>, dateCreated?: {
[key: string]: string;
} | undefined, metadata?: {
[key: string]: string;
} | undefined, size?: Array<SelfMailerSize>, scheduled?: boolean, sendDate?: {
[key: string]: string;
} | undefined, mailType?: MailType, sortBy?: object, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SelfMailerList>>;
};
/**
* SelfMailersApi - object-oriented interface
* @export
* @class SelfMailersApi
* @extends {BaseAPI}
*/
export declare class SelfMailersApi extends BaseAPI {
/**
* Creates a new self_mailer given information
* @summary create
* @param {SelfMailerEditable} selfMailerEditable
* @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 SelfMailersApi
*/
create(selfMailerEditable: SelfMailerEditable, idempotencyKey?: string, options?: AxiosRequestConfig): Promise<SelfMailer>;
/**
* Completely removes a self mailer from production. This can only be done if the self mailer\'s `send_date` has not yet passed.
* @summary delete
* @param {string} sfmId id of the self_mailer
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SelfMailersApi
*/
delete(sfmId: string, options?: AxiosRequestConfig): Promise<SelfMailerDeletion>;
/**
* Retrieves the details of an existing self_mailer. You need only supply the unique self_mailer identifier that was returned upon self_mailer creation.
* @summary get
* @param {string} sfmId id of the self_mailer
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SelfMailersApi
*/
get(sfmId: string, options?: AxiosRequestConfig): Promise<SelfMailer>;
/**
* Returns a list of your self_mailers. The self_mailers are returned sorted by creation date, with the most recently created self_mailers 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<SelfMailerSize>} [size] The self mailer sizes to be returned.
* @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 SelfMailersApi
*/
list(limit?: number, before?: string, after?: string, include?: Array<string>, dateCreated?: {
[key: string]: string;
}, metadata?: {
[key: string]: string;
}, size?: Array<SelfMailerSize>, scheduled?: boolean, sendDate?: {
[key: string]: string;
}, mailType?: MailType, sortBy?: object, options?: AxiosRequestConfig): Promise<SelfMailerList>;
}
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/