Skip to content

Commit

Permalink
Merge pull request #229 from lob/feature/AV-4626-transient-id
Browse files Browse the repository at this point in the history
AV-4626 feat(us_verification): adding transient id field to us verification a…
  • Loading branch information
mrkaspa authored Feb 16, 2024
2 parents 0214dc5 + 8972b00 commit 79d049e
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 47 deletions.
8 changes: 5 additions & 3 deletions docs/MultipleComponents.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Lob::MultipleComponents
# OpenapiClient::MultipleComponents

## Properties

Expand All @@ -11,20 +11,22 @@
| **city** | **String** | | [optional] |
| **state** | **String** | The [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US) two letter code or subdivision name for the state. `city` and `state` are required if no `zip_code` is passed. | [optional] |
| **zip_code** | **String** | Required if `city` and `state` are not passed in. If included, must be formatted as a US ZIP or ZIP+4 (e.g. `94107`, `941072282`, `94107-2282`). | [optional] |
| **transient_id** | **String** | ID that is returned in the response body for the verification | [optional] |

## Example

```ruby
require 'openapi_client'

instance = Lob::MultipleComponents.new(
instance = OpenapiClient::MultipleComponents.new(
recipient: null,
primary_line: null,
secondary_line: null,
urbanization: null,
city: null,
state: null,
zip_code: null
zip_code: null,
transient_id: null
)
```

10 changes: 7 additions & 3 deletions docs/UsVerification.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Lob::UsVerification
# OpenapiClient::UsVerification

## Properties

Expand All @@ -11,28 +11,32 @@
| **urbanization** | **String** | Only present for addresses in Puerto Rico. An urbanization refers to an area, sector, or development within a city. See [USPS documentation](https://pe.usps.com/text/pub28/28api_008.htm#:~:text=I51.,-4%20Urbanizations&text=In%20Puerto%20Rico%2C%20identical%20street,placed%20before%20the%20urbanization%20name.) for clarification. | [optional] |
| **last_line** | **String** | Combination of the following applicable `components`: * City (`city`) * State (`state`) * ZIP code (`zip_code`) * ZIP+4 (`zip_code_plus_4`) | [optional] |
| **deliverability** | **String** | Summarizes the deliverability of the `us_verification` object. For full details, see the `deliverability_analysis` field. Possible values are: * `deliverable` – The address is deliverable by the USPS. * `deliverable_unnecessary_unit` – The address is deliverable, but the secondary unit information is unnecessary. * `deliverable_incorrect_unit` – The address is deliverable to the building's default address but the secondary unit provided may not exist. There is a chance the mail will not reach the intended recipient. * `deliverable_missing_unit` – The address is deliverable to the building's default address but is missing secondary unit information. There is a chance the mail will not reach the intended recipient. * `undeliverable` – The address is not deliverable according to the USPS. | [optional] |
| **valid_address** | **Boolean** | This field indicates whether an address was found in a more comprehensive address dataset that includes sources from the USPS, open source mapping data, and our proprietary mail delivery data. This field can be interpreted as a representation of whether an address is a real location or not. Additionally a valid address may contradict the deliverability field since an address can be a real valid location but the USPS may not deliver to that address. | [optional] |
| **components** | [**UsComponents**](UsComponents.md) | | [optional] |
| **deliverability_analysis** | [**DeliverabilityAnalysis**](DeliverabilityAnalysis.md) | | [optional] |
| **lob_confidence_score** | [**LobConfidenceScore**](LobConfidenceScore.md) | | [optional] |
| **object** | **String** | | [optional][default to 'us_verification'] |
| **transient_id** | **String** | ID that is returned in the response body for the verification | [optional] |

## Example

```ruby
require 'openapi_client'

instance = Lob::UsVerification.new(
instance = OpenapiClient::UsVerification.new(
id: null,
recipient: null,
primary_line: null,
secondary_line: null,
urbanization: null,
last_line: null,
deliverability: null,
valid_address: null,
components: null,
deliverability_analysis: null,
lob_confidence_score: null,
object: null
object: null,
transient_id: null
)
```

6 changes: 4 additions & 2 deletions docs/UsVerificationOrError.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Lob::UsVerificationOrError
# OpenapiClient::UsVerificationOrError

## Properties

Expand All @@ -15,14 +15,15 @@
| **deliverability_analysis** | [**DeliverabilityAnalysis**](DeliverabilityAnalysis.md) | | [optional] |
| **lob_confidence_score** | [**LobConfidenceScore**](LobConfidenceScore.md) | | [optional] |
| **object** | **String** | | [optional][default to 'us_verification'] |
| **transient_id** | **String** | ID that is returned in the response body for the verification | [optional] |
| **error** | [**BulkError**](BulkError.md) | | [optional] |

## Example

```ruby
require 'openapi_client'

instance = Lob::UsVerificationOrError.new(
instance = OpenapiClient::UsVerificationOrError.new(
id: null,
recipient: null,
primary_line: null,
Expand All @@ -34,6 +35,7 @@ instance = Lob::UsVerificationOrError.new(
deliverability_analysis: null,
lob_confidence_score: null,
object: null,
transient_id: null,
error: null
)
```
Expand Down
4 changes: 2 additions & 2 deletions docs/UsVerifications.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Lob::UsVerifications
# OpenapiClient::UsVerifications

## Properties

Expand All @@ -12,7 +12,7 @@
```ruby
require 'openapi_client'

instance = Lob::UsVerifications.new(
instance = OpenapiClient::UsVerifications.new(
addresses: null,
errors: null
)
Expand Down
8 changes: 5 additions & 3 deletions docs/UsVerificationsWritable.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Lob::UsVerificationsWritable
# OpenapiClient::UsVerificationsWritable

## Properties

Expand All @@ -12,21 +12,23 @@
| **city** | **String** | | [optional] |
| **state** | **String** | The [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US) two letter code or subdivision name for the state. `city` and `state` are required if no `zip_code` is passed. | [optional] |
| **zip_code** | **String** | Required if `city` and `state` are not passed in. If included, must be formatted as a US ZIP or ZIP+4 (e.g. `94107`, `941072282`, `94107-2282`). | [optional] |
| **transient_id** | **String** | ID that is returned in the response body for the verification | [optional] |

## Example

```ruby
require 'openapi_client'

instance = Lob::UsVerificationsWritable.new(
instance = OpenapiClient::UsVerificationsWritable.new(
address: null,
recipient: null,
primary_line: null,
secondary_line: null,
urbanization: null,
city: null,
state: null,
zip_code: null
zip_code: null,
transient_id: null
)
```

26 changes: 18 additions & 8 deletions lib/openapi_client/models/multiple_components.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
require 'date'
require 'time'

module Lob
module OpenapiClient
class MultipleComponents
# The intended recipient, typically a person's or firm's name.
attr_accessor :recipient
Expand All @@ -35,6 +35,9 @@ class MultipleComponents
# Required if `city` and `state` are not passed in. If included, must be formatted as a US ZIP or ZIP+4 (e.g. `94107`, `941072282`, `94107-2282`).
attr_accessor :zip_code

# ID that is returned in the response body for the verification
attr_accessor :transient_id

# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
Expand All @@ -44,7 +47,8 @@ def self.attribute_map
:'urbanization' => :'urbanization',
:'city' => :'city',
:'state' => :'state',
:'zip_code' => :'zip_code'
:'zip_code' => :'zip_code',
:'transient_id' => :'transient_id'
}
end

Expand All @@ -62,7 +66,8 @@ def self.openapi_types
:'urbanization' => :'String',
:'city' => :'String',
:'state' => :'String',
:'zip_code' => :'String'
:'zip_code' => :'String',
:'transient_id' => :'String'
}
end

Expand All @@ -77,13 +82,13 @@ def self.openapi_nullable
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `Lob::MultipleComponents` initialize method"
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::MultipleComponents` initialize method"
end

# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Lob::MultipleComponents`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::MultipleComponents`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
end
h[k.to_sym] = v
}
Expand Down Expand Up @@ -115,6 +120,10 @@ def initialize(attributes = {})
if attributes.key?(:'zip_code')
self.zip_code = attributes[:'zip_code']
end

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

# Show invalid properties with the reasons. Usually used together with valid?
Expand Down Expand Up @@ -257,7 +266,8 @@ def ==(o)
urbanization == o.urbanization &&
city == o.city &&
state == o.state &&
zip_code == o.zip_code
zip_code == o.zip_code &&
transient_id == o.transient_id
end

# @see the `==` method
Expand All @@ -269,7 +279,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[recipient, primary_line, secondary_line, urbanization, city, state, zip_code].hash
[recipient, primary_line, secondary_line, urbanization, city, state, zip_code, transient_id].hash
end


Expand Down Expand Up @@ -349,7 +359,7 @@ def _deserialize(type, value)
end
else # model
# models (e.g. Pet) or oneOf
klass = Lob.const_get(type)
klass = OpenapiClient.const_get(type)
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
end
end
Expand Down
26 changes: 18 additions & 8 deletions lib/openapi_client/models/us_verification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
require 'date'
require 'time'

module Lob
module OpenapiClient
class UsVerification
# Unique identifier prefixed with `us_ver_`.
attr_accessor :id
Expand Down Expand Up @@ -47,6 +47,9 @@ class UsVerification

attr_accessor :object

# ID that is returned in the response body for the verification
attr_accessor :transient_id

class EnumAttributeValidator
attr_reader :datatype
attr_reader :allowable_values
Expand Down Expand Up @@ -83,7 +86,8 @@ def self.attribute_map
:'components' => :'components',
:'deliverability_analysis' => :'deliverability_analysis',
:'lob_confidence_score' => :'lob_confidence_score',
:'object' => :'object'
:'object' => :'object',
:'transient_id' => :'transient_id'
}
end

Expand All @@ -106,7 +110,8 @@ def self.openapi_types
:'components' => :'UsComponents',
:'deliverability_analysis' => :'DeliverabilityAnalysis',
:'lob_confidence_score' => :'LobConfidenceScore',
:'object' => :'String'
:'object' => :'String',
:'transient_id' => :'String'
}
end

Expand All @@ -121,13 +126,13 @@ def self.openapi_nullable
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `Lob::UsVerification` initialize method"
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::UsVerification` initialize method"
end

# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Lob::UsVerification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::UsVerification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
end
h[k.to_sym] = v
}
Expand Down Expand Up @@ -181,6 +186,10 @@ def initialize(attributes = {})
else
self.object = 'us_verification'
end

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

# Show invalid properties with the reasons. Usually used together with valid?
Expand Down Expand Up @@ -313,7 +322,8 @@ def ==(o)
components == o.components &&
deliverability_analysis == o.deliverability_analysis &&
lob_confidence_score == o.lob_confidence_score &&
object == o.object
object == o.object &&
transient_id == o.transient_id
end

# @see the `==` method
Expand All @@ -325,7 +335,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[id, recipient, primary_line, secondary_line, urbanization, last_line, deliverability, valid_address, components, deliverability_analysis, lob_confidence_score, object].hash
[id, recipient, primary_line, secondary_line, urbanization, last_line, deliverability, valid_address, components, deliverability_analysis, lob_confidence_score, object, transient_id].hash
end


Expand Down Expand Up @@ -405,7 +415,7 @@ def _deserialize(type, value)
end
else # model
# models (e.g. Pet) or oneOf
klass = Lob.const_get(type)
klass = OpenapiClient.const_get(type)
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
end
end
Expand Down
Loading

0 comments on commit 79d049e

Please sign in to comment.