1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace DalliSDK\Requests; |
6
|
|
|
|
7
|
|
|
use DalliSDK\Responses\PointResponse; |
8
|
|
|
use JMS\Serializer\Annotation as JMS; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Запрос списка ПВЗ |
12
|
|
|
* |
13
|
|
|
* @see https://api.dalli-service.com/v1/doc/pointsInfo |
14
|
|
|
* @JMS\XmlRoot("pointsInfo") |
15
|
|
|
*/ |
16
|
|
|
class PointRequest extends AbstractRequest implements RequestInterface |
17
|
|
|
{ |
18
|
|
|
public const RESPONSE_CLASS = PointResponse::class; |
19
|
|
|
private ?string $partner = null; |
20
|
|
|
private ?string $fias = null; |
21
|
|
|
private ?string $settlement = null; |
22
|
|
|
private ?string $town = null; |
23
|
|
|
private ?string $zipcode = null; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @param string|null $town |
27
|
|
|
* @param string|null $partner |
28
|
|
|
* @param string|null $settlement |
29
|
|
|
* @param string|null $fias |
30
|
|
|
* @param string|null $zipcode |
31
|
|
|
*/ |
32
|
1 |
|
public function __construct(?string $town = null, ?string $partner = null, ?string $settlement = null, ?string $fias = null, ?string $zipcode = null) |
33
|
|
|
{ |
34
|
1 |
|
$this->town = $town; |
35
|
1 |
|
$this->partner = $partner; |
36
|
1 |
|
$this->settlement = $settlement; |
37
|
1 |
|
$this->fias = $fias; |
38
|
1 |
|
$this->zipcode = $zipcode; |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @return string|null |
43
|
|
|
*/ |
44
|
1 |
|
public function getTown(): ?string |
45
|
|
|
{ |
46
|
1 |
|
return $this->town; |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @param string|null $town |
51
|
|
|
* |
52
|
|
|
* @return PointRequest |
53
|
|
|
*/ |
54
|
1 |
|
public function setTown(?string $town): PointRequest |
55
|
|
|
{ |
56
|
1 |
|
$this->town = $town; |
57
|
1 |
|
return $this; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @return string|null |
62
|
|
|
*/ |
63
|
1 |
|
public function getPartner(): ?string |
64
|
|
|
{ |
65
|
1 |
|
return $this->partner; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @param string|null $partner |
70
|
|
|
* |
71
|
|
|
* @return PointRequest |
72
|
|
|
*/ |
73
|
1 |
|
public function setPartner(?string $partner): PointRequest |
74
|
|
|
{ |
75
|
|
|
//todo add enums validation |
76
|
1 |
|
$this->partner = $partner; |
77
|
1 |
|
return $this; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @return string|null |
82
|
|
|
*/ |
83
|
1 |
|
public function getSettlement(): ?string |
84
|
|
|
{ |
85
|
1 |
|
return $this->settlement; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @param string|null $settlement |
90
|
|
|
* |
91
|
|
|
* @return PointRequest |
92
|
|
|
*/ |
93
|
1 |
|
public function setSettlement(?string $settlement): PointRequest |
94
|
|
|
{ |
95
|
1 |
|
$this->settlement = $settlement; |
96
|
1 |
|
return $this; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @return string|null |
101
|
|
|
*/ |
102
|
1 |
|
public function getFias(): ?string |
103
|
|
|
{ |
104
|
1 |
|
return $this->fias; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* @param string|null $fias |
109
|
|
|
* |
110
|
|
|
* @return PointRequest |
111
|
|
|
*/ |
112
|
1 |
|
public function setFias(?string $fias): PointRequest |
113
|
|
|
{ |
114
|
1 |
|
$this->fias = $fias; |
115
|
1 |
|
return $this; |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
/** |
119
|
|
|
* @return string|null |
120
|
|
|
*/ |
121
|
1 |
|
public function getZipcode(): ?string |
122
|
|
|
{ |
123
|
1 |
|
return $this->zipcode; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
/** |
127
|
|
|
* @param string|null $zipcode |
128
|
|
|
* |
129
|
|
|
* @return PointRequest |
130
|
|
|
*/ |
131
|
1 |
|
public function setZipcode(?string $zipcode): PointRequest |
132
|
|
|
{ |
133
|
1 |
|
$this->zipcode = $zipcode; |
134
|
1 |
|
return $this; |
135
|
|
|
} |
136
|
|
|
} |
137
|
|
|
|