Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix_return_envelope #208

Merged
merged 6 commits into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
CODE_SNIPPETS.md
api.ts
api/addresses-api.ts
api/bank-accounts-api.ts
Expand Down Expand Up @@ -87,6 +86,7 @@ models/postcard-editable.ts
models/postcard-list.ts
models/postcard-size.ts
models/postcard.ts
models/return-envelope.ts
models/reverse-geocode.ts
models/self-mailer-deletion.ts
models/self-mailer-editable.ts
Expand Down
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.2.1
5.3.0
8 changes: 4 additions & 4 deletions __tests__/PostcardModels.unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe("Postcard Models", () => {

it("rejects invalid values for front_template_id", () => {
const rec = new Postcard();
expect(rec.front_template_id).toBeNull();
expect(rec.front_template_id).toBeUndefined();

const invalidValues = ["Nope"];
for (const val of invalidValues) {
Expand All @@ -101,7 +101,7 @@ describe("Postcard Models", () => {

it("allows setting valid values for front_template_id", () => {
const rec = new Postcard();
expect(rec.front_template_id).toBeNull();
expect(rec.front_template_id).toBeUndefined();

const validValues = ["tmpl_1234"];
for (const val of validValues) {
Expand All @@ -113,7 +113,7 @@ describe("Postcard Models", () => {

it("rejects invalid values for back_template_id", () => {
const rec = new Postcard();
expect(rec.back_template_id).toBeNull();
expect(rec.back_template_id).toBeUndefined();

const invalidValues = ["Nope"];
for (const val of invalidValues) {
Expand All @@ -128,7 +128,7 @@ describe("Postcard Models", () => {

it("allows setting valid values for back_template_id", () => {
const rec = new Postcard();
expect(rec.back_template_id).toBeNull();
expect(rec.back_template_id).toBeUndefined();

const validValues = ["tmpl_1234"];
for (const val of validValues) {
Expand Down
4 changes: 2 additions & 2 deletions __tests__/Postcards.unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ describe("PostcardsApi", () => {

it("lists postcards with a size parameter", async () => {
axiosRequest.mockImplementationOnce(async (request) => {
expect(request.url.split("?")[1]).toEqual("size=4x6");
expect(request.url.split("?")[1]).toEqual("size=%5B%224x6%22%5D");
return {
data: { data: [{ id: "fake 1" }, { id: "fake 2" }] },
};
Expand All @@ -344,7 +344,7 @@ describe("PostcardsApi", () => {
undefined,
undefined,
undefined,
PostcardSize._4x6
[PostcardSize._4x6]
);
expect(response).toBeDefined();
expect(response.data).toBeDefined();
Expand Down
2 changes: 1 addition & 1 deletion __tests__/SelfMailersApi.unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ describe("SelfMailersApi", () => {
undefined,
undefined,
undefined,
SelfMailerSize._6x18Bifold
[SelfMailerSize._6x18Bifold]
);
expect(selfMailersApi).toBeDefined();
expect(selfMailersApi?.data?.length).toEqual(1);
Expand Down
14 changes: 7 additions & 7 deletions api/postcards-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export const PostcardsApiAxiosParamCreator = function (
* @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 {PostcardSize} [size] Specifies the size of the postcard. Only &#x60;4x6&#x60; postcards can be sent to international destinations.
* @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.
Expand All @@ -248,7 +248,7 @@ export const PostcardsApiAxiosParamCreator = function (
include?: Array<string>,
dateCreated?: { [key: string]: string },
metadata?: { [key: string]: string },
size?: PostcardSize,
size?: Array<PostcardSize>,
scheduled?: boolean,
sendDate?: { [key: string]: string },
mailType?: MailType,
Expand Down Expand Up @@ -299,7 +299,7 @@ export const PostcardsApiAxiosParamCreator = function (
localVarQueryParameter["metadata"] = valueToString(metadata);
}

if (size !== undefined) {
if (size) {
localVarQueryParameter["size"] = valueToString(size);
}

Expand Down Expand Up @@ -429,7 +429,7 @@ export const PostcardsApiFp = function (configuration?: Configuration) {
* @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 {PostcardSize} [size] Specifies the size of the postcard. Only &#x60;4x6&#x60; postcards can be sent to international destinations.
* @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.
Expand All @@ -444,7 +444,7 @@ export const PostcardsApiFp = function (configuration?: Configuration) {
include?: Array<string>,
dateCreated?: { [key: string]: string },
metadata?: { [key: string]: string },
size?: PostcardSize,
size?: Array<PostcardSize>,
scheduled?: boolean,
sendDate?: { [key: string]: string },
mailType?: MailType,
Expand Down Expand Up @@ -567,7 +567,7 @@ export class PostcardsApi extends BaseAPI {
* @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 {PostcardSize} [size] Specifies the size of the postcard. Only &#x60;4x6&#x60; postcards can be sent to international destinations.
* @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.
Expand All @@ -583,7 +583,7 @@ export class PostcardsApi extends BaseAPI {
include?: Array<string>,
dateCreated?: { [key: string]: string },
metadata?: { [key: string]: string },
size?: PostcardSize,
size?: Array<PostcardSize>,
scheduled?: boolean,
sendDate?: { [key: string]: string },
mailType?: MailType,
Expand Down
14 changes: 7 additions & 7 deletions api/self-mailers-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export const SelfMailersApiAxiosParamCreator = function (
* @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 {SelfMailerSize} [size] The self mailer sizes to be returned.
* @param {Array<SelfMailerSize>} [size] The self mailer sizes to be returned.
* @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.
Expand All @@ -252,7 +252,7 @@ export const SelfMailersApiAxiosParamCreator = function (
include?: Array<string>,
dateCreated?: { [key: string]: string },
metadata?: { [key: string]: string },
size?: SelfMailerSize,
size?: Array<SelfMailerSize>,
scheduled?: boolean,
sendDate?: { [key: string]: string },
mailType?: MailType,
Expand Down Expand Up @@ -303,7 +303,7 @@ export const SelfMailersApiAxiosParamCreator = function (
localVarQueryParameter["metadata"] = valueToString(metadata);
}

if (size !== undefined) {
if (size) {
localVarQueryParameter["size"] = valueToString(size);
}

Expand Down Expand Up @@ -432,7 +432,7 @@ export const SelfMailersApiFp = function (configuration?: Configuration) {
* @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 {SelfMailerSize} [size] The self mailer sizes to be returned.
* @param {Array<SelfMailerSize>} [size] The self mailer sizes to be returned.
* @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.
Expand All @@ -447,7 +447,7 @@ export const SelfMailersApiFp = function (configuration?: Configuration) {
include?: Array<string>,
dateCreated?: { [key: string]: string },
metadata?: { [key: string]: string },
size?: SelfMailerSize,
size?: Array<SelfMailerSize>,
scheduled?: boolean,
sendDate?: { [key: string]: string },
mailType?: MailType,
Expand Down Expand Up @@ -570,7 +570,7 @@ export class SelfMailersApi extends BaseAPI {
* @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 {SelfMailerSize} [size] The self mailer sizes to be returned.
* @param {Array<SelfMailerSize>} [size] The self mailer sizes to be returned.
* @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.
Expand All @@ -586,7 +586,7 @@ export class SelfMailersApi extends BaseAPI {
include?: Array<string>,
dateCreated?: { [key: string]: string },
metadata?: { [key: string]: string },
size?: SelfMailerSize,
size?: Array<SelfMailerSize>,
scheduled?: boolean,
sendDate?: { [key: string]: string },
mailType?: MailType,
Expand Down
2 changes: 1 addition & 1 deletion models/check-editable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class CheckEditable {
* @type {any}
* @memberof CheckEditable
*/
"logo"?: any | null;
"logo"?: any;

/**
* The artwork to use on the bottom of the check page. Notes: - HTML merge variables should not include delimiting whitespace. - PDF, PNG, and JPGs must be sized at 8.5\"x11\" at 300 DPI, while supplied HTML will be rendered and trimmed to fit on a 8.5\"x11\" page. - The check bottom will always be printed in black & white. - Must conform to [this template](https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/check_bottom_template.pdf). Need more help? Consult our [HTML examples](#section/HTML-Examples).
Expand Down
2 changes: 1 addition & 1 deletion models/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class Events {
}

/**
* The body of the associated resource as they were at the time of the event, i.e. the [postcard object](#operation/postcard_retrieve), [the letter object](#operation/letter_retrieve), [the check object](#operation/check_retrieve), [the address object](#operation/address_retrieve), or [the bank account object](#operation/bank_account_retrieve). For `.deleted` events, the body matches the response for the corresponding delete endpoint for that resource (e.g. the [postcard delete response](#operation/postcard_delete)).
* The body of the associated resource as they were at the time of the event, i.e. the [postcard object](https://docs.lob.com/#tag/Postcards/operation/postcard_retrieve), [the letter object](https://docs.lob.com/#tag/Letters/operation/letter_retrieve), [the check object](https://docs.lob.com/#tag/Checks/operation/check_retrieve), [the address object](https://docs.lob.com/#tag/Addresses/operation/address_retrieve), or [the bank account object](https://docs.lob.com/#tag/Bank-Accounts/operation/bank_account_retrieve). For `.deleted` events, the body matches the response for the corresponding delete endpoint for that resource (e.g. the [postcard cancel response](https://docs.lob.com/#tag/Postcards/operation/postcard_delete)).
* @type {object}
* @memberof Events
*/
Expand Down
1 change: 1 addition & 0 deletions models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export * from "./postcard-deletion";
export * from "./postcard-editable";
export * from "./postcard-list";
export * from "./postcard-size";
export * from "./return-envelope";
export * from "./reverse-geocode";
export * from "./self-mailer";
export * from "./self-mailer-deletion";
Expand Down
2 changes: 1 addition & 1 deletion models/letter-editable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export class LetterEditable {
* @memberof LetterEditable
*/

"return_envelope"?: string | boolean | null;
"return_envelope"?: string | boolean;

/**
* Required if `return_envelope` is `true`. The number of the page that should be perforated for use with the return envelope. Must be greater than or equal to `1`. The blank page added by `address_placement=insert_blank_page` will be ignored when considering the perforated page number. To see how perforation will impact your letter design, view our [perforation guide](https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/letter_perf_template.pdf).
Expand Down
8 changes: 4 additions & 4 deletions models/letter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import * as Models from "./index";
import { Address } from "./address";
import { LetterCustomEnvelope } from "./letter-custom-envelope";
import { MailType } from "./mail-type";
import { ReturnEnvelope } from "./return-envelope";
import { Thumbnail } from "./thumbnail";
import { TrackingEventNormal } from "./tracking-event-normal";

Expand Down Expand Up @@ -307,12 +308,11 @@ export class Letter {
"address_placement"?: LetterAddressPlacementEnum;

/**
* indicates if a return envelope is requested for the letter. The value corresponding to this field is by default a boolean. But if the account is signed up for custom return envelopes, the value is of type string and is `no_9_single_window` for a standard return envelope and a custom `return_envelope_id` for non-standard return envelopes. To include a return envelope with your letter, set to `true` and specify the `perforated_page`. See [pricing](https://www.lob.com/pricing/print-mail#compare) for extra costs incurred.
* @type {any}
*
* @type {ReturnEnvelope}
* @memberof Letter
*/

"return_envelope"?: string | boolean | null;
"return_envelope"?: ReturnEnvelope;

/**
* Required if `return_envelope` is `true`. The number of the page that should be perforated for use with the return envelope. Must be greater than or equal to `1`. The blank page added by `address_placement=insert_blank_page` will be ignored when considering the perforated page number. To see how perforation will impact your letter design, view our [perforation guide](https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/letter_perf_template.pdf).
Expand Down
8 changes: 4 additions & 4 deletions models/postcard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ export class Postcard {
* @type {string}
* @memberof Postcard
*/
private "_front_template_id": string | null;
private "_front_template_id"?: string | null;
public get front_template_id() {
return this._front_template_id || null;
return (this._front_template_id || null || undefined) as string;
}
public set front_template_id(newValue: string | null) {
if (newValue && !/^tmpl_[a-zA-Z0-9]+$/.test(newValue)) {
Expand All @@ -196,9 +196,9 @@ export class Postcard {
* @type {string}
* @memberof Postcard
*/
private "_back_template_id": string | null;
private "_back_template_id"?: string | null;
public get back_template_id() {
return this._back_template_id || null;
return (this._back_template_id || null || undefined) as string;
}
public set back_template_id(newValue: string | null) {
if (newValue && !/^tmpl_[a-zA-Z0-9]+$/.test(newValue)) {
Expand Down
Loading