|
1 | 1 | # Lob::Address
|
2 | 2 |
|
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 &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] | |
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 |
27 | 27 |
|
28 | 28 | ```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 |
51 | 36 | ```
|
52 | 37 |
|
| 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 | + |
0 commit comments