1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* This file is part of the FreshSinchBundle |
4
|
|
|
* |
5
|
|
|
* (c) Artem Genvald <[email protected]> |
6
|
|
|
* |
7
|
|
|
* For the full copyright and license information, please view the LICENSE |
8
|
|
|
* file that was distributed with this source code. |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
namespace Fresh\SinchBundle\Model; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* CallbackRequest. |
15
|
|
|
* |
16
|
|
|
* @author Artem Genvald <[email protected]> |
17
|
|
|
* |
18
|
|
|
* @link https://www.sinch.com/docs/sms/#incomingsms |
19
|
|
|
*/ |
20
|
|
|
class CallbackRequest |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* @var string $event Event |
24
|
|
|
*/ |
25
|
|
|
private $event; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @var Identity $to To |
29
|
|
|
*/ |
30
|
|
|
private $to; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @var Identity $from From |
34
|
|
|
*/ |
35
|
|
|
private $from; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @var string $message Message |
39
|
|
|
*/ |
40
|
|
|
private $message; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @var \DateTime $timestamp Timestamp |
44
|
|
|
*/ |
45
|
|
|
private $timestamp; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @var int $version Version |
49
|
|
|
*/ |
50
|
|
|
private $version; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Get event. |
54
|
|
|
* |
55
|
|
|
* @return string Event |
56
|
|
|
*/ |
57
|
|
|
public function getEvent() |
58
|
|
|
{ |
59
|
|
|
return $this->event; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* Set event. |
64
|
|
|
* |
65
|
|
|
* @param string $event Event |
66
|
|
|
* |
67
|
|
|
* @return $this |
68
|
|
|
*/ |
69
|
|
|
public function setEvent($event) |
70
|
|
|
{ |
71
|
|
|
$this->event = $event; |
72
|
|
|
|
73
|
|
|
return $this; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* Get to. |
78
|
|
|
* |
79
|
|
|
* @return Identity To |
80
|
|
|
*/ |
81
|
|
|
public function getTo() |
82
|
|
|
{ |
83
|
|
|
return $this->to; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* Set to. |
88
|
|
|
* |
89
|
|
|
* @param Identity $to To |
90
|
|
|
* |
91
|
|
|
* @return $this |
92
|
|
|
*/ |
93
|
|
|
public function setTo(Identity $to) |
94
|
|
|
{ |
95
|
|
|
$this->to = $to; |
96
|
|
|
|
97
|
|
|
return $this; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* Get from. |
102
|
|
|
* |
103
|
|
|
* @return Identity From |
104
|
|
|
*/ |
105
|
|
|
public function getFrom() |
106
|
|
|
{ |
107
|
|
|
return $this->from; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* Set from. |
112
|
|
|
* |
113
|
|
|
* @param Identity $from From |
114
|
|
|
* |
115
|
|
|
* @return $this |
116
|
|
|
*/ |
117
|
|
|
public function setFrom(Identity $from) |
118
|
|
|
{ |
119
|
|
|
$this->from = $from; |
120
|
|
|
|
121
|
|
|
return $this; |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* Get message. |
126
|
|
|
* |
127
|
|
|
* @return string Message |
128
|
|
|
*/ |
129
|
|
|
public function getMessage() |
130
|
|
|
{ |
131
|
|
|
return $this->message; |
132
|
|
|
} |
133
|
|
|
|
134
|
|
|
/** |
135
|
|
|
* Set message. |
136
|
|
|
* |
137
|
|
|
* @param string $message Message |
138
|
|
|
* |
139
|
|
|
* @return $this |
140
|
|
|
*/ |
141
|
|
|
public function setMessage($message) |
142
|
|
|
{ |
143
|
|
|
$this->message = $message; |
144
|
|
|
|
145
|
|
|
return $this; |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
/** |
149
|
|
|
* Get timestamp. |
150
|
|
|
* |
151
|
|
|
* @return \DateTime Timestamp |
152
|
|
|
*/ |
153
|
|
|
public function getTimestamp() |
154
|
|
|
{ |
155
|
|
|
return $this->timestamp; |
156
|
|
|
} |
157
|
|
|
|
158
|
|
|
/** |
159
|
|
|
* Set timestamp. |
160
|
|
|
* |
161
|
|
|
* @param \DateTime $timestamp Timestamp |
162
|
|
|
* |
163
|
|
|
* @return $this |
164
|
|
|
*/ |
165
|
|
|
public function setTimestamp(\DateTime $timestamp) |
166
|
|
|
{ |
167
|
|
|
$this->timestamp = $timestamp; |
168
|
|
|
|
169
|
|
|
return $this; |
170
|
|
|
} |
171
|
|
|
|
172
|
|
|
/** |
173
|
|
|
* Get version. |
174
|
|
|
* |
175
|
|
|
* @return int Version |
176
|
|
|
*/ |
177
|
|
|
public function getVersion() |
178
|
|
|
{ |
179
|
|
|
return $this->version; |
180
|
|
|
} |
181
|
|
|
|
182
|
|
|
/** |
183
|
|
|
* Set version. |
184
|
|
|
* |
185
|
|
|
* @param int $version Version |
186
|
|
|
* |
187
|
|
|
* @return $this |
188
|
|
|
*/ |
189
|
|
|
public function setVersion($version) |
190
|
|
|
{ |
191
|
|
|
$this->version = $version; |
192
|
|
|
|
193
|
|
|
return $this; |
194
|
|
|
} |
195
|
|
|
} |
196
|
|
|
|