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 / CreateOrderRequestDiscount.php
CreateOrderRequestDiscount.php
246 lines 6.8 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 * CreateOrderRequestDiscount 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 CreateOrderRequestDiscount implements ArrayAccess
21 {
22 /**
23 * Array of property to type mappings. Used for (de)serialization
24 * @var string[]
25 */
26 static $swaggerTypes = array(
27 'catalog_object_id' => 'string',
28 'name' => 'string',
29 'percentage' => 'string',
30 'amount_money' => '\SquareConnect\Model\Money'
31 );
32
33 /**
34 * Array of attributes where the key is the local name, and the value is the original name
35 * @var string[]
36 */
37 static $attributeMap = array(
38 'catalog_object_id' => 'catalog_object_id',
39 'name' => 'name',
40 'percentage' => 'percentage',
41 'amount_money' => 'amount_money'
42 );
43
44 /**
45 * Array of attributes to setter functions (for deserialization of responses)
46 * @var string[]
47 */
48 static $setters = array(
49 'catalog_object_id' => 'setCatalogObjectId',
50 'name' => 'setName',
51 'percentage' => 'setPercentage',
52 'amount_money' => 'setAmountMoney'
53 );
54
55 /**
56 * Array of attributes to getter functions (for serialization of requests)
57 * @var string[]
58 */
59 static $getters = array(
60 'catalog_object_id' => 'getCatalogObjectId',
61 'name' => 'getName',
62 'percentage' => 'getPercentage',
63 'amount_money' => 'getAmountMoney'
64 );
65
66 /**
67 * $catalog_object_id Only used for catalog discounts. The catalog object ID for an existing [CatalogDiscount](#type-catalogdiscount). Do not provide a value for this field if you provide values in other fields for an ad hoc discount.
68 * @var string
69 */
70 protected $catalog_object_id;
71 /**
72 * $name Only used for ad hoc discounts. The discount's name.
73 * @var string
74 */
75 protected $name;
76 /**
77 * $percentage Only used for ad hoc discounts. The percentage of the discount, as a string representation of a decimal number. A value of `7.25` corresponds to a percentage of 7.25%. This value range between 0.0 up to 100.0
78 * @var string
79 */
80 protected $percentage;
81 /**
82 * $amount_money Only used for ad hoc discounts. The monetary amount of the discount.
83 * @var \SquareConnect\Model\Money
84 */
85 protected $amount_money;
86
87 /**
88 * Constructor
89 * @param mixed[] $data Associated array of property value initializing the model
90 */
91 public function __construct(array $data = null)
92 {
93 if ($data != null) {
94 if (isset($data["catalog_object_id"])) {
95 $this->catalog_object_id = $data["catalog_object_id"];
96 } else {
97 $this->catalog_object_id = null;
98 }
99 if (isset($data["name"])) {
100 $this->name = $data["name"];
101 } else {
102 $this->name = null;
103 }
104 if (isset($data["percentage"])) {
105 $this->percentage = $data["percentage"];
106 } else {
107 $this->percentage = null;
108 }
109 if (isset($data["amount_money"])) {
110 $this->amount_money = $data["amount_money"];
111 } else {
112 $this->amount_money = null;
113 }
114 }
115 }
116 /**
117 * Gets catalog_object_id
118 * @return string
119 */
120 public function getCatalogObjectId()
121 {
122 return $this->catalog_object_id;
123 }
124
125 /**
126 * Sets catalog_object_id
127 * @param string $catalog_object_id Only used for catalog discounts. The catalog object ID for an existing [CatalogDiscount](#type-catalogdiscount). Do not provide a value for this field if you provide values in other fields for an ad hoc discount.
128 * @return $this
129 */
130 public function setCatalogObjectId($catalog_object_id)
131 {
132 $this->catalog_object_id = $catalog_object_id;
133 return $this;
134 }
135 /**
136 * Gets name
137 * @return string
138 */
139 public function getName()
140 {
141 return $this->name;
142 }
143
144 /**
145 * Sets name
146 * @param string $name Only used for ad hoc discounts. The discount's name.
147 * @return $this
148 */
149 public function setName($name)
150 {
151 $this->name = $name;
152 return $this;
153 }
154 /**
155 * Gets percentage
156 * @return string
157 */
158 public function getPercentage()
159 {
160 return $this->percentage;
161 }
162
163 /**
164 * Sets percentage
165 * @param string $percentage Only used for ad hoc discounts. The percentage of the discount, as a string representation of a decimal number. A value of `7.25` corresponds to a percentage of 7.25%. This value range between 0.0 up to 100.0
166 * @return $this
167 */
168 public function setPercentage($percentage)
169 {
170 $this->percentage = $percentage;
171 return $this;
172 }
173 /**
174 * Gets amount_money
175 * @return \SquareConnect\Model\Money
176 */
177 public function getAmountMoney()
178 {
179 return $this->amount_money;
180 }
181
182 /**
183 * Sets amount_money
184 * @param \SquareConnect\Model\Money $amount_money Only used for ad hoc discounts. The monetary amount of the discount.
185 * @return $this
186 */
187 public function setAmountMoney($amount_money)
188 {
189 $this->amount_money = $amount_money;
190 return $this;
191 }
192 /**
193 * Returns true if offset exists. False otherwise.
194 * @param integer $offset Offset
195 * @return boolean
196 */
197 public function offsetExists($offset)
198 {
199 return isset($this->$offset);
200 }
201
202 /**
203 * Gets offset.
204 * @param integer $offset Offset
205 * @return mixed
206 */
207 public function offsetGet($offset)
208 {
209 return $this->$offset;
210 }
211
212 /**
213 * Sets value based on offset.
214 * @param integer $offset Offset
215 * @param mixed $value Value to be set
216 * @return void
217 */
218 public function offsetSet($offset, $value)
219 {
220 $this->$offset = $value;
221 }
222
223 /**
224 * Unsets offset.
225 * @param integer $offset Offset
226 * @return void
227 */
228 public function offsetUnset($offset)
229 {
230 unset($this->$offset);
231 }
232
233 /**
234 * Gets the string presentation of the object
235 * @return string
236 */
237 public function __toString()
238 {
239 if (defined('JSON_PRETTY_PRINT')) {
240 return json_encode(\SquareConnect\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
241 } else {
242 return json_encode(\SquareConnect\ObjectSerializer::sanitizeForSerialization($this));
243 }
244 }
245 }
246