| @@ 51-57 (lines=7) @@ | ||
| 48 | * @return string |
|
| 49 | * @throws InvalidAttributeException |
|
| 50 | */ |
|
| 51 | public function getName() |
|
| 52 | { |
|
| 53 | if ($this->getObjectPurpose() === static::OBJECT_PURPOSE_PURCHASE) { |
|
| 54 | return $this->attributes->mustHave('name')->asString(); |
|
| 55 | } |
|
| 56 | return $this->attributes->mayHave('name')->asString(); |
|
| 57 | } |
|
| 58 | ||
| 59 | /** |
|
| 60 | * Company Name |
|
| @@ 80-86 (lines=7) @@ | ||
| 77 | * @return string |
|
| 78 | * @throws InvalidAttributeException |
|
| 79 | */ |
|
| 80 | public function getStreet1() |
|
| 81 | { |
|
| 82 | if ($this->getObjectPurpose() === static::OBJECT_PURPOSE_PURCHASE) { |
|
| 83 | return $this->attributes->mustHave('street1')->asString(); |
|
| 84 | } |
|
| 85 | return $this->attributes->mayHave('street1')->asString(); |
|
| 86 | } |
|
| 87 | ||
| 88 | /** |
|
| 89 | * Street number of the addressed building. |
|
| @@ 123-129 (lines=7) @@ | ||
| 120 | * @return string |
|
| 121 | * @throws InvalidAttributeException |
|
| 122 | */ |
|
| 123 | public function getCity() |
|
| 124 | { |
|
| 125 | if ($this->getObjectPurpose() === static::OBJECT_PURPOSE_PURCHASE) { |
|
| 126 | return $this->attributes->mustHave('city')->asString(); |
|
| 127 | } |
|
| 128 | return $this->attributes->mayHave('city')->asString(); |
|
| 129 | } |
|
| 130 | ||
| 131 | /** |
|
| 132 | * Postal code of an Address. When creating a Quote Address, |
|
| @@ 140-146 (lines=7) @@ | ||
| 137 | * @return string |
|
| 138 | * @throws InvalidAttributeException |
|
| 139 | */ |
|
| 140 | public function getZip() |
|
| 141 | { |
|
| 142 | if ($this->getObjectPurpose() === static::OBJECT_PURPOSE_PURCHASE) { |
|
| 143 | return $this->attributes->mustHave('zip')->asString(); |
|
| 144 | } |
|
| 145 | return $this->attributes->mayHave('zip')->asString(); |
|
| 146 | } |
|
| 147 | ||
| 148 | /** |
|
| 149 | * State values are only required for shipments from |
|