charitable
/
vendor
/
square
/
square
/
src
/
Orders
/
CustomAttributeDefinitions
/
Requests
/
GetCustomAttributeDefinitionsRequest.php
GetCustomAttributeDefinitionsRequest.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13.1, at vendor/square/square/src/Orders/CustomAttributeDefinitions/Requests/GetCustomAttributeDefinitionsRequest.php
| 1 | <?php |
| 2 | |
| 3 | namespace Square\Orders\CustomAttributeDefinitions\Requests; |
| 4 | |
| 5 | use Square\Core\Json\JsonSerializableType; |
| 6 | |
| 7 | class GetCustomAttributeDefinitionsRequest extends JsonSerializableType |
| 8 | { |
| 9 | /** |
| 10 | * @var string $key The key of the custom attribute definition to retrieve. |
| 11 | */ |
| 12 | private string $key; |
| 13 | |
| 14 | /** |
| 15 | * To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) |
| 16 | * control, include this optional field and specify the current version of the custom attribute. |
| 17 | * |
| 18 | * @var ?int $version |
| 19 | */ |
| 20 | private ?int $version; |
| 21 | |
| 22 | /** |
| 23 | * @param array{ |
| 24 | * key: string, |
| 25 | * version?: ?int, |
| 26 | * } $values |
| 27 | */ |
| 28 | public function __construct( |
| 29 | array $values, |
| 30 | ) { |
| 31 | $this->key = $values['key']; |
| 32 | $this->version = $values['version'] ?? null; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * @return string |
| 37 | */ |
| 38 | public function getKey(): string |
| 39 | { |
| 40 | return $this->key; |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * @param string $value |
| 45 | */ |
| 46 | public function setKey(string $value): self |
| 47 | { |
| 48 | $this->key = $value; |
| 49 | return $this; |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * @return ?int |
| 54 | */ |
| 55 | public function getVersion(): ?int |
| 56 | { |
| 57 | return $this->version; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * @param ?int $value |
| 62 | */ |
| 63 | public function setVersion(?int $value = null): self |
| 64 | { |
| 65 | $this->version = $value; |
| 66 | return $this; |
| 67 | } |
| 68 | } |
| 69 |