charitable
/
vendor
/
square
/
square
/
src
/
Orders
/
CustomAttributes
/
Requests
/
GetCustomAttributesRequest.php
GetCustomAttributesRequest.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13, at vendor/square/square/src/Orders/CustomAttributes/Requests/GetCustomAttributesRequest.php
| 1 | <?php |
| 2 | |
| 3 | namespace Square\Orders\CustomAttributes\Requests; |
| 4 | |
| 5 | use Square\Core\Json\JsonSerializableType; |
| 6 | |
| 7 | class GetCustomAttributesRequest extends JsonSerializableType |
| 8 | { |
| 9 | /** |
| 10 | * @var string $orderId The ID of the target [order](entity:Order). |
| 11 | */ |
| 12 | private string $orderId; |
| 13 | |
| 14 | /** |
| 15 | * The key of the custom attribute to retrieve. This key must match the key of an |
| 16 | * existing custom attribute definition. |
| 17 | * |
| 18 | * @var string $customAttributeKey |
| 19 | */ |
| 20 | private string $customAttributeKey; |
| 21 | |
| 22 | /** |
| 23 | * To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) |
| 24 | * control, include this optional field and specify the current version of the custom attribute. |
| 25 | * |
| 26 | * @var ?int $version |
| 27 | */ |
| 28 | private ?int $version; |
| 29 | |
| 30 | /** |
| 31 | * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each |
| 32 | * custom attribute. Set this parameter to `true` to get the name and description of each custom attribute, |
| 33 | * information about the data type, or other definition details. The default value is `false`. |
| 34 | * |
| 35 | * @var ?bool $withDefinition |
| 36 | */ |
| 37 | private ?bool $withDefinition; |
| 38 | |
| 39 | /** |
| 40 | * @param array{ |
| 41 | * orderId: string, |
| 42 | * customAttributeKey: string, |
| 43 | * version?: ?int, |
| 44 | * withDefinition?: ?bool, |
| 45 | * } $values |
| 46 | */ |
| 47 | public function __construct( |
| 48 | array $values, |
| 49 | ) { |
| 50 | $this->orderId = $values['orderId']; |
| 51 | $this->customAttributeKey = $values['customAttributeKey']; |
| 52 | $this->version = $values['version'] ?? null; |
| 53 | $this->withDefinition = $values['withDefinition'] ?? null; |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * @return string |
| 58 | */ |
| 59 | public function getOrderId(): string |
| 60 | { |
| 61 | return $this->orderId; |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * @param string $value |
| 66 | */ |
| 67 | public function setOrderId(string $value): self |
| 68 | { |
| 69 | $this->orderId = $value; |
| 70 | return $this; |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * @return string |
| 75 | */ |
| 76 | public function getCustomAttributeKey(): string |
| 77 | { |
| 78 | return $this->customAttributeKey; |
| 79 | } |
| 80 | |
| 81 | /** |
| 82 | * @param string $value |
| 83 | */ |
| 84 | public function setCustomAttributeKey(string $value): self |
| 85 | { |
| 86 | $this->customAttributeKey = $value; |
| 87 | return $this; |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * @return ?int |
| 92 | */ |
| 93 | public function getVersion(): ?int |
| 94 | { |
| 95 | return $this->version; |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * @param ?int $value |
| 100 | */ |
| 101 | public function setVersion(?int $value = null): self |
| 102 | { |
| 103 | $this->version = $value; |
| 104 | return $this; |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * @return ?bool |
| 109 | */ |
| 110 | public function getWithDefinition(): ?bool |
| 111 | { |
| 112 | return $this->withDefinition; |
| 113 | } |
| 114 | |
| 115 | /** |
| 116 | * @param ?bool $value |
| 117 | */ |
| 118 | public function setWithDefinition(?bool $value = null): self |
| 119 | { |
| 120 | $this->withDefinition = $value; |
| 121 | return $this; |
| 122 | } |
| 123 | } |
| 124 |