Skip to content

Commit 1904548

Browse files
authored
Merge pull request #234 from lob/feature/MI-22-address-zip-validation
MI-22 changing address model valitadion
2 parents 2685d92 + ba2a9fa commit 1904548

File tree

9 files changed

+1765
-634
lines changed

9 files changed

+1765
-634
lines changed

docs/Address.md

100755100644
Lines changed: 43 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,49 @@
11
# Lob::Address
22

3-
## Properties
4-
5-
| Name | Type | Description | Notes |
6-
| ---- | ---- | ----------- | ----- |
7-
| **id** | **String** | Unique identifier prefixed with `adr_`. | [optional] |
8-
| **description** | **String** | An internal description that identifies this resource. Must be no longer than 255 characters. | [optional] |
9-
| **name** | **String** | name associated with address | [optional] |
10-
| **company** | **String** | Either `name` or `company` is required, you may also add both. | [optional] |
11-
| **phone** | **String** | Must be no longer than 40 characters. | [optional] |
12-
| **email** | **String** | Must be no longer than 100 characters. | [optional] |
13-
| **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] |
14-
| **address_line1** | **String** | | [optional] |
15-
| **address_line2** | **String** | | [optional] |
16-
| **address_city** | **String** | | [optional] |
17-
| **address_state** | **String** | 2 letter state short-name code | [optional] |
18-
| **address_zip** | **String** | Must follow the ZIP format of `12345` or ZIP+4 format of `12345-1234`. | [optional] |
19-
| **address_country** | [**CountryExtendedExpanded**](CountryExtendedExpanded.md) | | [optional] |
20-
| **object** | **String** | | [optional][default to 'address'] |
21-
| **date_created** | **Time** | A timestamp in ISO 8601 format of the date the resource was created. | [optional] |
22-
| **date_modified** | **Time** | A timestamp in ISO 8601 format of the date the resource was last modified. | [optional] |
23-
| **deleted** | **Boolean** | Only returned if the resource has been successfully deleted. | [optional] |
24-
| **recipient_moved** | **Boolean** | Only returned for accounts on certain <a href=\"https://dashboard.lob.com/#/settings/editions\">Print & 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] |
25-
26-
## Example
3+
## Class instance methods
4+
5+
### `openapi_one_of`
6+
7+
Returns the list of classes defined in oneOf.
8+
9+
#### Example
10+
11+
```ruby
12+
require 'lob'
13+
14+
Lob::Address.openapi_one_of
15+
# =>
16+
# [
17+
# :'IntlAddress',
18+
# :'UsAddress'
19+
# ]
20+
```
21+
22+
### build
23+
24+
Find the appropriate object from the `openapi_one_of` list and casts the data into it.
25+
26+
#### Example
2727

2828
```ruby
29-
require 'openapi_client'
30-
31-
instance = Lob::Address.new(
32-
id: null,
33-
description: null,
34-
name: null,
35-
company: null,
36-
phone: null,
37-
email: null,
38-
metadata: null,
39-
address_line1: null,
40-
address_line2: null,
41-
address_city: null,
42-
address_state: null,
43-
address_zip: null,
44-
address_country: null,
45-
object: null,
46-
date_created: null,
47-
date_modified: null,
48-
deleted: null,
49-
recipient_moved: null
50-
)
29+
require 'lob'
30+
31+
Lob::Address.build(data)
32+
# => #<IntlAddress:0x00007fdd4aab02a0>
33+
34+
Lob::Address.build(data_that_doesnt_match)
35+
# => nil
5136
```
5237

38+
#### Parameters
39+
40+
| Name | Type | Description |
41+
| ---- | ---- | ----------- |
42+
| **data** | **Mixed** | data to be matched against the list of oneOf items |
43+
44+
#### Return type
45+
46+
- `IntlAddress`
47+
- `UsAddress`
48+
- `nil` (if no type matches)
49+

docs/CountryExtendedExpandedNoUs.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Lob::CountryExtendedExpandedNoUs
2+
3+
## Properties
4+
5+
| Name | Type | Description | Notes |
6+
| ---- | ---- | ----------- | ----- |
7+
8+
## Example
9+
10+
```ruby
11+
require 'lob'
12+
13+
instance = Lob::CountryExtendedExpandedNoUs.new()
14+
```
15+

docs/IntlAddress.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Lob::IntlAddress
2+
3+
## Properties
4+
5+
| Name | Type | Description | Notes |
6+
| ---- | ---- | ----------- | ----- |
7+
| **id** | **String** | Unique identifier prefixed with &#x60;adr_&#x60;. | [optional] |
8+
| **description** | **String** | An internal description that identifies this resource. Must be no longer than 255 characters. | [optional] |
9+
| **name** | **String** | name associated with address | [optional] |
10+
| **company** | **String** | Either &#x60;name&#x60; or &#x60;company&#x60; is required, you may also add both. | [optional] |
11+
| **phone** | **String** | Must be no longer than 40 characters. | [optional] |
12+
| **email** | **String** | Must be no longer than 100 characters. | [optional] |
13+
| **metadata** | **Hash&lt;String, String&gt;** | 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 &#x60;\&quot;&#x60; and &#x60;\\&#x60;. i.e. &#39;{\&quot;customer_id\&quot; : \&quot;NEWYORK2015\&quot;}&#39; Nested objects are not supported. See [Metadata](#section/Metadata) for more information. | [optional] |
14+
| **address_line1** | **String** | | [optional] |
15+
| **address_line2** | **String** | | [optional] |
16+
| **address_city** | **String** | | [optional] |
17+
| **address_state** | **String** | 2 letter state short-name code | [optional] |
18+
| **address_zip** | **String** | Must have a maximum of 12 characters | [optional] |
19+
| **address_country** | [**CountryExtendedExpandedNoUs**](CountryExtendedExpandedNoUs.md) | | [optional] |
20+
| **object** | **String** | | [optional][default to &#39;address&#39;] |
21+
| **date_created** | **Time** | A timestamp in ISO 8601 format of the date the resource was created. | [optional] |
22+
| **date_modified** | **Time** | A timestamp in ISO 8601 format of the date the resource was last modified. | [optional] |
23+
| **deleted** | **Boolean** | Only returned if the resource has been successfully deleted. | [optional] |
24+
| **inline** | **Boolean** | Checks if address id is used or not | [optional] |
25+
| **recipient_moved** | **Boolean** | Only returned for accounts on certain &lt;a href&#x3D;\&quot;https://dashboard.lob.com/#/settings/editions\&quot;&gt;Print &amp;amp; Mail Editions&lt;/a&gt;. Value is &#x60;true&#x60; if the address was altered because the recipient filed for a &lt;a href&#x3D;\&quot;#ncoa\&quot;&gt;National Change of Address (NCOA)&lt;/a&gt;, &#x60;false&#x60; if the NCOA check was run but no altered address was found, and &#x60;null&#x60; 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] |
26+
27+
## Example
28+
29+
```ruby
30+
require 'lob'
31+
32+
instance = Lob::IntlAddress.new(
33+
id: null,
34+
description: null,
35+
name: null,
36+
company: null,
37+
phone: null,
38+
email: null,
39+
metadata: null,
40+
address_line1: null,
41+
address_line2: null,
42+
address_city: null,
43+
address_state: null,
44+
address_zip: null,
45+
address_country: null,
46+
object: null,
47+
date_created: null,
48+
date_modified: null,
49+
deleted: null,
50+
inline: null,
51+
recipient_moved: null
52+
)
53+
```
54+

docs/UsAddress.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Lob::UsAddress
2+
3+
## Properties
4+
5+
| Name | Type | Description | Notes |
6+
| ---- | ---- | ----------- | ----- |
7+
| **id** | **String** | Unique identifier prefixed with &#x60;adr_&#x60;. | [optional] |
8+
| **description** | **String** | An internal description that identifies this resource. Must be no longer than 255 characters. | [optional] |
9+
| **name** | **String** | name associated with address | [optional] |
10+
| **company** | **String** | Either &#x60;name&#x60; or &#x60;company&#x60; is required, you may also add both. | [optional] |
11+
| **phone** | **String** | Must be no longer than 40 characters. | [optional] |
12+
| **email** | **String** | Must be no longer than 100 characters. | [optional] |
13+
| **metadata** | **Hash&lt;String, String&gt;** | 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 &#x60;\&quot;&#x60; and &#x60;\\&#x60;. i.e. &#39;{\&quot;customer_id\&quot; : \&quot;NEWYORK2015\&quot;}&#39; Nested objects are not supported. See [Metadata](#section/Metadata) for more information. | [optional] |
14+
| **address_line1** | **String** | | [optional] |
15+
| **address_line2** | **String** | | [optional] |
16+
| **address_city** | **String** | | [optional] |
17+
| **address_state** | **String** | 2 letter state short-name code | [optional] |
18+
| **address_zip** | **String** | Must follow the ZIP format of &#x60;12345&#x60; or ZIP+4 format of &#x60;12345-1234&#x60;. | [optional] |
19+
| **address_country** | **String** | Full name of country | [optional] |
20+
| **object** | **String** | | [optional][default to &#39;address&#39;] |
21+
| **date_created** | **Time** | A timestamp in ISO 8601 format of the date the resource was created. | [optional] |
22+
| **date_modified** | **Time** | A timestamp in ISO 8601 format of the date the resource was last modified. | [optional] |
23+
| **deleted** | **Boolean** | Only returned if the resource has been successfully deleted. | [optional] |
24+
| **inline** | **Boolean** | Checks if address id is used or not | [optional] |
25+
| **recipient_moved** | **Boolean** | Only returned for accounts on certain &lt;a href&#x3D;\&quot;https://dashboard.lob.com/#/settings/editions\&quot;&gt;Print &amp;amp; Mail Editions&lt;/a&gt;. Value is &#x60;true&#x60; if the address was altered because the recipient filed for a &lt;a href&#x3D;\&quot;#ncoa\&quot;&gt;National Change of Address (NCOA)&lt;/a&gt;, &#x60;false&#x60; if the NCOA check was run but no altered address was found, and &#x60;null&#x60; 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] |
26+
27+
## Example
28+
29+
```ruby
30+
require 'lob'
31+
32+
instance = Lob::UsAddress.new(
33+
id: null,
34+
description: null,
35+
name: null,
36+
company: null,
37+
phone: null,
38+
email: null,
39+
metadata: null,
40+
address_line1: null,
41+
address_line2: null,
42+
address_city: null,
43+
address_state: null,
44+
address_zip: null,
45+
address_country: null,
46+
object: null,
47+
date_created: null,
48+
date_modified: null,
49+
deleted: null,
50+
inline: null,
51+
recipient_moved: null
52+
)
53+
```
54+

0 commit comments

Comments
 (0)