PluginProbe
WooCommerce Square / 2.2.5
WooCommerce Square v2.2.5
5.5.0 5.4.3 5.4.2 5.4.1 5.4.0 trunk 1.0.25 1.0.26 1.0.27 1.0.28 1.0.29 1.0.30 1.0.31 1.0.32 1.0.33 1.0.34 1.0.35 1.0.36 1.0.37 1.0.38 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 All 132 releases
woocommerce-square / vendor / square / connect / lib / Model / UpdateOrderRequest.php
UpdateOrderRequest.php
213 lines 6.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * NOTE: This class is auto generated by the swagger code generator program.
4 * https://github.com/swagger-api/swagger-codegen
5 * Do not edit the class manually.
6 */
7
8 namespace SquareConnect\Model;
9
10 use \ArrayAccess;
11 /**
12 * UpdateOrderRequest Class Doc Comment
13 *
14 * @category Class
15 * @package SquareConnect
16 * @author Square Inc.
17 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2
18 * @link https://squareup.com/developers
19 */
20 class UpdateOrderRequest implements ArrayAccess
21 {
22 /**
23 * Array of property to type mappings. Used for (de)serialization
24 * @var string[]
25 */
26 static $swaggerTypes = array(
27 'order' => '\SquareConnect\Model\Order',
28 'fields_to_clear' => 'string[]',
29 'idempotency_key' => 'string'
30 );
31
32 /**
33 * Array of attributes where the key is the local name, and the value is the original name
34 * @var string[]
35 */
36 static $attributeMap = array(
37 'order' => 'order',
38 'fields_to_clear' => 'fields_to_clear',
39 'idempotency_key' => 'idempotency_key'
40 );
41
42 /**
43 * Array of attributes to setter functions (for deserialization of responses)
44 * @var string[]
45 */
46 static $setters = array(
47 'order' => 'setOrder',
48 'fields_to_clear' => 'setFieldsToClear',
49 'idempotency_key' => 'setIdempotencyKey'
50 );
51
52 /**
53 * Array of attributes to getter functions (for serialization of requests)
54 * @var string[]
55 */
56 static $getters = array(
57 'order' => 'getOrder',
58 'fields_to_clear' => 'getFieldsToClear',
59 'idempotency_key' => 'getIdempotencyKey'
60 );
61
62 /**
63 * $order The [sparse order](/orders-api/manage-orders#sparse-order-objects) containing only the fields to update and the version the update is being applied to.
64 * @var \SquareConnect\Model\Order
65 */
66 protected $order;
67 /**
68 * $fields_to_clear The [dot notation paths](/orders-api/manage-orders#on-dot-notation) fields to clear. For example, `line_items[uid].note` [Read more about Deleting fields](/orders-api/manage-orders#delete-fields).
69 * @var string[]
70 */
71 protected $fields_to_clear;
72 /**
73 * $idempotency_key A value you specify that uniquely identifies this update request If you're unsure whether a particular update was applied to an order successfully, you can reattempt it with the same idempotency key without worrying about creating duplicate updates to the order. The latest order version will be returned. See [Idempotency](/basics/api101/idempotency) for more information.
74 * @var string
75 */
76 protected $idempotency_key;
77
78 /**
79 * Constructor
80 * @param mixed[] $data Associated array of property value initializing the model
81 */
82 public function __construct(array $data = null)
83 {
84 if ($data != null) {
85 if (isset($data["order"])) {
86 $this->order = $data["order"];
87 } else {
88 $this->order = null;
89 }
90 if (isset($data["fields_to_clear"])) {
91 $this->fields_to_clear = $data["fields_to_clear"];
92 } else {
93 $this->fields_to_clear = null;
94 }
95 if (isset($data["idempotency_key"])) {
96 $this->idempotency_key = $data["idempotency_key"];
97 } else {
98 $this->idempotency_key = null;
99 }
100 }
101 }
102 /**
103 * Gets order
104 * @return \SquareConnect\Model\Order
105 */
106 public function getOrder()
107 {
108 return $this->order;
109 }
110
111 /**
112 * Sets order
113 * @param \SquareConnect\Model\Order $order The [sparse order](/orders-api/manage-orders#sparse-order-objects) containing only the fields to update and the version the update is being applied to.
114 * @return $this
115 */
116 public function setOrder($order)
117 {
118 $this->order = $order;
119 return $this;
120 }
121 /**
122 * Gets fields_to_clear
123 * @return string[]
124 */
125 public function getFieldsToClear()
126 {
127 return $this->fields_to_clear;
128 }
129
130 /**
131 * Sets fields_to_clear
132 * @param string[] $fields_to_clear The [dot notation paths](/orders-api/manage-orders#on-dot-notation) fields to clear. For example, `line_items[uid].note` [Read more about Deleting fields](/orders-api/manage-orders#delete-fields).
133 * @return $this
134 */
135 public function setFieldsToClear($fields_to_clear)
136 {
137 $this->fields_to_clear = $fields_to_clear;
138 return $this;
139 }
140 /**
141 * Gets idempotency_key
142 * @return string
143 */
144 public function getIdempotencyKey()
145 {
146 return $this->idempotency_key;
147 }
148
149 /**
150 * Sets idempotency_key
151 * @param string $idempotency_key A value you specify that uniquely identifies this update request If you're unsure whether a particular update was applied to an order successfully, you can reattempt it with the same idempotency key without worrying about creating duplicate updates to the order. The latest order version will be returned. See [Idempotency](/basics/api101/idempotency) for more information.
152 * @return $this
153 */
154 public function setIdempotencyKey($idempotency_key)
155 {
156 $this->idempotency_key = $idempotency_key;
157 return $this;
158 }
159 /**
160 * Returns true if offset exists. False otherwise.
161 * @param integer $offset Offset
162 * @return boolean
163 */
164 public function offsetExists($offset)
165 {
166 return isset($this->$offset);
167 }
168
169 /**
170 * Gets offset.
171 * @param integer $offset Offset
172 * @return mixed
173 */
174 public function offsetGet($offset)
175 {
176 return $this->$offset;
177 }
178
179 /**
180 * Sets value based on offset.
181 * @param integer $offset Offset
182 * @param mixed $value Value to be set
183 * @return void
184 */
185 public function offsetSet($offset, $value)
186 {
187 $this->$offset = $value;
188 }
189
190 /**
191 * Unsets offset.
192 * @param integer $offset Offset
193 * @return void
194 */
195 public function offsetUnset($offset)
196 {
197 unset($this->$offset);
198 }
199
200 /**
201 * Gets the string presentation of the object
202 * @return string
203 */
204 public function __toString()
205 {
206 if (defined('JSON_PRETTY_PRINT')) {
207 return json_encode(\SquareConnect\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
208 } else {
209 return json_encode(\SquareConnect\ObjectSerializer::sanitizeForSerialization($this));
210 }
211 }
212 }
213