Skip to content

Commit

Permalink
Merge pull request #272 from lob/AV-4395-us-verifications-update
Browse files Browse the repository at this point in the history
  • Loading branch information
amaan-lob committed Nov 10, 2023
2 parents f31502d + f3f94d5 commit 0edcf38
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 7 deletions.
109 changes: 109 additions & 0 deletions models/deliverability-analysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ export class DeliverabilityAnalysis {
if (typeof input?.dpv_active !== "undefined") {
this.dpv_active = input.dpv_active;
}
if (typeof input?.dpv_inactive_reason !== "undefined") {
this.dpv_inactive_reason = input.dpv_inactive_reason;
}
if (typeof input?.dpv_throwback !== "undefined") {
this.dpv_throwback = input.dpv_throwback;
}
if (typeof input?.dpv_non_delivery_day_flag !== "undefined") {
this.dpv_non_delivery_day_flag = input.dpv_non_delivery_day_flag;
}
if (typeof input?.dpv_non_delivery_day_values !== "undefined") {
this.dpv_non_delivery_day_values = input.dpv_non_delivery_day_values;
}
if (typeof input?.dpv_no_secure_location !== "undefined") {
this.dpv_no_secure_location = input.dpv_no_secure_location;
}
if (typeof input?.dpv_door_not_accessible !== "undefined") {
this.dpv_door_not_accessible = input.dpv_door_not_accessible;
}
if (typeof input?.dpv_footnotes !== "undefined") {
this.dpv_footnotes = input.dpv_footnotes;
}
Expand Down Expand Up @@ -80,6 +98,48 @@ export class DeliverabilityAnalysis {
*/
"dpv_active": DeliverabilityAnalysisDpvActiveEnum;

/**
* Indicates the reason why an address is vacant or no longer receiving deliveries. Possible values are: * `01` –– Address does not receive mail from the USPS directly, but is serviced by a drop address. * `02` –– Address not yet deliverable. * `03` –– A DPV match is not made (`deliverability_analysis[dpv_confirmation]` is `N` or an empty string). * `04` –– Address is a College, Military Zone, or other type. * `05` –– Address no longer receives deliveries. * `06` –– Address is missing required secondary information. * `\'\'` –– A DPV match is not made or the address is active.
* @type {string}
* @memberof DeliverabilityAnalysis
*/
"dpv_inactive_reason": DeliverabilityAnalysisDpvInactiveReasonEnum;

/**
* Indicates a street address for which mail is delivered to a PO Box. Possible values are: * `Y` –– Address is a PO Box throwback delivery point. * `N` –– Address is not a PO Box throwback delivery point. * `\'\'` –– A DPV match is not made (`deliverability_analysis[dpv_confirmation]` is `N` or an empty string).
* @type {string}
* @memberof DeliverabilityAnalysis
*/
"dpv_throwback": DeliverabilityAnalysisDpvThrowbackEnum;

/**
* Indicates whether deliveries are not performed on one or more days of the week at an address. Possible values are: * `Y` –– Mail delivery does not occur on some days of the week. * `N` –– Mail delivery occurs every day of the week. * `\'\'` –– A DPV match is not made (`deliverability_analysis[dpv_confirmation]` is `N` or an empty string).
* @type {string}
* @memberof DeliverabilityAnalysis
*/
"dpv_non_delivery_day_flag": DeliverabilityAnalysisDpvNonDeliveryDayFlagEnum;

/**
* Indicates days of the week (starting on Sunday) deliveries are not performed at an address. For example: * `YNNNNNN` –– Mail delivery does not occur on Sunday\'s. * `NYNNNYN` –– Mail delivery does not occur on Monday\'s or Friday\'s. * `\'\'` –– A DPV match is not made (`deliverability_analysis[dpv_confirmation]` is `N` or an empty string) or address receives mail every day of the week (`deliverability_analysis[dpv_non_delivery_day_flag]` is `N` or an empty string).
* @type {string}
* @memberof DeliverabilityAnalysis
*/
"dpv_non_delivery_day_values": string;

/**
* Indicates packages to this address will not be left due to security concerns. Possible values are: * `Y` –– Address does not have a secure mailbox. * `N` –– Address has a secure mailbox. * `\'\'` –– A DPV match is not made (`deliverability_analysis[dpv_confirmation]` is `N` or an empty string).
* @type {string}
* @memberof DeliverabilityAnalysis
*/
"dpv_no_secure_location": DeliverabilityAnalysisDpvNoSecureLocationEnum;

/**
* Indicates the door of the address is not accessible for mail delivery. Possible values are: * `Y` –– Door is not accessible. * `N` –– Door is accessible. * `\'\'` –– A DPV match is not made (`deliverability_analysis[dpv_confirmation]` is `N` or an empty string).
* @type {string}
* @memberof DeliverabilityAnalysis
*/
"dpv_door_not_accessible": DeliverabilityAnalysisDpvDoorNotAccessibleEnum;

/**
* An array of 2-character strings that gives more insight into how `deliverability_analysis[dpv_confirmation]` was determined. Will always include at least 1 string, and can include up to 3. For details, see [US Verification Details](#tag/US-Verification-Types).
* @type {Array<DpvFootnote>}
Expand Down Expand Up @@ -164,6 +224,55 @@ export enum DeliverabilityAnalysisDpvActiveEnum {
N = "N",
Empty = "",
}
/**
* @export
* @enum {string}
*/
export enum DeliverabilityAnalysisDpvInactiveReasonEnum {
_01 = "01",
_02 = "02",
_03 = "03",
_04 = "04",
_05 = "05",
_06 = "06",
Empty = "",
}
/**
* @export
* @enum {string}
*/
export enum DeliverabilityAnalysisDpvThrowbackEnum {
Y = "Y",
N = "N",
Empty = "",
}
/**
* @export
* @enum {string}
*/
export enum DeliverabilityAnalysisDpvNonDeliveryDayFlagEnum {
Y = "Y",
N = "N",
Empty = "",
}
/**
* @export
* @enum {string}
*/
export enum DeliverabilityAnalysisDpvNoSecureLocationEnum {
Y = "Y",
N = "N",
Empty = "",
}
/**
* @export
* @enum {string}
*/
export enum DeliverabilityAnalysisDpvDoorNotAccessibleEnum {
Y = "Y",
N = "N",
Empty = "",
}
/**
* @export
* @enum {string}
Expand Down
8 changes: 6 additions & 2 deletions models/dpv-footnote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,21 @@ export enum DpvFootnote {
A1 = "A1",
Bb = "BB",
Cc = "CC",
N1 = "N1",
C1 = "C1",
F1 = "F1",
G1 = "G1",
U1 = "U1",
Ia = "IA",
M1 = "M1",
M3 = "M3",
N1 = "N1",
Pb = "PB",
P1 = "P1",
P3 = "P3",
R1 = "R1",
R7 = "R7",
Rr = "RR",
Ta = "TA",
U1 = "U1",
}

/**
Expand Down
23 changes: 21 additions & 2 deletions models/us-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ export class UsComponents {
if (typeof input?.carrier_route_type !== "undefined") {
this.carrier_route_type = input.carrier_route_type;
}
if (typeof input?.po_box_only_flag !== "undefined") {
this.po_box_only_flag = input.po_box_only_flag;
}
if (typeof input?.latitude !== "undefined") {
this.latitude = input.latitude;
}
Expand Down Expand Up @@ -204,7 +207,7 @@ export class UsComponents {
return this._zip_code;
}
public set zip_code(newValue: string) {
if (newValue && !/^\d{5}$/.test(newValue)) {
if (newValue && !/(^$)|(^\d{5}$)/.test(newValue)) {
throw new Error("Invalid zip_code provided");
}
this._zip_code = newValue;
Expand All @@ -220,7 +223,7 @@ export class UsComponents {
return this._zip_code_plus_4;
}
public set zip_code_plus_4(newValue: string) {
if (newValue && !/^\d{4}$/.test(newValue)) {
if (newValue && !/^(\d{4})?$/.test(newValue)) {
throw new Error("Invalid zip_code_plus_4 provided");
}
this._zip_code_plus_4 = newValue;
Expand Down Expand Up @@ -289,6 +292,13 @@ export class UsComponents {
*/
"carrier_route_type": UsComponentsCarrierRouteTypeEnum;

/**
* Indicates the mailing facility for an address only supports PO Box deliveries and other forms of mail delivery are not available.
* @type {string}
* @memberof UsComponents
*/
"po_box_only_flag": UsComponentsPoBoxOnlyFlagEnum;

/**
* A positive or negative decimal indicating the geographic latitude of the address, specifying the north-to-south position of a location. This should be used with `longitude` to pinpoint locations on a map. Will not be returned for undeliverable addresses or military addresses (state is `AA`, `AE`, or `AP`).
* @type {number}
Expand Down Expand Up @@ -378,6 +388,15 @@ export enum UsComponentsCarrierRouteTypeEnum {
GeneralDelivery = "general_delivery",
Empty = "",
}
/**
* @export
* @enum {string}
*/
export enum UsComponentsPoBoxOnlyFlagEnum {
Y = "Y",
N = "N",
Empty = "",
}

/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"address validation",
"address autocomplete"
],
"version": "1.3.2",
"version": "1.3.3",
"homepage": "https://github.com/lob/lob-typescript-sdk",
"author": "Lob <[email protected]> (https://lob.com/)",
"repository": {
Expand Down

0 comments on commit 0edcf38

Please sign in to comment.