1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Speicher210\Monsum\Api\Model; |
4
|
|
|
|
5
|
|
|
use JMS\Serializer\Annotation as JMS; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Customer query parameters. |
9
|
|
|
*/ |
10
|
|
|
class CustomerQueryParams |
11
|
|
|
{ |
12
|
|
|
/** |
13
|
|
|
* The address of the customer. |
14
|
|
|
* |
15
|
|
|
* @var string |
16
|
|
|
* |
17
|
|
|
* @JMS\Type("string") |
18
|
|
|
* @JMS\SerializedName("address_line1") |
19
|
|
|
*/ |
20
|
|
|
private $address; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Affiliate. |
24
|
|
|
* |
25
|
|
|
* @var string |
26
|
|
|
* |
27
|
|
|
* @JMS\Type("string") |
28
|
|
|
* @JMS\SerializedName("affiliate") |
29
|
|
|
*/ |
30
|
|
|
private $affiliate; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* The city of the customer. |
34
|
|
|
* |
35
|
|
|
* @var string |
36
|
|
|
* |
37
|
|
|
* @JMS\Type("string") |
38
|
|
|
* @JMS\SerializedName("city") |
39
|
|
|
*/ |
40
|
|
|
private $city; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* The company name of the customer. |
44
|
|
|
* |
45
|
|
|
* @var string |
46
|
|
|
* |
47
|
|
|
* @JMS\Type("string") |
48
|
|
|
* @JMS\SerializedName("company") |
49
|
|
|
*/ |
50
|
|
|
private $companyName; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* The customer country code (ISO 3166 ALPHA-2). |
54
|
|
|
* |
55
|
|
|
* @var string |
56
|
|
|
* |
57
|
|
|
* @JMS\Type("string") |
58
|
|
|
* @JMS\SerializedName("country") |
59
|
|
|
*/ |
60
|
|
|
private $countryCode; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* The customer external ID. |
64
|
|
|
* |
65
|
|
|
* @var string |
66
|
|
|
* |
67
|
|
|
* @JMS\Type("string") |
68
|
|
|
* @JMS\SerializedName("customer_ext_uid") |
69
|
|
|
*/ |
70
|
|
|
private $customerExternalUid; |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* The email address. |
74
|
|
|
* |
75
|
|
|
* @var string |
76
|
|
|
* |
77
|
|
|
* @JMS\Type("string") |
78
|
|
|
* @JMS\SerializedName("email") |
79
|
|
|
*/ |
80
|
|
|
private $email; |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* The first name of the customer. |
84
|
|
|
* |
85
|
|
|
* @var string |
86
|
|
|
* |
87
|
|
|
* @JMS\Type("string") |
88
|
|
|
* @JMS\SerializedName("first-name") |
89
|
|
|
*/ |
90
|
|
|
private $firstName; |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* The language code of the customer. |
94
|
|
|
* |
95
|
|
|
* @var string |
96
|
|
|
* |
97
|
|
|
* @JMS\Type("string") |
98
|
|
|
* @JMS\SerializedName("lang") |
99
|
|
|
*/ |
100
|
|
|
private $languageCode; |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* The last name of the customer. |
104
|
|
|
* |
105
|
|
|
* @var string |
106
|
|
|
* |
107
|
|
|
* @JMS\Type("string") |
108
|
|
|
* @JMS\SerializedName("last-name") |
109
|
|
|
*/ |
110
|
|
|
private $lastName; |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* Salutation. |
114
|
|
|
* |
115
|
|
|
* @var string |
116
|
|
|
* |
117
|
|
|
* @JMS\Type("string") |
118
|
|
|
* @JMS\SerializedName("salutation") |
119
|
|
|
*/ |
120
|
|
|
private $salutation; |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* Academic title. |
124
|
|
|
* |
125
|
|
|
* @var string |
126
|
|
|
* |
127
|
|
|
* @JMS\Type("string") |
128
|
|
|
* @JMS\SerializedName("title_academic") |
129
|
|
|
*/ |
130
|
|
|
private $titleAcademic; |
131
|
|
|
|
132
|
|
|
/** |
133
|
|
|
* The VAT identification number of the customer. |
134
|
|
|
* |
135
|
|
|
* @var string |
136
|
|
|
* |
137
|
|
|
* @JMS\Type("string") |
138
|
|
|
* @JMS\SerializedName("vatid") |
139
|
|
|
*/ |
140
|
|
|
private $vatId; |
141
|
|
|
|
142
|
|
|
/** |
143
|
|
|
* The zipcode of the customer. |
144
|
|
|
* |
145
|
|
|
* @var string |
146
|
|
|
* |
147
|
|
|
* @JMS\Type("string") |
148
|
|
|
* @JMS\SerializedName("postal-code") |
149
|
|
|
*/ |
150
|
|
|
private $zipCode; |
151
|
|
|
|
152
|
|
|
/** |
153
|
|
|
* Get the address. |
154
|
|
|
* |
155
|
|
|
* @return string |
156
|
|
|
*/ |
157
|
|
|
public function getAddress() |
158
|
|
|
{ |
159
|
|
|
return $this->address; |
160
|
|
|
} |
161
|
|
|
|
162
|
|
|
/** |
163
|
|
|
* Set the address. |
164
|
|
|
* |
165
|
|
|
* @param string $address The address. |
166
|
|
|
* @return CustomerQueryParams |
167
|
|
|
*/ |
168
|
|
|
public function setAddress($address) |
169
|
|
|
{ |
170
|
|
|
$this->address = $address; |
171
|
|
|
|
172
|
|
|
return $this; |
173
|
|
|
} |
174
|
|
|
|
175
|
|
|
/** |
176
|
|
|
* Get the affiliate. |
177
|
|
|
* |
178
|
|
|
* @return string |
179
|
|
|
*/ |
180
|
|
|
public function getAffiliate() |
181
|
|
|
{ |
182
|
|
|
return $this->affiliate; |
183
|
|
|
} |
184
|
|
|
|
185
|
|
|
/** |
186
|
|
|
* Set the affiliate. |
187
|
|
|
* |
188
|
|
|
* @param string $affiliate The affiliate. |
189
|
|
|
* @return CustomerQueryParams |
190
|
|
|
*/ |
191
|
|
|
public function setAffiliate($affiliate) |
192
|
|
|
{ |
193
|
|
|
$this->affiliate = $affiliate; |
194
|
|
|
|
195
|
|
|
return $this; |
196
|
|
|
} |
197
|
|
|
|
198
|
|
|
/** |
199
|
|
|
* Get the city. |
200
|
|
|
* |
201
|
|
|
* @return string |
202
|
|
|
*/ |
203
|
|
|
public function getCity() |
204
|
|
|
{ |
205
|
|
|
return $this->city; |
206
|
|
|
} |
207
|
|
|
|
208
|
|
|
/** |
209
|
|
|
* Set the city. |
210
|
|
|
* |
211
|
|
|
* @param string $city The city. |
212
|
|
|
* @return CustomerQueryParams |
213
|
|
|
*/ |
214
|
|
|
public function setCity($city) |
215
|
|
|
{ |
216
|
|
|
$this->city = $city; |
217
|
|
|
|
218
|
|
|
return $this; |
219
|
|
|
} |
220
|
|
|
|
221
|
|
|
/** |
222
|
|
|
* Get the company name. |
223
|
|
|
* |
224
|
|
|
* @return string |
225
|
|
|
*/ |
226
|
|
|
public function getCompanyName() |
227
|
|
|
{ |
228
|
|
|
return $this->companyName; |
229
|
|
|
} |
230
|
|
|
|
231
|
|
|
/** |
232
|
|
|
* Set the company name. |
233
|
|
|
* |
234
|
|
|
* @param string $companyName The company name. |
235
|
|
|
* @return CustomerQueryParams |
236
|
|
|
*/ |
237
|
|
|
public function setCompanyName($companyName) |
238
|
|
|
{ |
239
|
|
|
$this->companyName = $companyName; |
240
|
|
|
|
241
|
|
|
return $this; |
242
|
|
|
} |
243
|
|
|
|
244
|
|
|
/** |
245
|
|
|
* Get the country code. |
246
|
|
|
* |
247
|
|
|
* @return string |
248
|
|
|
*/ |
249
|
|
|
public function getCountryCode() |
250
|
|
|
{ |
251
|
|
|
return $this->countryCode; |
252
|
|
|
} |
253
|
|
|
|
254
|
|
|
/** |
255
|
|
|
* Set the customer country code (ISO 3166 ALPHA-2). |
256
|
|
|
* |
257
|
|
|
* @param string $countryCode The country code. |
258
|
|
|
* @return CustomerQueryParams |
259
|
|
|
*/ |
260
|
|
|
public function setCountryCode($countryCode) |
261
|
|
|
{ |
262
|
|
|
$this->countryCode = $countryCode; |
263
|
|
|
|
264
|
|
|
return $this; |
265
|
|
|
} |
266
|
|
|
|
267
|
|
|
/** |
268
|
|
|
* Get the customer external ID. |
269
|
|
|
* |
270
|
|
|
* @return string |
271
|
|
|
*/ |
272
|
|
|
public function getCustomerExternalUid() |
273
|
|
|
{ |
274
|
|
|
return $this->customerExternalUid; |
275
|
|
|
} |
276
|
|
|
|
277
|
|
|
/** |
278
|
|
|
* Set the customer external ID. |
279
|
|
|
* |
280
|
|
|
* @param string $customerExternalUid The external ID. |
281
|
|
|
* @return CustomerQueryParams |
282
|
|
|
*/ |
283
|
|
|
public function setCustomerExternalUid($customerExternalUid) |
284
|
|
|
{ |
285
|
|
|
$this->customerExternalUid = $customerExternalUid; |
286
|
|
|
|
287
|
|
|
return $this; |
288
|
|
|
} |
289
|
|
|
|
290
|
|
|
/** |
291
|
|
|
* Get the email address. |
292
|
|
|
* |
293
|
|
|
* @return string |
294
|
|
|
*/ |
295
|
|
|
public function getEmail() |
296
|
|
|
{ |
297
|
|
|
return $this->email; |
298
|
|
|
} |
299
|
|
|
|
300
|
|
|
/** |
301
|
|
|
* Set the email address. |
302
|
|
|
* |
303
|
|
|
* @param string $email The email. |
304
|
|
|
* @return CustomerQueryParams |
305
|
|
|
*/ |
306
|
|
|
public function setEmail($email) |
307
|
|
|
{ |
308
|
|
|
$this->email = $email; |
309
|
|
|
|
310
|
|
|
return $this; |
311
|
|
|
} |
312
|
|
|
|
313
|
|
|
/** |
314
|
|
|
* Get the first name. |
315
|
|
|
* |
316
|
|
|
* @return string |
317
|
|
|
*/ |
318
|
|
|
public function getFirstName() |
319
|
|
|
{ |
320
|
|
|
return $this->firstName; |
321
|
|
|
} |
322
|
|
|
|
323
|
|
|
/** |
324
|
|
|
* Set the first name. |
325
|
|
|
* |
326
|
|
|
* @param string $firstName The name. |
327
|
|
|
* @return CustomerQueryParams |
328
|
|
|
*/ |
329
|
|
|
public function setFirstName($firstName) |
330
|
|
|
{ |
331
|
|
|
$this->firstName = $firstName; |
332
|
|
|
|
333
|
|
|
return $this; |
334
|
|
|
} |
335
|
|
|
|
336
|
|
|
/** |
337
|
|
|
* Get the language code. |
338
|
|
|
* |
339
|
|
|
* @return string |
340
|
|
|
*/ |
341
|
|
|
public function getLanguageCode() |
342
|
|
|
{ |
343
|
|
|
return $this->languageCode; |
344
|
|
|
} |
345
|
|
|
|
346
|
|
|
/** |
347
|
|
|
* Set the language code. |
348
|
|
|
* |
349
|
|
|
* @param string $languageCode The language code. |
350
|
|
|
* @return CustomerQueryParams |
351
|
|
|
*/ |
352
|
|
|
public function setLanguageCode($languageCode) |
353
|
|
|
{ |
354
|
|
|
$this->languageCode = $languageCode; |
355
|
|
|
|
356
|
|
|
return $this; |
357
|
|
|
} |
358
|
|
|
|
359
|
|
|
/** |
360
|
|
|
* Get the last name. |
361
|
|
|
* |
362
|
|
|
* @return string |
363
|
|
|
*/ |
364
|
|
|
public function getLastName() |
365
|
|
|
{ |
366
|
|
|
return $this->lastName; |
367
|
|
|
} |
368
|
|
|
|
369
|
|
|
/** |
370
|
|
|
* Set the last name. |
371
|
|
|
* |
372
|
|
|
* @param string $lastName The last name. |
373
|
|
|
* @return CustomerQueryParams |
374
|
|
|
*/ |
375
|
|
|
public function setLastName($lastName) |
376
|
|
|
{ |
377
|
|
|
$this->lastName = $lastName; |
378
|
|
|
|
379
|
|
|
return $this; |
380
|
|
|
} |
381
|
|
|
|
382
|
|
|
/** |
383
|
|
|
* Get the salutation. |
384
|
|
|
* |
385
|
|
|
* @return string |
386
|
|
|
*/ |
387
|
|
|
public function getSalutation() |
388
|
|
|
{ |
389
|
|
|
return $this->salutation; |
390
|
|
|
} |
391
|
|
|
|
392
|
|
|
/** |
393
|
|
|
* Set the salutation. |
394
|
|
|
* |
395
|
|
|
* @param string $salutation The salutation. |
396
|
|
|
* @return CustomerQueryParams |
397
|
|
|
*/ |
398
|
|
|
public function setSalutation($salutation) |
399
|
|
|
{ |
400
|
|
|
$this->salutation = $salutation; |
401
|
|
|
|
402
|
|
|
return $this; |
403
|
|
|
} |
404
|
|
|
|
405
|
|
|
/** |
406
|
|
|
* Get the academic title. |
407
|
|
|
* |
408
|
|
|
* @return string |
409
|
|
|
*/ |
410
|
|
|
public function getTitleAcademic() |
411
|
|
|
{ |
412
|
|
|
return $this->titleAcademic; |
413
|
|
|
} |
414
|
|
|
|
415
|
|
|
/** |
416
|
|
|
* Set the academic title. |
417
|
|
|
* |
418
|
|
|
* @param string $titleAcademic The title. |
419
|
|
|
* @return CustomerQueryParams |
420
|
|
|
*/ |
421
|
|
|
public function setTitleAcademic($titleAcademic) |
422
|
|
|
{ |
423
|
|
|
$this->titleAcademic = $titleAcademic; |
424
|
|
|
|
425
|
|
|
return $this; |
426
|
|
|
} |
427
|
|
|
|
428
|
|
|
/** |
429
|
|
|
* Get the VAT ID. |
430
|
|
|
* |
431
|
|
|
* @return string |
432
|
|
|
*/ |
433
|
|
|
public function getVatId() |
434
|
|
|
{ |
435
|
|
|
return $this->vatId; |
436
|
|
|
} |
437
|
|
|
|
438
|
|
|
/** |
439
|
|
|
* Set the VAT ID. |
440
|
|
|
* |
441
|
|
|
* @param string $vatId The VAT ID. |
442
|
|
|
* @return CustomerQueryParams |
443
|
|
|
*/ |
444
|
|
|
public function setVatId($vatId) |
445
|
|
|
{ |
446
|
|
|
$this->vatId = $vatId; |
447
|
|
|
|
448
|
|
|
return $this; |
449
|
|
|
} |
450
|
|
|
|
451
|
|
|
/** |
452
|
|
|
* Get the zip code. |
453
|
|
|
* |
454
|
|
|
* @return string |
455
|
|
|
*/ |
456
|
|
|
public function getZipCode() |
457
|
|
|
{ |
458
|
|
|
return $this->zipCode; |
459
|
|
|
} |
460
|
|
|
|
461
|
|
|
/** |
462
|
|
|
* Set the zip code. |
463
|
|
|
* |
464
|
|
|
* @param string $zipCode The zip code. |
465
|
|
|
* @return CustomerQueryParams |
466
|
|
|
*/ |
467
|
|
|
public function setZipCode($zipCode) |
468
|
|
|
{ |
469
|
|
|
$this->zipCode = $zipCode; |
470
|
|
|
|
471
|
|
|
return $this; |
472
|
|
|
} |
473
|
|
|
|
474
|
|
|
private function toArray() |
475
|
|
|
{ |
476
|
|
|
return [ |
477
|
|
|
'address_line1' => $this->address, |
478
|
|
|
'affiliate' => $this->affiliate, |
479
|
|
|
'city' => $this->city, |
480
|
|
|
'company' => $this->companyName, |
481
|
|
|
'country' => $this->countryCode, |
482
|
|
|
'customer_ext_uid' => $this->customerExternalUid, |
483
|
|
|
'email' => $this->email, |
484
|
|
|
'first-name' => $this->firstName, |
485
|
|
|
'lang' => $this->languageCode, |
486
|
|
|
'last-name' => $this->lastName, |
487
|
|
|
"salutation" => $this->salutation, |
488
|
|
|
'title_academic' => $this->titleAcademic, |
489
|
|
|
'vatid' => $this->vatId, |
490
|
|
|
'postal-code' => $this->zipCode |
491
|
|
|
]; |
492
|
|
|
} |
493
|
|
|
|
494
|
|
|
public function __toString() |
495
|
|
|
{ |
496
|
|
|
$query = \http_build_query($this->toArray(), null, '&'); |
497
|
|
|
if ('' !== $query) { |
498
|
|
|
$query = '&' . $query; |
499
|
|
|
} |
500
|
|
|
|
501
|
|
|
return $query; |
502
|
|
|
} |
503
|
|
|
} |
504
|
|
|
|