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 / CreateBookingRequest.php

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

97 lines 2.4 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 class CreateBookingRequest implements \JsonSerializable
10 {
11 /**
12 * @var string|null
13 */
14 private $idempotencyKey;
15
16 /**
17 * @var Booking
18 */
19 private $booking;
20
21 /**
22 * @param Booking $booking
23 */
24 public function __construct(Booking $booking)
25 {
26 $this->booking = $booking;
27 }
28
29 /**
30 * Returns Idempotency Key.
31 * A unique key to make this request an idempotent operation.
32 */
33 public function getIdempotencyKey(): ?string
34 {
35 return $this->idempotencyKey;
36 }
37
38 /**
39 * Sets Idempotency Key.
40 * A unique key to make this request an idempotent operation.
41 *
42 * @maps idempotency_key
43 */
44 public function setIdempotencyKey(?string $idempotencyKey): void
45 {
46 $this->idempotencyKey = $idempotencyKey;
47 }
48
49 /**
50 * Returns Booking.
51 * Represents a booking as a time-bound service contract for a seller's staff member to provide a
52 * specified service
53 * at a given location to a requesting customer in one or more appointment segments.
54 */
55 public function getBooking(): Booking
56 {
57 return $this->booking;
58 }
59
60 /**
61 * Sets Booking.
62 * Represents a booking as a time-bound service contract for a seller's staff member to provide a
63 * specified service
64 * at a given location to a requesting customer in one or more appointment segments.
65 *
66 * @required
67 * @maps booking
68 */
69 public function setBooking(Booking $booking): void
70 {
71 $this->booking = $booking;
72 }
73
74 /**
75 * Encode this object to JSON
76 *
77 * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
78 * are set. (default: false)
79 *
80 * @return array|stdClass
81 */
82 #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
83 public function jsonSerialize(bool $asArrayWhenEmpty = false)
84 {
85 $json = [];
86 if (isset($this->idempotencyKey)) {
87 $json['idempotency_key'] = $this->idempotencyKey;
88 }
89 $json['booking'] = $this->booking;
90 $json = array_filter($json, function ($val) {
91 return $val !== null;
92 });
93
94 return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
95 }
96 }
97