charitable
/
vendor
/
square
/
square
/
src
/
Legacy
/
Models
/
BulkDeleteBookingCustomAttributesRequest.php
BulkDeleteBookingCustomAttributesRequest.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13, at vendor/square/square/src/Legacy/Models/BulkDeleteBookingCustomAttributesRequest.php
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Square\Legacy\Models; |
| 6 | |
| 7 | use stdClass; |
| 8 | |
| 9 | /** |
| 10 | * Represents a |
| 11 | * [BulkDeleteBookingCustomAttributes]($e/BookingCustomAttributes/BulkDeleteBookingCustomAttributes) |
| 12 | * request. |
| 13 | */ |
| 14 | class BulkDeleteBookingCustomAttributesRequest implements \JsonSerializable |
| 15 | { |
| 16 | /** |
| 17 | * @var array<string,BookingCustomAttributeDeleteRequest> |
| 18 | */ |
| 19 | private $values; |
| 20 | |
| 21 | /** |
| 22 | * @param array<string,BookingCustomAttributeDeleteRequest> $values |
| 23 | */ |
| 24 | public function __construct(array $values) |
| 25 | { |
| 26 | $this->values = $values; |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Returns Values. |
| 31 | * A map containing 1 to 25 individual Delete requests. For each request, provide an |
| 32 | * arbitrary ID that is unique for this `BulkDeleteBookingCustomAttributes` request and the |
| 33 | * information needed to delete a custom attribute. |
| 34 | * |
| 35 | * @return array<string,BookingCustomAttributeDeleteRequest> |
| 36 | */ |
| 37 | public function getValues(): array |
| 38 | { |
| 39 | return $this->values; |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Sets Values. |
| 44 | * A map containing 1 to 25 individual Delete requests. For each request, provide an |
| 45 | * arbitrary ID that is unique for this `BulkDeleteBookingCustomAttributes` request and the |
| 46 | * information needed to delete a custom attribute. |
| 47 | * |
| 48 | * @required |
| 49 | * @maps values |
| 50 | * |
| 51 | * @param array<string,BookingCustomAttributeDeleteRequest> $values |
| 52 | */ |
| 53 | public function setValues(array $values): void |
| 54 | { |
| 55 | $this->values = $values; |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Encode this object to JSON |
| 60 | * |
| 61 | * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields |
| 62 | * are set. (default: false) |
| 63 | * |
| 64 | * @return array|stdClass |
| 65 | */ |
| 66 | #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) |
| 67 | public function jsonSerialize(bool $asArrayWhenEmpty = false) |
| 68 | { |
| 69 | $json = []; |
| 70 | $json['values'] = $this->values; |
| 71 | $json = array_filter($json, function ($val) { |
| 72 | return $val !== null; |
| 73 | }); |
| 74 | |
| 75 | return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; |
| 76 | } |
| 77 | } |
| 78 |