Skip to content

Commit

Permalink
Merge pull request #234 from lob/feature/MI-22-address-zip-validation
Browse files Browse the repository at this point in the history
MI-22 changing address model valitadion
  • Loading branch information
mrkaspa authored Feb 26, 2024
2 parents 2685d92 + ba2a9fa commit 1904548
Show file tree
Hide file tree
Showing 9 changed files with 1,765 additions and 634 deletions.
89 changes: 43 additions & 46 deletions docs/Address.md
100755 → 100644
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 & 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)

15 changes: 15 additions & 0 deletions docs/CountryExtendedExpandedNoUs.md
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()
```

54 changes: 54 additions & 0 deletions docs/IntlAddress.md
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 &#x60;adr_&#x60;. | [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 &#x60;name&#x60; or &#x60;company&#x60; 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&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] |
| **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 &#39;address&#39;] |
| **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 &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] |

## 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
)
```

54 changes: 54 additions & 0 deletions docs/UsAddress.md
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 &#x60;adr_&#x60;. | [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 &#x60;name&#x60; or &#x60;company&#x60; 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&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] |
| **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 &#x60;12345&#x60; or ZIP+4 format of &#x60;12345-1234&#x60;. | [optional] |
| **address_country** | **String** | Full name of country | [optional] |
| **object** | **String** | | [optional][default to &#39;address&#39;] |
| **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 &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] |

## 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
)
```

Loading

0 comments on commit 1904548

Please sign in to comment.