charitable
/
vendor
/
square
/
square
/
src
/
Legacy
/
Models
/
Builders
/
UpdateLocationResponseBuilder.php
UpdateLocationResponseBuilder.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13, at vendor/square/square/src/Legacy/Models/Builders/UpdateLocationResponseBuilder.php
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Square\Legacy\Models\Builders; |
| 6 | |
| 7 | use Core\Utils\CoreHelper; |
| 8 | use Square\Legacy\Models\Error; |
| 9 | use Square\Legacy\Models\Location; |
| 10 | use Square\Legacy\Models\UpdateLocationResponse; |
| 11 | |
| 12 | /** |
| 13 | * Builder for model UpdateLocationResponse |
| 14 | * |
| 15 | * @see UpdateLocationResponse |
| 16 | */ |
| 17 | class UpdateLocationResponseBuilder |
| 18 | { |
| 19 | /** |
| 20 | * @var UpdateLocationResponse |
| 21 | */ |
| 22 | private $instance; |
| 23 | |
| 24 | private function __construct(UpdateLocationResponse $instance) |
| 25 | { |
| 26 | $this->instance = $instance; |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Initializes a new Update Location Response Builder object. |
| 31 | */ |
| 32 | public static function init(): self |
| 33 | { |
| 34 | return new self(new UpdateLocationResponse()); |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Sets errors field. |
| 39 | * |
| 40 | * @param Error[]|null $value |
| 41 | */ |
| 42 | public function errors(?array $value): self |
| 43 | { |
| 44 | $this->instance->setErrors($value); |
| 45 | return $this; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Sets location field. |
| 50 | * |
| 51 | * @param Location|null $value |
| 52 | */ |
| 53 | public function location(?Location $value): self |
| 54 | { |
| 55 | $this->instance->setLocation($value); |
| 56 | return $this; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Initializes a new Update Location Response object. |
| 61 | */ |
| 62 | public function build(): UpdateLocationResponse |
| 63 | { |
| 64 | return CoreHelper::clone($this->instance); |
| 65 | } |
| 66 | } |
| 67 |