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.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 1.7.0.9 All 211 releases
charitable / vendor / square / square / src / Legacy / Models / UpdateCustomerGroupRequest.php

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

75 lines 1.9 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 * [UpdateCustomerGroup]($e/CustomerGroups/UpdateCustomerGroup) endpoint.
12 */
13 class UpdateCustomerGroupRequest implements \JsonSerializable
14 {
15 /**
16 * @var CustomerGroup
17 */
18 private $group;
19
20 /**
21 * @param CustomerGroup $group
22 */
23 public function __construct(CustomerGroup $group)
24 {
25 $this->group = $group;
26 }
27
28 /**
29 * Returns Group.
30 * Represents a group of customer profiles.
31 *
32 * Customer groups can be created, be modified, and have their membership defined using
33 * the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale.
34 */
35 public function getGroup(): CustomerGroup
36 {
37 return $this->group;
38 }
39
40 /**
41 * Sets Group.
42 * Represents a group of customer profiles.
43 *
44 * Customer groups can be created, be modified, and have their membership defined using
45 * the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale.
46 *
47 * @required
48 * @maps group
49 */
50 public function setGroup(CustomerGroup $group): void
51 {
52 $this->group = $group;
53 }
54
55 /**
56 * Encode this object to JSON
57 *
58 * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
59 * are set. (default: false)
60 *
61 * @return array|stdClass
62 */
63 #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
64 public function jsonSerialize(bool $asArrayWhenEmpty = false)
65 {
66 $json = [];
67 $json['group'] = $this->group;
68 $json = array_filter($json, function ($val) {
69 return $val !== null;
70 });
71
72 return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
73 }
74 }
75