-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #234 from lob/feature/MI-22-address-zip-validation
MI-22 changing address model valitadion
- Loading branch information
Showing
9 changed files
with
1,765 additions
and
634 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,49 @@ | ||
# Lob::Address | ||
|
||
## Properties | ||
|
||
| Name | Type | Description | Notes | | ||
| ---- | ---- | ----------- | ----- | | ||
| **id** | **String** | Unique identifier prefixed with `adr_`. | [optional] | | ||
| **description** | **String** | An internal description that identifies this resource. Must be no longer than 255 characters. | [optional] | | ||
| **name** | **String** | name associated with address | [optional] | | ||
| **company** | **String** | Either `name` or `company` is required, you may also add both. | [optional] | | ||
| **phone** | **String** | Must be no longer than 40 characters. | [optional] | | ||
| **email** | **String** | Must be no longer than 100 characters. | [optional] | | ||
| **metadata** | **Hash<String, String>** | Use metadata to store custom information for tagging and labeling back to your internal systems. Must be an object with up to 20 key-value pairs. Keys must be at most 40 characters and values must be at most 500 characters. Neither can contain the characters `\"` and `\\`. i.e. '{\"customer_id\" : \"NEWYORK2015\"}' Nested objects are not supported. See [Metadata](#section/Metadata) for more information. | [optional] | | ||
| **address_line1** | **String** | | [optional] | | ||
| **address_line2** | **String** | | [optional] | | ||
| **address_city** | **String** | | [optional] | | ||
| **address_state** | **String** | 2 letter state short-name code | [optional] | | ||
| **address_zip** | **String** | Must follow the ZIP format of `12345` or ZIP+4 format of `12345-1234`. | [optional] | | ||
| **address_country** | [**CountryExtendedExpanded**](CountryExtendedExpanded.md) | | [optional] | | ||
| **object** | **String** | | [optional][default to 'address'] | | ||
| **date_created** | **Time** | A timestamp in ISO 8601 format of the date the resource was created. | [optional] | | ||
| **date_modified** | **Time** | A timestamp in ISO 8601 format of the date the resource was last modified. | [optional] | | ||
| **deleted** | **Boolean** | Only returned if the resource has been successfully deleted. | [optional] | | ||
| **recipient_moved** | **Boolean** | Only returned for accounts on certain <a href=\"https://dashboard.lob.com/#/settings/editions\">Print &amp; Mail Editions</a>. Value is `true` if the address was altered because the recipient filed for a <a href=\"#ncoa\">National Change of Address (NCOA)</a>, `false` if the NCOA check was run but no altered address was found, and `null` if the NCOA check was not run. The NCOA check does not happen for non-US addresses, for non-deliverable US addresses, or for addresses created before the NCOA feature was added to your account. | [optional] | | ||
|
||
## Example | ||
## Class instance methods | ||
|
||
### `openapi_one_of` | ||
|
||
Returns the list of classes defined in oneOf. | ||
|
||
#### Example | ||
|
||
```ruby | ||
require 'lob' | ||
|
||
Lob::Address.openapi_one_of | ||
# => | ||
# [ | ||
# :'IntlAddress', | ||
# :'UsAddress' | ||
# ] | ||
``` | ||
|
||
### build | ||
|
||
Find the appropriate object from the `openapi_one_of` list and casts the data into it. | ||
|
||
#### Example | ||
|
||
```ruby | ||
require 'openapi_client' | ||
|
||
instance = Lob::Address.new( | ||
id: null, | ||
description: null, | ||
name: null, | ||
company: null, | ||
phone: null, | ||
email: null, | ||
metadata: null, | ||
address_line1: null, | ||
address_line2: null, | ||
address_city: null, | ||
address_state: null, | ||
address_zip: null, | ||
address_country: null, | ||
object: null, | ||
date_created: null, | ||
date_modified: null, | ||
deleted: null, | ||
recipient_moved: null | ||
) | ||
require 'lob' | ||
|
||
Lob::Address.build(data) | ||
# => #<IntlAddress:0x00007fdd4aab02a0> | ||
|
||
Lob::Address.build(data_that_doesnt_match) | ||
# => nil | ||
``` | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| ---- | ---- | ----------- | | ||
| **data** | **Mixed** | data to be matched against the list of oneOf items | | ||
|
||
#### Return type | ||
|
||
- `IntlAddress` | ||
- `UsAddress` | ||
- `nil` (if no type matches) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Lob::CountryExtendedExpandedNoUs | ||
|
||
## Properties | ||
|
||
| Name | Type | Description | Notes | | ||
| ---- | ---- | ----------- | ----- | | ||
|
||
## Example | ||
|
||
```ruby | ||
require 'lob' | ||
|
||
instance = Lob::CountryExtendedExpandedNoUs.new() | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Lob::IntlAddress | ||
|
||
## Properties | ||
|
||
| Name | Type | Description | Notes | | ||
| ---- | ---- | ----------- | ----- | | ||
| **id** | **String** | Unique identifier prefixed with `adr_`. | [optional] | | ||
| **description** | **String** | An internal description that identifies this resource. Must be no longer than 255 characters. | [optional] | | ||
| **name** | **String** | name associated with address | [optional] | | ||
| **company** | **String** | Either `name` or `company` is required, you may also add both. | [optional] | | ||
| **phone** | **String** | Must be no longer than 40 characters. | [optional] | | ||
| **email** | **String** | Must be no longer than 100 characters. | [optional] | | ||
| **metadata** | **Hash<String, String>** | Use metadata to store custom information for tagging and labeling back to your internal systems. Must be an object with up to 20 key-value pairs. Keys must be at most 40 characters and values must be at most 500 characters. Neither can contain the characters `\"` and `\\`. i.e. '{\"customer_id\" : \"NEWYORK2015\"}' Nested objects are not supported. See [Metadata](#section/Metadata) for more information. | [optional] | | ||
| **address_line1** | **String** | | [optional] | | ||
| **address_line2** | **String** | | [optional] | | ||
| **address_city** | **String** | | [optional] | | ||
| **address_state** | **String** | 2 letter state short-name code | [optional] | | ||
| **address_zip** | **String** | Must have a maximum of 12 characters | [optional] | | ||
| **address_country** | [**CountryExtendedExpandedNoUs**](CountryExtendedExpandedNoUs.md) | | [optional] | | ||
| **object** | **String** | | [optional][default to 'address'] | | ||
| **date_created** | **Time** | A timestamp in ISO 8601 format of the date the resource was created. | [optional] | | ||
| **date_modified** | **Time** | A timestamp in ISO 8601 format of the date the resource was last modified. | [optional] | | ||
| **deleted** | **Boolean** | Only returned if the resource has been successfully deleted. | [optional] | | ||
| **inline** | **Boolean** | Checks if address id is used or not | [optional] | | ||
| **recipient_moved** | **Boolean** | Only returned for accounts on certain <a href=\"https://dashboard.lob.com/#/settings/editions\">Print &amp; Mail Editions</a>. Value is `true` if the address was altered because the recipient filed for a <a href=\"#ncoa\">National Change of Address (NCOA)</a>, `false` if the NCOA check was run but no altered address was found, and `null` if the NCOA check was not run. The NCOA check does not happen for non-US addresses, for non-deliverable US addresses, or for addresses created before the NCOA feature was added to your account. | [optional] | | ||
|
||
## Example | ||
|
||
```ruby | ||
require 'lob' | ||
|
||
instance = Lob::IntlAddress.new( | ||
id: null, | ||
description: null, | ||
name: null, | ||
company: null, | ||
phone: null, | ||
email: null, | ||
metadata: null, | ||
address_line1: null, | ||
address_line2: null, | ||
address_city: null, | ||
address_state: null, | ||
address_zip: null, | ||
address_country: null, | ||
object: null, | ||
date_created: null, | ||
date_modified: null, | ||
deleted: null, | ||
inline: null, | ||
recipient_moved: null | ||
) | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Lob::UsAddress | ||
|
||
## Properties | ||
|
||
| Name | Type | Description | Notes | | ||
| ---- | ---- | ----------- | ----- | | ||
| **id** | **String** | Unique identifier prefixed with `adr_`. | [optional] | | ||
| **description** | **String** | An internal description that identifies this resource. Must be no longer than 255 characters. | [optional] | | ||
| **name** | **String** | name associated with address | [optional] | | ||
| **company** | **String** | Either `name` or `company` is required, you may also add both. | [optional] | | ||
| **phone** | **String** | Must be no longer than 40 characters. | [optional] | | ||
| **email** | **String** | Must be no longer than 100 characters. | [optional] | | ||
| **metadata** | **Hash<String, String>** | Use metadata to store custom information for tagging and labeling back to your internal systems. Must be an object with up to 20 key-value pairs. Keys must be at most 40 characters and values must be at most 500 characters. Neither can contain the characters `\"` and `\\`. i.e. '{\"customer_id\" : \"NEWYORK2015\"}' Nested objects are not supported. See [Metadata](#section/Metadata) for more information. | [optional] | | ||
| **address_line1** | **String** | | [optional] | | ||
| **address_line2** | **String** | | [optional] | | ||
| **address_city** | **String** | | [optional] | | ||
| **address_state** | **String** | 2 letter state short-name code | [optional] | | ||
| **address_zip** | **String** | Must follow the ZIP format of `12345` or ZIP+4 format of `12345-1234`. | [optional] | | ||
| **address_country** | **String** | Full name of country | [optional] | | ||
| **object** | **String** | | [optional][default to 'address'] | | ||
| **date_created** | **Time** | A timestamp in ISO 8601 format of the date the resource was created. | [optional] | | ||
| **date_modified** | **Time** | A timestamp in ISO 8601 format of the date the resource was last modified. | [optional] | | ||
| **deleted** | **Boolean** | Only returned if the resource has been successfully deleted. | [optional] | | ||
| **inline** | **Boolean** | Checks if address id is used or not | [optional] | | ||
| **recipient_moved** | **Boolean** | Only returned for accounts on certain <a href=\"https://dashboard.lob.com/#/settings/editions\">Print &amp; Mail Editions</a>. Value is `true` if the address was altered because the recipient filed for a <a href=\"#ncoa\">National Change of Address (NCOA)</a>, `false` if the NCOA check was run but no altered address was found, and `null` if the NCOA check was not run. The NCOA check does not happen for non-US addresses, for non-deliverable US addresses, or for addresses created before the NCOA feature was added to your account. | [optional] | | ||
|
||
## Example | ||
|
||
```ruby | ||
require 'lob' | ||
|
||
instance = Lob::UsAddress.new( | ||
id: null, | ||
description: null, | ||
name: null, | ||
company: null, | ||
phone: null, | ||
email: null, | ||
metadata: null, | ||
address_line1: null, | ||
address_line2: null, | ||
address_city: null, | ||
address_state: null, | ||
address_zip: null, | ||
address_country: null, | ||
object: null, | ||
date_created: null, | ||
date_modified: null, | ||
deleted: null, | ||
inline: null, | ||
recipient_moved: null | ||
) | ||
``` | ||
|
Oops, something went wrong.