PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13.1
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13.1
1.8.13.1 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 All 212 releases
charitable / vendor / square / square / src / Legacy / Models / UpdateCustomerRequest.php

UpdateCustomerRequest.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13.1, at vendor/square/square/src/Legacy/Models/UpdateCustomerRequest.php

558 lines 15.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Square\Legacy\Models;
6
7 use stdClass;
8
9 /**
10 * Defines the body parameters that can be included in a request to the
11 * `UpdateCustomer` endpoint.
12 */
13 class UpdateCustomerRequest implements \JsonSerializable
14 {
15 /**
16 * @var array
17 */
18 private $givenName = [];
19
20 /**
21 * @var array
22 */
23 private $familyName = [];
24
25 /**
26 * @var array
27 */
28 private $companyName = [];
29
30 /**
31 * @var array
32 */
33 private $nickname = [];
34
35 /**
36 * @var array
37 */
38 private $emailAddress = [];
39
40 /**
41 * @var Address|null
42 */
43 private $address;
44
45 /**
46 * @var array
47 */
48 private $phoneNumber = [];
49
50 /**
51 * @var array
52 */
53 private $referenceId = [];
54
55 /**
56 * @var array
57 */
58 private $note = [];
59
60 /**
61 * @var array
62 */
63 private $birthday = [];
64
65 /**
66 * @var int|null
67 */
68 private $version;
69
70 /**
71 * @var CustomerTaxIds|null
72 */
73 private $taxIds;
74
75 /**
76 * Returns Given Name.
77 * The given name (that is, the first name) associated with the customer profile.
78 *
79 * The maximum length for this value is 300 characters.
80 */
81 public function getGivenName(): ?string
82 {
83 if (count($this->givenName) == 0) {
84 return null;
85 }
86 return $this->givenName['value'];
87 }
88
89 /**
90 * Sets Given Name.
91 * The given name (that is, the first name) associated with the customer profile.
92 *
93 * The maximum length for this value is 300 characters.
94 *
95 * @maps given_name
96 */
97 public function setGivenName(?string $givenName): void
98 {
99 $this->givenName['value'] = $givenName;
100 }
101
102 /**
103 * Unsets Given Name.
104 * The given name (that is, the first name) associated with the customer profile.
105 *
106 * The maximum length for this value is 300 characters.
107 */
108 public function unsetGivenName(): void
109 {
110 $this->givenName = [];
111 }
112
113 /**
114 * Returns Family Name.
115 * The family name (that is, the last name) associated with the customer profile.
116 *
117 * The maximum length for this value is 300 characters.
118 */
119 public function getFamilyName(): ?string
120 {
121 if (count($this->familyName) == 0) {
122 return null;
123 }
124 return $this->familyName['value'];
125 }
126
127 /**
128 * Sets Family Name.
129 * The family name (that is, the last name) associated with the customer profile.
130 *
131 * The maximum length for this value is 300 characters.
132 *
133 * @maps family_name
134 */
135 public function setFamilyName(?string $familyName): void
136 {
137 $this->familyName['value'] = $familyName;
138 }
139
140 /**
141 * Unsets Family Name.
142 * The family name (that is, the last name) associated with the customer profile.
143 *
144 * The maximum length for this value is 300 characters.
145 */
146 public function unsetFamilyName(): void
147 {
148 $this->familyName = [];
149 }
150
151 /**
152 * Returns Company Name.
153 * A business name associated with the customer profile.
154 *
155 * The maximum length for this value is 500 characters.
156 */
157 public function getCompanyName(): ?string
158 {
159 if (count($this->companyName) == 0) {
160 return null;
161 }
162 return $this->companyName['value'];
163 }
164
165 /**
166 * Sets Company Name.
167 * A business name associated with the customer profile.
168 *
169 * The maximum length for this value is 500 characters.
170 *
171 * @maps company_name
172 */
173 public function setCompanyName(?string $companyName): void
174 {
175 $this->companyName['value'] = $companyName;
176 }
177
178 /**
179 * Unsets Company Name.
180 * A business name associated with the customer profile.
181 *
182 * The maximum length for this value is 500 characters.
183 */
184 public function unsetCompanyName(): void
185 {
186 $this->companyName = [];
187 }
188
189 /**
190 * Returns Nickname.
191 * A nickname for the customer profile.
192 *
193 * The maximum length for this value is 100 characters.
194 */
195 public function getNickname(): ?string
196 {
197 if (count($this->nickname) == 0) {
198 return null;
199 }
200 return $this->nickname['value'];
201 }
202
203 /**
204 * Sets Nickname.
205 * A nickname for the customer profile.
206 *
207 * The maximum length for this value is 100 characters.
208 *
209 * @maps nickname
210 */
211 public function setNickname(?string $nickname): void
212 {
213 $this->nickname['value'] = $nickname;
214 }
215
216 /**
217 * Unsets Nickname.
218 * A nickname for the customer profile.
219 *
220 * The maximum length for this value is 100 characters.
221 */
222 public function unsetNickname(): void
223 {
224 $this->nickname = [];
225 }
226
227 /**
228 * Returns Email Address.
229 * The email address associated with the customer profile.
230 *
231 * The maximum length for this value is 254 characters.
232 */
233 public function getEmailAddress(): ?string
234 {
235 if (count($this->emailAddress) == 0) {
236 return null;
237 }
238 return $this->emailAddress['value'];
239 }
240
241 /**
242 * Sets Email Address.
243 * The email address associated with the customer profile.
244 *
245 * The maximum length for this value is 254 characters.
246 *
247 * @maps email_address
248 */
249 public function setEmailAddress(?string $emailAddress): void
250 {
251 $this->emailAddress['value'] = $emailAddress;
252 }
253
254 /**
255 * Unsets Email Address.
256 * The email address associated with the customer profile.
257 *
258 * The maximum length for this value is 254 characters.
259 */
260 public function unsetEmailAddress(): void
261 {
262 $this->emailAddress = [];
263 }
264
265 /**
266 * Returns Address.
267 * Represents a postal address in a country.
268 * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-
269 * basics/working-with-addresses).
270 */
271 public function getAddress(): ?Address
272 {
273 return $this->address;
274 }
275
276 /**
277 * Sets Address.
278 * Represents a postal address in a country.
279 * For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-
280 * basics/working-with-addresses).
281 *
282 * @maps address
283 */
284 public function setAddress(?Address $address): void
285 {
286 $this->address = $address;
287 }
288
289 /**
290 * Returns Phone Number.
291 * The phone number associated with the customer profile. The phone number must be valid and can
292 * contain
293 * 9–16 digits, with an optional `+` prefix and country code. For more information, see
294 * [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-
295 * records#phone-number).
296 */
297 public function getPhoneNumber(): ?string
298 {
299 if (count($this->phoneNumber) == 0) {
300 return null;
301 }
302 return $this->phoneNumber['value'];
303 }
304
305 /**
306 * Sets Phone Number.
307 * The phone number associated with the customer profile. The phone number must be valid and can
308 * contain
309 * 9–16 digits, with an optional `+` prefix and country code. For more information, see
310 * [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-
311 * records#phone-number).
312 *
313 * @maps phone_number
314 */
315 public function setPhoneNumber(?string $phoneNumber): void
316 {
317 $this->phoneNumber['value'] = $phoneNumber;
318 }
319
320 /**
321 * Unsets Phone Number.
322 * The phone number associated with the customer profile. The phone number must be valid and can
323 * contain
324 * 9–16 digits, with an optional `+` prefix and country code. For more information, see
325 * [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-
326 * records#phone-number).
327 */
328 public function unsetPhoneNumber(): void
329 {
330 $this->phoneNumber = [];
331 }
332
333 /**
334 * Returns Reference Id.
335 * An optional second ID used to associate the customer profile with an
336 * entity in another system.
337 *
338 * The maximum length for this value is 100 characters.
339 */
340 public function getReferenceId(): ?string
341 {
342 if (count($this->referenceId) == 0) {
343 return null;
344 }
345 return $this->referenceId['value'];
346 }
347
348 /**
349 * Sets Reference Id.
350 * An optional second ID used to associate the customer profile with an
351 * entity in another system.
352 *
353 * The maximum length for this value is 100 characters.
354 *
355 * @maps reference_id
356 */
357 public function setReferenceId(?string $referenceId): void
358 {
359 $this->referenceId['value'] = $referenceId;
360 }
361
362 /**
363 * Unsets Reference Id.
364 * An optional second ID used to associate the customer profile with an
365 * entity in another system.
366 *
367 * The maximum length for this value is 100 characters.
368 */
369 public function unsetReferenceId(): void
370 {
371 $this->referenceId = [];
372 }
373
374 /**
375 * Returns Note.
376 * A custom note associated with the customer profile.
377 */
378 public function getNote(): ?string
379 {
380 if (count($this->note) == 0) {
381 return null;
382 }
383 return $this->note['value'];
384 }
385
386 /**
387 * Sets Note.
388 * A custom note associated with the customer profile.
389 *
390 * @maps note
391 */
392 public function setNote(?string $note): void
393 {
394 $this->note['value'] = $note;
395 }
396
397 /**
398 * Unsets Note.
399 * A custom note associated with the customer profile.
400 */
401 public function unsetNote(): void
402 {
403 $this->note = [];
404 }
405
406 /**
407 * Returns Birthday.
408 * The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For example,
409 * specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays are returned in
410 * `YYYY-MM-DD`
411 * format, where `YYYY` is the specified birth year or `0000` if a birth year is not specified.
412 */
413 public function getBirthday(): ?string
414 {
415 if (count($this->birthday) == 0) {
416 return null;
417 }
418 return $this->birthday['value'];
419 }
420
421 /**
422 * Sets Birthday.
423 * The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For example,
424 * specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays are returned in
425 * `YYYY-MM-DD`
426 * format, where `YYYY` is the specified birth year or `0000` if a birth year is not specified.
427 *
428 * @maps birthday
429 */
430 public function setBirthday(?string $birthday): void
431 {
432 $this->birthday['value'] = $birthday;
433 }
434
435 /**
436 * Unsets Birthday.
437 * The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For example,
438 * specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays are returned in
439 * `YYYY-MM-DD`
440 * format, where `YYYY` is the specified birth year or `0000` if a birth year is not specified.
441 */
442 public function unsetBirthday(): void
443 {
444 $this->birthday = [];
445 }
446
447 /**
448 * Returns Version.
449 * The current version of the customer profile.
450 *
451 * As a best practice, you should include this field to enable [optimistic concurrency](https:
452 * //developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. For
453 * more information, see [Update a customer profile](https://developer.squareup.com/docs/customers-
454 * api/use-the-api/keep-records#update-a-customer-profile).
455 */
456 public function getVersion(): ?int
457 {
458 return $this->version;
459 }
460
461 /**
462 * Sets Version.
463 * The current version of the customer profile.
464 *
465 * As a best practice, you should include this field to enable [optimistic concurrency](https:
466 * //developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. For
467 * more information, see [Update a customer profile](https://developer.squareup.com/docs/customers-
468 * api/use-the-api/keep-records#update-a-customer-profile).
469 *
470 * @maps version
471 */
472 public function setVersion(?int $version): void
473 {
474 $this->version = $version;
475 }
476
477 /**
478 * Returns Tax Ids.
479 * Represents the tax ID associated with a [customer profile]($m/Customer). The corresponding `tax_ids`
480 * field is available only for customers of sellers in EU countries or the United Kingdom.
481 * For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-
482 * it-does#customer-tax-ids).
483 */
484 public function getTaxIds(): ?CustomerTaxIds
485 {
486 return $this->taxIds;
487 }
488
489 /**
490 * Sets Tax Ids.
491 * Represents the tax ID associated with a [customer profile]($m/Customer). The corresponding `tax_ids`
492 * field is available only for customers of sellers in EU countries or the United Kingdom.
493 * For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-
494 * it-does#customer-tax-ids).
495 *
496 * @maps tax_ids
497 */
498 public function setTaxIds(?CustomerTaxIds $taxIds): void
499 {
500 $this->taxIds = $taxIds;
501 }
502
503 /**
504 * Encode this object to JSON
505 *
506 * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
507 * are set. (default: false)
508 *
509 * @return array|stdClass
510 */
511 #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
512 public function jsonSerialize(bool $asArrayWhenEmpty = false)
513 {
514 $json = [];
515 if (!empty($this->givenName)) {
516 $json['given_name'] = $this->givenName['value'];
517 }
518 if (!empty($this->familyName)) {
519 $json['family_name'] = $this->familyName['value'];
520 }
521 if (!empty($this->companyName)) {
522 $json['company_name'] = $this->companyName['value'];
523 }
524 if (!empty($this->nickname)) {
525 $json['nickname'] = $this->nickname['value'];
526 }
527 if (!empty($this->emailAddress)) {
528 $json['email_address'] = $this->emailAddress['value'];
529 }
530 if (isset($this->address)) {
531 $json['address'] = $this->address;
532 }
533 if (!empty($this->phoneNumber)) {
534 $json['phone_number'] = $this->phoneNumber['value'];
535 }
536 if (!empty($this->referenceId)) {
537 $json['reference_id'] = $this->referenceId['value'];
538 }
539 if (!empty($this->note)) {
540 $json['note'] = $this->note['value'];
541 }
542 if (!empty($this->birthday)) {
543 $json['birthday'] = $this->birthday['value'];
544 }
545 if (isset($this->version)) {
546 $json['version'] = $this->version;
547 }
548 if (isset($this->taxIds)) {
549 $json['tax_ids'] = $this->taxIds;
550 }
551 $json = array_filter($json, function ($val) {
552 return $val !== null;
553 });
554
555 return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
556 }
557 }
558