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

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

130 lines 3.0 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 RetrieveInventoryChangesResponse implements \JsonSerializable
10 {
11 /**
12 * @var Error[]|null
13 */
14 private $errors;
15
16 /**
17 * @var InventoryChange[]|null
18 */
19 private $changes;
20
21 /**
22 * @var string|null
23 */
24 private $cursor;
25
26 /**
27 * Returns Errors.
28 * Any errors that occurred during the request.
29 *
30 * @return Error[]|null
31 */
32 public function getErrors(): ?array
33 {
34 return $this->errors;
35 }
36
37 /**
38 * Sets Errors.
39 * Any errors that occurred during the request.
40 *
41 * @maps errors
42 *
43 * @param Error[]|null $errors
44 */
45 public function setErrors(?array $errors): void
46 {
47 $this->errors = $errors;
48 }
49
50 /**
51 * Returns Changes.
52 * The set of inventory changes for the requested object and locations.
53 *
54 * @return InventoryChange[]|null
55 */
56 public function getChanges(): ?array
57 {
58 return $this->changes;
59 }
60
61 /**
62 * Sets Changes.
63 * The set of inventory changes for the requested object and locations.
64 *
65 * @maps changes
66 *
67 * @param InventoryChange[]|null $changes
68 */
69 public function setChanges(?array $changes): void
70 {
71 $this->changes = $changes;
72 }
73
74 /**
75 * Returns Cursor.
76 * The pagination cursor to be used in a subsequent request. If unset,
77 * this is the final response.
78 *
79 * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for
80 * more information.
81 */
82 public function getCursor(): ?string
83 {
84 return $this->cursor;
85 }
86
87 /**
88 * Sets Cursor.
89 * The pagination cursor to be used in a subsequent request. If unset,
90 * this is the final response.
91 *
92 * See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for
93 * more information.
94 *
95 * @maps cursor
96 */
97 public function setCursor(?string $cursor): void
98 {
99 $this->cursor = $cursor;
100 }
101
102 /**
103 * Encode this object to JSON
104 *
105 * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
106 * are set. (default: false)
107 *
108 * @return array|stdClass
109 */
110 #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
111 public function jsonSerialize(bool $asArrayWhenEmpty = false)
112 {
113 $json = [];
114 if (isset($this->errors)) {
115 $json['errors'] = $this->errors;
116 }
117 if (isset($this->changes)) {
118 $json['changes'] = $this->changes;
119 }
120 if (isset($this->cursor)) {
121 $json['cursor'] = $this->cursor;
122 }
123 $json = array_filter($json, function ($val) {
124 return $val !== null;
125 });
126
127 return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
128 }
129 }
130