charitable
/
vendor
/
square
/
square
/
src
/
Merchants
/
CustomAttributes
/
Requests
/
GetCustomAttributesRequest.php
GetCustomAttributesRequest.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13.1, at vendor/square/square/src/Merchants/CustomAttributes/Requests/GetCustomAttributesRequest.php
| 1 | <?php |
| 2 | |
| 3 | namespace Square\Merchants\CustomAttributes\Requests; |
| 4 | |
| 5 | use Square\Core\Json\JsonSerializableType; |
| 6 | |
| 7 | class GetCustomAttributesRequest extends JsonSerializableType |
| 8 | { |
| 9 | /** |
| 10 | * @var string $merchantId The ID of the target [merchant](entity:Merchant). |
| 11 | */ |
| 12 | private string $merchantId; |
| 13 | |
| 14 | /** |
| 15 | * The key of the custom attribute to retrieve. This key must match the `key` of a custom |
| 16 | * attribute definition in the Square seller account. If the requesting application is not the |
| 17 | * definition owner, you must use the qualified key. |
| 18 | * |
| 19 | * @var string $key |
| 20 | */ |
| 21 | private string $key; |
| 22 | |
| 23 | /** |
| 24 | * Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of |
| 25 | * the custom attribute. Set this parameter to `true` to get the name and description of the custom |
| 26 | * attribute, information about the data type, or other definition details. The default value is `false`. |
| 27 | * |
| 28 | * @var ?bool $withDefinition |
| 29 | */ |
| 30 | private ?bool $withDefinition; |
| 31 | |
| 32 | /** |
| 33 | * The current version of the custom attribute, which is used for strongly consistent reads to |
| 34 | * guarantee that you receive the most up-to-date data. When included in the request, Square |
| 35 | * returns the specified version or a higher version if one exists. If the specified version is |
| 36 | * higher than the current version, Square returns a `BAD_REQUEST` error. |
| 37 | * |
| 38 | * @var ?int $version |
| 39 | */ |
| 40 | private ?int $version; |
| 41 | |
| 42 | /** |
| 43 | * @param array{ |
| 44 | * merchantId: string, |
| 45 | * key: string, |
| 46 | * withDefinition?: ?bool, |
| 47 | * version?: ?int, |
| 48 | * } $values |
| 49 | */ |
| 50 | public function __construct( |
| 51 | array $values, |
| 52 | ) { |
| 53 | $this->merchantId = $values['merchantId']; |
| 54 | $this->key = $values['key']; |
| 55 | $this->withDefinition = $values['withDefinition'] ?? null; |
| 56 | $this->version = $values['version'] ?? null; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * @return string |
| 61 | */ |
| 62 | public function getMerchantId(): string |
| 63 | { |
| 64 | return $this->merchantId; |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * @param string $value |
| 69 | */ |
| 70 | public function setMerchantId(string $value): self |
| 71 | { |
| 72 | $this->merchantId = $value; |
| 73 | return $this; |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * @return string |
| 78 | */ |
| 79 | public function getKey(): string |
| 80 | { |
| 81 | return $this->key; |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * @param string $value |
| 86 | */ |
| 87 | public function setKey(string $value): self |
| 88 | { |
| 89 | $this->key = $value; |
| 90 | return $this; |
| 91 | } |
| 92 | |
| 93 | /** |
| 94 | * @return ?bool |
| 95 | */ |
| 96 | public function getWithDefinition(): ?bool |
| 97 | { |
| 98 | return $this->withDefinition; |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * @param ?bool $value |
| 103 | */ |
| 104 | public function setWithDefinition(?bool $value = null): self |
| 105 | { |
| 106 | $this->withDefinition = $value; |
| 107 | return $this; |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * @return ?int |
| 112 | */ |
| 113 | public function getVersion(): ?int |
| 114 | { |
| 115 | return $this->version; |
| 116 | } |
| 117 | |
| 118 | /** |
| 119 | * @param ?int $value |
| 120 | */ |
| 121 | public function setVersion(?int $value = null): self |
| 122 | { |
| 123 | $this->version = $value; |
| 124 | return $this; |
| 125 | } |
| 126 | } |
| 127 |