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

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

127 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 * Defines the parameters for a `CreateDisputeEvidenceText` request.
11 */
12 class CreateDisputeEvidenceTextRequest implements \JsonSerializable
13 {
14 /**
15 * @var string
16 */
17 private $idempotencyKey;
18
19 /**
20 * @var string|null
21 */
22 private $evidenceType;
23
24 /**
25 * @var string
26 */
27 private $evidenceText;
28
29 /**
30 * @param string $idempotencyKey
31 * @param string $evidenceText
32 */
33 public function __construct(string $idempotencyKey, string $evidenceText)
34 {
35 $this->idempotencyKey = $idempotencyKey;
36 $this->evidenceText = $evidenceText;
37 }
38
39 /**
40 * Returns Idempotency Key.
41 * A unique key identifying the request. For more information, see [Idempotency](https://developer.
42 * squareup.com/docs/working-with-apis/idempotency).
43 */
44 public function getIdempotencyKey(): string
45 {
46 return $this->idempotencyKey;
47 }
48
49 /**
50 * Sets Idempotency Key.
51 * A unique key identifying the request. For more information, see [Idempotency](https://developer.
52 * squareup.com/docs/working-with-apis/idempotency).
53 *
54 * @required
55 * @maps idempotency_key
56 */
57 public function setIdempotencyKey(string $idempotencyKey): void
58 {
59 $this->idempotencyKey = $idempotencyKey;
60 }
61
62 /**
63 * Returns Evidence Type.
64 * The type of the dispute evidence.
65 */
66 public function getEvidenceType(): ?string
67 {
68 return $this->evidenceType;
69 }
70
71 /**
72 * Sets Evidence Type.
73 * The type of the dispute evidence.
74 *
75 * @maps evidence_type
76 */
77 public function setEvidenceType(?string $evidenceType): void
78 {
79 $this->evidenceType = $evidenceType;
80 }
81
82 /**
83 * Returns Evidence Text.
84 * The evidence string.
85 */
86 public function getEvidenceText(): string
87 {
88 return $this->evidenceText;
89 }
90
91 /**
92 * Sets Evidence Text.
93 * The evidence string.
94 *
95 * @required
96 * @maps evidence_text
97 */
98 public function setEvidenceText(string $evidenceText): void
99 {
100 $this->evidenceText = $evidenceText;
101 }
102
103 /**
104 * Encode this object to JSON
105 *
106 * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
107 * are set. (default: false)
108 *
109 * @return array|stdClass
110 */
111 #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
112 public function jsonSerialize(bool $asArrayWhenEmpty = false)
113 {
114 $json = [];
115 $json['idempotency_key'] = $this->idempotencyKey;
116 if (isset($this->evidenceType)) {
117 $json['evidence_type'] = $this->evidenceType;
118 }
119 $json['evidence_text'] = $this->evidenceText;
120 $json = array_filter($json, function ($val) {
121 return $val !== null;
122 });
123
124 return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
125 }
126 }
127