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

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

125 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 /**
10 * A request to search for loyalty rewards.
11 */
12 class SearchLoyaltyRewardsRequest implements \JsonSerializable
13 {
14 /**
15 * @var SearchLoyaltyRewardsRequestLoyaltyRewardQuery|null
16 */
17 private $query;
18
19 /**
20 * @var int|null
21 */
22 private $limit;
23
24 /**
25 * @var string|null
26 */
27 private $cursor;
28
29 /**
30 * Returns Query.
31 * The set of search requirements.
32 */
33 public function getQuery(): ?SearchLoyaltyRewardsRequestLoyaltyRewardQuery
34 {
35 return $this->query;
36 }
37
38 /**
39 * Sets Query.
40 * The set of search requirements.
41 *
42 * @maps query
43 */
44 public function setQuery(?SearchLoyaltyRewardsRequestLoyaltyRewardQuery $query): void
45 {
46 $this->query = $query;
47 }
48
49 /**
50 * Returns Limit.
51 * The maximum number of results to return in the response. The default value is 30.
52 */
53 public function getLimit(): ?int
54 {
55 return $this->limit;
56 }
57
58 /**
59 * Sets Limit.
60 * The maximum number of results to return in the response. The default value is 30.
61 *
62 * @maps limit
63 */
64 public function setLimit(?int $limit): void
65 {
66 $this->limit = $limit;
67 }
68
69 /**
70 * Returns Cursor.
71 * A pagination cursor returned by a previous call to
72 * this endpoint. Provide this to retrieve the next set of
73 * results for the original query.
74 * For more information,
75 * see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
76 */
77 public function getCursor(): ?string
78 {
79 return $this->cursor;
80 }
81
82 /**
83 * Sets Cursor.
84 * A pagination cursor returned by a previous call to
85 * this endpoint. Provide this to retrieve the next set of
86 * results for the original query.
87 * For more information,
88 * see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
89 *
90 * @maps cursor
91 */
92 public function setCursor(?string $cursor): void
93 {
94 $this->cursor = $cursor;
95 }
96
97 /**
98 * Encode this object to JSON
99 *
100 * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
101 * are set. (default: false)
102 *
103 * @return array|stdClass
104 */
105 #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
106 public function jsonSerialize(bool $asArrayWhenEmpty = false)
107 {
108 $json = [];
109 if (isset($this->query)) {
110 $json['query'] = $this->query;
111 }
112 if (isset($this->limit)) {
113 $json['limit'] = $this->limit;
114 }
115 if (isset($this->cursor)) {
116 $json['cursor'] = $this->cursor;
117 }
118 $json = array_filter($json, function ($val) {
119 return $val !== null;
120 });
121
122 return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
123 }
124 }
125