PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13
1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 All 211 releases
charitable / vendor / square / square / src / Locations / CustomAttributes / Requests / UpsertLocationCustomAttributeRequest.php

UpsertLocationCustomAttributeRequest.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13, at vendor/square/square/src/Locations/CustomAttributes/Requests/UpsertLocationCustomAttributeRequest.php

132 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Square\Locations\CustomAttributes\Requests;
4
5 use Square\Core\Json\JsonSerializableType;
6 use Square\Types\CustomAttribute;
7 use Square\Core\Json\JsonProperty;
8
9 class UpsertLocationCustomAttributeRequest extends JsonSerializableType
10 {
11 /**
12 * @var string $locationId The ID of the target [location](entity:Location).
13 */
14 private string $locationId;
15
16 /**
17 * The key of the custom attribute to create or update. This key must match the `key` of a
18 * custom attribute definition in the Square seller account. If the requesting application is not
19 * the definition owner, you must use the qualified key.
20 *
21 * @var string $key
22 */
23 private string $key;
24
25 /**
26 * The custom attribute to create or update, with the following fields:
27 * - `value`. This value must conform to the `schema` specified by the definition.
28 * For more information, see [Supported data types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types).
29 * - `version`. To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)
30 * control for an update operation, include the current version of the custom attribute.
31 * If this is not important for your application, version can be set to -1.
32 *
33 * @var CustomAttribute $customAttribute
34 */
35 #[JsonProperty('custom_attribute')]
36 private CustomAttribute $customAttribute;
37
38 /**
39 * A unique identifier for this request, used to ensure idempotency. For more information,
40 * see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
41 *
42 * @var ?string $idempotencyKey
43 */
44 #[JsonProperty('idempotency_key')]
45 private ?string $idempotencyKey;
46
47 /**
48 * @param array{
49 * locationId: string,
50 * key: string,
51 * customAttribute: CustomAttribute,
52 * idempotencyKey?: ?string,
53 * } $values
54 */
55 public function __construct(
56 array $values,
57 ) {
58 $this->locationId = $values['locationId'];
59 $this->key = $values['key'];
60 $this->customAttribute = $values['customAttribute'];
61 $this->idempotencyKey = $values['idempotencyKey'] ?? null;
62 }
63
64 /**
65 * @return string
66 */
67 public function getLocationId(): string
68 {
69 return $this->locationId;
70 }
71
72 /**
73 * @param string $value
74 */
75 public function setLocationId(string $value): self
76 {
77 $this->locationId = $value;
78 return $this;
79 }
80
81 /**
82 * @return string
83 */
84 public function getKey(): string
85 {
86 return $this->key;
87 }
88
89 /**
90 * @param string $value
91 */
92 public function setKey(string $value): self
93 {
94 $this->key = $value;
95 return $this;
96 }
97
98 /**
99 * @return CustomAttribute
100 */
101 public function getCustomAttribute(): CustomAttribute
102 {
103 return $this->customAttribute;
104 }
105
106 /**
107 * @param CustomAttribute $value
108 */
109 public function setCustomAttribute(CustomAttribute $value): self
110 {
111 $this->customAttribute = $value;
112 return $this;
113 }
114
115 /**
116 * @return ?string
117 */
118 public function getIdempotencyKey(): ?string
119 {
120 return $this->idempotencyKey;
121 }
122
123 /**
124 * @param ?string $value
125 */
126 public function setIdempotencyKey(?string $value = null): self
127 {
128 $this->idempotencyKey = $value;
129 return $this;
130 }
131 }
132