Skip to content

Commit

Permalink
feat(AV-4395): update us verifications response body
Browse files Browse the repository at this point in the history
  • Loading branch information
amaan-lob committed Oct 26, 2023
1 parent 29cda2b commit 0860679
Show file tree
Hide file tree
Showing 3 changed files with 185 additions and 4 deletions.
152 changes: 151 additions & 1 deletion lib/openapi_client/models/deliverability_analysis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,24 @@ class DeliverabilityAnalysis
# Corresponds to the USPS field `dpv_no_stat`. Indicates that an address has been vacated in the recent past, and is no longer receiving deliveries. If it's been unoccupied for 90+ days, or temporarily vacant, this will be flagged. Possible values are: * `Y` –– Address is active. * `N` –– Address is not active. * `''` –– A DPV match is not made (`deliverability_analysis[dpv_confirmation]` is `N` or an empty string).
attr_accessor :dpv_active

# 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.
attr_accessor :dpv_inactive_reason

# 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).
attr_accessor :dpv_throwback

# 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).
attr_accessor :dpv_non_delivery_day_flag

# 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).
attr_accessor :dpv_non_delivery_day_values

# 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).
attr_accessor :dpv_no_secure_location

# 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).
attr_accessor :dpv_door_not_accessible

# 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).
attr_accessor :dpv_footnotes

Expand Down Expand Up @@ -72,6 +90,12 @@ def self.attribute_map
:'dpv_cmra' => :'dpv_cmra',
:'dpv_vacant' => :'dpv_vacant',
:'dpv_active' => :'dpv_active',
:'dpv_inactive_reason' => :'dpv_inactive_reason',
:'dpv_throwback' => :'dpv_throwback',
:'dpv_non_delivery_day_flag' => :'dpv_non_delivery_day_flag',
:'dpv_non_delivery_day_values' => :'dpv_non_delivery_day_values',
:'dpv_no_secure_location' => :'dpv_no_secure_location',
:'dpv_door_not_accessible' => :'dpv_door_not_accessible',
:'dpv_footnotes' => :'dpv_footnotes',
:'ews_match' => :'ews_match',
:'lacs_indicator' => :'lacs_indicator',
Expand All @@ -92,6 +116,12 @@ def self.openapi_types
:'dpv_cmra' => :'String',
:'dpv_vacant' => :'String',
:'dpv_active' => :'String',
:'dpv_inactive_reason' => :'String',
:'dpv_throwback' => :'String',
:'dpv_non_delivery_day_flag' => :'String',
:'dpv_non_delivery_day_values' => :'String',
:'dpv_no_secure_location' => :'String',
:'dpv_door_not_accessible' => :'String',
:'dpv_footnotes' => :'Array<DpvFootnote>',
:'ews_match' => :'Boolean',
:'lacs_indicator' => :'String',
Expand Down Expand Up @@ -137,6 +167,30 @@ def initialize(attributes = {})
self.dpv_active = attributes[:'dpv_active']
end

if attributes.key?(:'dpv_inactive_reason')
self.dpv_inactive_reason = attributes[:'dpv_inactive_reason']
end

if attributes.key?(:'dpv_throwback')
self.dpv_throwback = attributes[:'dpv_throwback']
end

if attributes.key?(:'dpv_non_delivery_day_flag')
self.dpv_non_delivery_day_flag = attributes[:'dpv_non_delivery_day_flag']
end

if attributes.key?(:'dpv_non_delivery_day_values')
self.dpv_non_delivery_day_values = attributes[:'dpv_non_delivery_day_values']
end

if attributes.key?(:'dpv_no_secure_location')
self.dpv_no_secure_location = attributes[:'dpv_no_secure_location']
end

if attributes.key?(:'dpv_door_not_accessible')
self.dpv_door_not_accessible = attributes[:'dpv_door_not_accessible']
end

if attributes.key?(:'dpv_footnotes')
if (value = attributes[:'dpv_footnotes']).is_a?(Array)
self.dpv_footnotes = value
Expand Down Expand Up @@ -180,6 +234,30 @@ def list_invalid_properties
invalid_properties.push('invalid value for "dpv_active", dpv_active cannot be nil.')
end

if @dpv_inactive_reason.nil?
invalid_properties.push('invalid value for "dpv_inactive_reason", dpv_inactive_reason cannot be nil.')
end

if @dpv_throwback.nil?
invalid_properties.push('invalid value for "dpv_throwback", dpv_throwback cannot be nil.')
end

if @dpv_non_delivery_day_flag.nil?
invalid_properties.push('invalid value for "dpv_non_delivery_day_flag", dpv_non_delivery_day_flag cannot be nil.')
end

if @dpv_non_delivery_day_values.nil?
invalid_properties.push('invalid value for "dpv_non_delivery_day_values", dpv_non_delivery_day_values cannot be nil.')
end

if @dpv_no_secure_location.nil?
invalid_properties.push('invalid value for "dpv_no_secure_location", dpv_no_secure_location cannot be nil.')
end

if @dpv_door_not_accessible.nil?
invalid_properties.push('invalid value for "dpv_door_not_accessible", dpv_door_not_accessible cannot be nil.')
end

if @dpv_footnotes.nil?
invalid_properties.push('invalid value for "dpv_footnotes", dpv_footnotes cannot be nil.')
end
Expand Down Expand Up @@ -218,6 +296,22 @@ def valid?
return false if @dpv_active.nil?
dpv_active_validator = EnumAttributeValidator.new('String', ["Y", "N", ""])
return false unless dpv_active_validator.valid?(@dpv_active)
return false if @dpv_inactive_reason.nil?
dpv_inactive_reason_validator = EnumAttributeValidator.new('String', ["01", "02", "03", "04", "05", "06", ""])
return false unless dpv_inactive_reason_validator.valid?(@dpv_inactive_reason)
return false if @dpv_throwback.nil?
dpv_throwback_validator = EnumAttributeValidator.new('String', ["Y", "N", ""])
return false unless dpv_throwback_validator.valid?(@dpv_throwback)
return false if @dpv_non_delivery_day_flag.nil?
dpv_non_delivery_day_flag_validator = EnumAttributeValidator.new('String', ["Y", "N", ""])
return false unless dpv_non_delivery_day_flag_validator.valid?(@dpv_non_delivery_day_flag)
return false if @dpv_non_delivery_day_values.nil?
return false if @dpv_no_secure_location.nil?
dpv_no_secure_location_validator = EnumAttributeValidator.new('String', ["Y", "N", ""])
return false unless dpv_no_secure_location_validator.valid?(@dpv_no_secure_location)
return false if @dpv_door_not_accessible.nil?
dpv_door_not_accessible_validator = EnumAttributeValidator.new('String', ["Y", "N", ""])
return false unless dpv_door_not_accessible_validator.valid?(@dpv_door_not_accessible)
return false if @dpv_footnotes.nil?
return false if @ews_match.nil?
return false if @lacs_indicator.nil?
Expand Down Expand Up @@ -270,6 +364,56 @@ def dpv_active=(dpv_active)
@dpv_active = dpv_active
end

# Custom attribute writer method checking allowed values (enum).
# @param [Object] dpv_inactive_reason Object to be assigned
def dpv_inactive_reason=(dpv_inactive_reason)
validator = EnumAttributeValidator.new('String', ["01", "02", "03", "04", "05", "06", ""])
unless validator.valid?(dpv_inactive_reason)
fail ArgumentError, "invalid value for \"dpv_inactive_reason\", must be one of #{validator.allowable_values}."
end
@dpv_inactive_reason = dpv_inactive_reason
end

# Custom attribute writer method checking allowed values (enum).
# @param [Object] dpv_throwback Object to be assigned
def dpv_throwback=(dpv_throwback)
validator = EnumAttributeValidator.new('String', ["Y", "N", ""])
unless validator.valid?(dpv_throwback)
fail ArgumentError, "invalid value for \"dpv_throwback\", must be one of #{validator.allowable_values}."
end
@dpv_throwback = dpv_throwback
end

# Custom attribute writer method checking allowed values (enum).
# @param [Object] dpv_non_delivery_day_flag Object to be assigned
def dpv_non_delivery_day_flag=(dpv_non_delivery_day_flag)
validator = EnumAttributeValidator.new('String', ["Y", "N", ""])
unless validator.valid?(dpv_non_delivery_day_flag)
fail ArgumentError, "invalid value for \"dpv_non_delivery_day_flag\", must be one of #{validator.allowable_values}."
end
@dpv_non_delivery_day_flag = dpv_non_delivery_day_flag
end

# Custom attribute writer method checking allowed values (enum).
# @param [Object] dpv_no_secure_location Object to be assigned
def dpv_no_secure_location=(dpv_no_secure_location)
validator = EnumAttributeValidator.new('String', ["Y", "N", ""])
unless validator.valid?(dpv_no_secure_location)
fail ArgumentError, "invalid value for \"dpv_no_secure_location\", must be one of #{validator.allowable_values}."
end
@dpv_no_secure_location = dpv_no_secure_location
end

# Custom attribute writer method checking allowed values (enum).
# @param [Object] dpv_door_not_accessible Object to be assigned
def dpv_door_not_accessible=(dpv_door_not_accessible)
validator = EnumAttributeValidator.new('String', ["Y", "N", ""])
unless validator.valid?(dpv_door_not_accessible)
fail ArgumentError, "invalid value for \"dpv_door_not_accessible\", must be one of #{validator.allowable_values}."
end
@dpv_door_not_accessible = dpv_door_not_accessible
end

# Custom attribute writer method checking allowed values (enum).
# @param [Object] lacs_indicator Object to be assigned
def lacs_indicator=(lacs_indicator)
Expand Down Expand Up @@ -299,6 +443,12 @@ def ==(o)
dpv_cmra == o.dpv_cmra &&
dpv_vacant == o.dpv_vacant &&
dpv_active == o.dpv_active &&
dpv_inactive_reason == o.dpv_inactive_reason &&
dpv_throwback == o.dpv_throwback &&
dpv_non_delivery_day_flag == o.dpv_non_delivery_day_flag &&
dpv_non_delivery_day_values == o.dpv_non_delivery_day_values &&
dpv_no_secure_location == o.dpv_no_secure_location &&
dpv_door_not_accessible == o.dpv_door_not_accessible &&
dpv_footnotes == o.dpv_footnotes &&
ews_match == o.ews_match &&
lacs_indicator == o.lacs_indicator &&
Expand All @@ -315,7 +465,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[dpv_confirmation, dpv_cmra, dpv_vacant, dpv_active, dpv_footnotes, ews_match, lacs_indicator, lacs_return_code, suite_return_code].hash
[dpv_confirmation, dpv_cmra, dpv_vacant, dpv_active, dpv_inactive_reason, dpv_throwback, dpv_non_delivery_day_flag, dpv_non_delivery_day_values, dpv_no_secure_location, dpv_door_not_accessible, dpv_footnotes, ews_match, lacs_indicator, lacs_return_code, suite_return_code].hash
end


Expand Down
8 changes: 6 additions & 2 deletions lib/openapi_client/models/dpv_footnote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,21 @@ class DpvFootnote
A1 = "A1".freeze
BB = "BB".freeze
CC = "CC".freeze
N1 = "N1".freeze
C1 = "C1".freeze
F1 = "F1".freeze
G1 = "G1".freeze
U1 = "U1".freeze
IA = "IA".freeze
M1 = "M1".freeze
M3 = "M3".freeze
N1 = "N1".freeze
PB = "PB".freeze
P1 = "P1".freeze
P3 = "P3".freeze
R1 = "R1".freeze
R7 = "R7".freeze
RR = "RR".freeze
TA = "TA".freeze
U1 = "U1".freeze

# Builds the enum from string
# @param [String] The enum value in the form of the string
Expand Down
29 changes: 28 additions & 1 deletion lib/openapi_client/models/us_components.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ class UsComponents
# The type of `components[carrier_route]`. For more detailed information about each carrier route type, see [US Verification Details](#tag/US-Verification-Types).
attr_accessor :carrier_route_type

# Indicates the mailing facility for an address only supports PO Box deliveries and other forms of mail delivery are not available.
attr_accessor :po_box_only_flag

# 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`).
attr_accessor :latitude

Expand Down Expand Up @@ -140,6 +143,7 @@ def self.attribute_map
:'county_fips' => :'county_fips',
:'carrier_route' => :'carrier_route',
:'carrier_route_type' => :'carrier_route_type',
:'po_box_only_flag' => :'po_box_only_flag',
:'latitude' => :'latitude',
:'longitude' => :'longitude'
}
Expand Down Expand Up @@ -177,6 +181,7 @@ def self.openapi_types
:'county_fips' => :'String',
:'carrier_route' => :'String',
:'carrier_route_type' => :'String',
:'po_box_only_flag' => :'String',
:'latitude' => :'Float',
:'longitude' => :'Float'
}
Expand Down Expand Up @@ -301,6 +306,10 @@ def initialize(attributes = {})
self.carrier_route_type = attributes[:'carrier_route_type']
end

if attributes.key?(:'po_box_only_flag')
self.po_box_only_flag = attributes[:'po_box_only_flag']
end

if attributes.key?(:'latitude')
self.latitude = attributes[:'latitude']
end
Expand Down Expand Up @@ -428,6 +437,10 @@ def list_invalid_properties
invalid_properties.push('invalid value for "carrier_route_type", carrier_route_type cannot be nil.')
end

if @po_box_only_flag.nil?
invalid_properties.push('invalid value for "po_box_only_flag", po_box_only_flag cannot be nil.')
end

invalid_properties
end

Expand Down Expand Up @@ -472,6 +485,9 @@ def valid?
return false if @carrier_route_type.nil?
carrier_route_type_validator = EnumAttributeValidator.new('String', ["city_delivery", "rural_route", "highway_contract", "po_box", "general_delivery", ""])
return false unless carrier_route_type_validator.valid?(@carrier_route_type)
return false if @po_box_only_flag.nil?
po_box_only_flag_validator = EnumAttributeValidator.new('String', ["Y", "N", ""])
return false unless po_box_only_flag_validator.valid?(@po_box_only_flag)
true
end

Expand Down Expand Up @@ -583,6 +599,16 @@ def carrier_route_type=(carrier_route_type)
@carrier_route_type = carrier_route_type
end

# Custom attribute writer method checking allowed values (enum).
# @param [Object] po_box_only_flag Object to be assigned
def po_box_only_flag=(po_box_only_flag)
validator = EnumAttributeValidator.new('String', ["Y", "N", ""])
unless validator.valid?(po_box_only_flag)
fail ArgumentError, "invalid value for \"po_box_only_flag\", must be one of #{validator.allowable_values}."
end
@po_box_only_flag = po_box_only_flag
end

# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
Expand Down Expand Up @@ -612,6 +638,7 @@ def ==(o)
county_fips == o.county_fips &&
carrier_route == o.carrier_route &&
carrier_route_type == o.carrier_route_type &&
po_box_only_flag == o.po_box_only_flag &&
latitude == o.latitude &&
longitude == o.longitude
end
Expand All @@ -625,7 +652,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[primary_number, street_predirection, street_name, street_suffix, street_postdirection, secondary_designator, secondary_number, pmb_designator, pmb_number, extra_secondary_designator, extra_secondary_number, city, state, zip_code, zip_code_plus_4, zip_code_type, delivery_point_barcode, address_type, record_type, default_building_address, county, county_fips, carrier_route, carrier_route_type, latitude, longitude].hash
[primary_number, street_predirection, street_name, street_suffix, street_postdirection, secondary_designator, secondary_number, pmb_designator, pmb_number, extra_secondary_designator, extra_secondary_number, city, state, zip_code, zip_code_plus_4, zip_code_type, delivery_point_barcode, address_type, record_type, default_building_address, county, county_fips, carrier_route, carrier_route_type, po_box_only_flag, latitude, longitude].hash
end


Expand Down

0 comments on commit 0860679

Please sign in to comment.