@@ -10,87 +10,87 @@ |
||
10 | 10 | */ |
11 | 11 | class AddressManifest extends \Route4Me\Common |
12 | 12 | { |
13 | - /** How much time is to be spent on service from the start in seconds. |
|
14 | - * @var integer $running_service_time |
|
15 | - */ |
|
16 | - public $running_service_time; |
|
17 | - |
|
18 | - /** How much time is spent driving from the start in seconds. |
|
19 | - * @var integer $running_travel_time |
|
20 | - */ |
|
21 | - public $running_travel_time; |
|
22 | - |
|
23 | - /** Running wait time. |
|
24 | - * @var integer $running_wait_time |
|
25 | - */ |
|
26 | - public $running_wait_time; |
|
27 | - |
|
28 | - /** Distance traversed before reaching this address. |
|
29 | - * @var double $running_distance |
|
30 | - */ |
|
31 | - public $running_distance; |
|
32 | - |
|
33 | - /** Expected fuel consumption from the start. |
|
34 | - * @var double $fuel_from_start |
|
35 | - */ |
|
36 | - public $fuel_from_start; |
|
37 | - |
|
38 | - /** Expected fuel cost from start. |
|
39 | - * @var double $fuel_cost_from_start |
|
40 | - */ |
|
41 | - public $fuel_cost_from_start; |
|
42 | - |
|
43 | - /** Projected arrival time UTC unixtime. |
|
44 | - * @var integer $projected_arrival_time_ts |
|
45 | - */ |
|
46 | - public $projected_arrival_time_ts; |
|
47 | - |
|
48 | - /** Estimated departure time UTC unixtime. |
|
49 | - * @var integer $projected_departure_time_ts |
|
50 | - */ |
|
51 | - public $projected_departure_time_ts; |
|
52 | - |
|
53 | - /** Time when the address was marked as visited UTC unixtime. |
|
54 | - * This is actually equal to timestamp_last_visited most of the time. |
|
55 | - * @var integer $actual_arrival_time_ts |
|
56 | - */ |
|
57 | - public $actual_arrival_time_ts; |
|
58 | - |
|
59 | - /** Time when the address was marked as departed UTC. |
|
60 | - * This is actually equal to timestamp_last_departed most of the time. |
|
61 | - * @var integer $actual_departure_time_ts |
|
62 | - */ |
|
63 | - public $actual_departure_time_ts; |
|
64 | - |
|
65 | - /** Estimated arrival time based on the current route progress, |
|
66 | - * i.e. based on the last known actual_arrival_time. |
|
67 | - * @var integer $estimated_arrival_time_ts |
|
68 | - */ |
|
69 | - public $estimated_arrival_time_ts; |
|
70 | - |
|
71 | - /** Estimated departure time based on the current route progress. |
|
72 | - * @var integer $estimated_departure_time_ts |
|
73 | - */ |
|
74 | - public $estimated_departure_time_ts; |
|
75 | - |
|
76 | - /** Scheduled arrival time. |
|
77 | - * @var integer $scheduled_arrival_time_ts |
|
78 | - */ |
|
79 | - public $scheduled_arrival_time_ts; |
|
80 | - |
|
81 | - /** Scheduled departure time. |
|
82 | - * @var integer $scheduled_departure_time_ts |
|
83 | - */ |
|
84 | - public $scheduled_departure_time_ts; |
|
85 | - |
|
86 | - /** This is the difference between the originally projected arrival time and Actual Arrival Time. |
|
87 | - * @var integer $time_impact |
|
88 | - */ |
|
89 | - public $time_impact; |
|
90 | - |
|
91 | - /** Distance traversed before reaching this address. |
|
92 | - * @var double $udu_running_distance |
|
93 | - */ |
|
94 | - public $udu_running_distance; |
|
13 | + /** How much time is to be spent on service from the start in seconds. |
|
14 | + * @var integer $running_service_time |
|
15 | + */ |
|
16 | + public $running_service_time; |
|
17 | + |
|
18 | + /** How much time is spent driving from the start in seconds. |
|
19 | + * @var integer $running_travel_time |
|
20 | + */ |
|
21 | + public $running_travel_time; |
|
22 | + |
|
23 | + /** Running wait time. |
|
24 | + * @var integer $running_wait_time |
|
25 | + */ |
|
26 | + public $running_wait_time; |
|
27 | + |
|
28 | + /** Distance traversed before reaching this address. |
|
29 | + * @var double $running_distance |
|
30 | + */ |
|
31 | + public $running_distance; |
|
32 | + |
|
33 | + /** Expected fuel consumption from the start. |
|
34 | + * @var double $fuel_from_start |
|
35 | + */ |
|
36 | + public $fuel_from_start; |
|
37 | + |
|
38 | + /** Expected fuel cost from start. |
|
39 | + * @var double $fuel_cost_from_start |
|
40 | + */ |
|
41 | + public $fuel_cost_from_start; |
|
42 | + |
|
43 | + /** Projected arrival time UTC unixtime. |
|
44 | + * @var integer $projected_arrival_time_ts |
|
45 | + */ |
|
46 | + public $projected_arrival_time_ts; |
|
47 | + |
|
48 | + /** Estimated departure time UTC unixtime. |
|
49 | + * @var integer $projected_departure_time_ts |
|
50 | + */ |
|
51 | + public $projected_departure_time_ts; |
|
52 | + |
|
53 | + /** Time when the address was marked as visited UTC unixtime. |
|
54 | + * This is actually equal to timestamp_last_visited most of the time. |
|
55 | + * @var integer $actual_arrival_time_ts |
|
56 | + */ |
|
57 | + public $actual_arrival_time_ts; |
|
58 | + |
|
59 | + /** Time when the address was marked as departed UTC. |
|
60 | + * This is actually equal to timestamp_last_departed most of the time. |
|
61 | + * @var integer $actual_departure_time_ts |
|
62 | + */ |
|
63 | + public $actual_departure_time_ts; |
|
64 | + |
|
65 | + /** Estimated arrival time based on the current route progress, |
|
66 | + * i.e. based on the last known actual_arrival_time. |
|
67 | + * @var integer $estimated_arrival_time_ts |
|
68 | + */ |
|
69 | + public $estimated_arrival_time_ts; |
|
70 | + |
|
71 | + /** Estimated departure time based on the current route progress. |
|
72 | + * @var integer $estimated_departure_time_ts |
|
73 | + */ |
|
74 | + public $estimated_departure_time_ts; |
|
75 | + |
|
76 | + /** Scheduled arrival time. |
|
77 | + * @var integer $scheduled_arrival_time_ts |
|
78 | + */ |
|
79 | + public $scheduled_arrival_time_ts; |
|
80 | + |
|
81 | + /** Scheduled departure time. |
|
82 | + * @var integer $scheduled_departure_time_ts |
|
83 | + */ |
|
84 | + public $scheduled_departure_time_ts; |
|
85 | + |
|
86 | + /** This is the difference between the originally projected arrival time and Actual Arrival Time. |
|
87 | + * @var integer $time_impact |
|
88 | + */ |
|
89 | + public $time_impact; |
|
90 | + |
|
91 | + /** Distance traversed before reaching this address. |
|
92 | + * @var double $udu_running_distance |
|
93 | + */ |
|
94 | + public $udu_running_distance; |
|
95 | 95 | |
96 | 96 | } |
97 | 97 | \ No newline at end of file |
@@ -10,13 +10,13 @@ |
||
10 | 10 | */ |
11 | 11 | class GeoPoint extends \Route4Me\Common |
12 | 12 | { |
13 | - /** Latitude |
|
14 | - * @var double $lat |
|
15 | - */ |
|
16 | - public $lat; |
|
13 | + /** Latitude |
|
14 | + * @var double $lat |
|
15 | + */ |
|
16 | + public $lat; |
|
17 | 17 | |
18 | - /** Longitude |
|
19 | - * @var double $lng |
|
20 | - */ |
|
21 | - public $lng; |
|
18 | + /** Longitude |
|
19 | + * @var double $lng |
|
20 | + */ |
|
21 | + public $lng; |
|
22 | 22 | } |
23 | 23 | \ No newline at end of file |
@@ -11,21 +11,21 @@ |
||
11 | 11 | */ |
12 | 12 | class OverrideAddresses |
13 | 13 | { |
14 | - /** |
|
15 | - * The service time specified or all the addresses in the route. |
|
16 | - * @var long |
|
17 | - */ |
|
18 | - public $time; |
|
14 | + /** |
|
15 | + * The service time specified or all the addresses in the route. |
|
16 | + * @var long |
|
17 | + */ |
|
18 | + public $time; |
|
19 | 19 | |
20 | - /** |
|
21 | - * Route address stop type |
|
22 | - * @var string |
|
23 | - */ |
|
24 | - public $address_stop_type; |
|
20 | + /** |
|
21 | + * Route address stop type |
|
22 | + * @var string |
|
23 | + */ |
|
24 | + public $address_stop_type; |
|
25 | 25 | |
26 | - /** |
|
27 | - * The address group |
|
28 | - * @var string |
|
29 | - */ |
|
30 | - public $group; |
|
26 | + /** |
|
27 | + * The address group |
|
28 | + * @var string |
|
29 | + */ |
|
30 | + public $group; |
|
31 | 31 | } |
32 | 32 | \ No newline at end of file |
@@ -14,668 +14,668 @@ |
||
14 | 14 | */ |
15 | 15 | class Address extends \Route4Me\Common |
16 | 16 | { |
17 | - /** |
|
18 | - * Route destination ID |
|
19 | - * @var integer |
|
20 | - */ |
|
21 | - public $route_destination_id; |
|
22 | - |
|
23 | - /** |
|
24 | - * Route alias |
|
25 | - * @var string |
|
26 | - */ |
|
27 | - public $alias; |
|
28 | - |
|
29 | - /** |
|
30 | - * The ID of the member inside the Route4Me system. |
|
31 | - * @var integer |
|
32 | - */ |
|
33 | - public $member_id; |
|
34 | - |
|
35 | - /** |
|
36 | - * Route destination address |
|
37 | - * @var string |
|
38 | - */ |
|
39 | - public $address; |
|
40 | - |
|
41 | - /** |
|
42 | - * Designate this stop as a depot. |
|
43 | - * A route may have multiple depots/points of origin. |
|
44 | - * @var boolean |
|
45 | - */ |
|
46 | - public $is_depot; |
|
47 | - |
|
48 | - /** |
|
49 | - * Timeframe violation state |
|
50 | - * @var integer |
|
51 | - */ |
|
52 | - public $timeframe_violation_state; |
|
53 | - |
|
54 | - /** |
|
55 | - * Timeframe violation time |
|
56 | - * @var integer |
|
57 | - */ |
|
58 | - public $timeframe_violation_time; |
|
59 | - |
|
60 | - /** |
|
61 | - * Timeframe violation rate |
|
62 | - * @var double |
|
63 | - */ |
|
64 | - public $timeframe_violation_rate; |
|
65 | - |
|
66 | - /** |
|
67 | - * The latitude of this address |
|
68 | - * @var double |
|
69 | - */ |
|
70 | - public $lat; |
|
71 | - |
|
72 | - /** |
|
73 | - * The longitude of this address |
|
74 | - * @var double |
|
75 | - */ |
|
76 | - public $lng; |
|
77 | - |
|
78 | - /** |
|
79 | - * Curbside latitude. |
|
80 | - * Generate optimal routes and driving directions to this curbside latitude. |
|
81 | - * @var double |
|
82 | - */ |
|
83 | - public $curbside_lat; |
|
84 | - |
|
85 | - /** |
|
86 | - * Curbside longitude. |
|
87 | - * Generate optimal routes and driving directions to the curbside longitude. |
|
88 | - * @var double |
|
89 | - */ |
|
90 | - public $curbside_lng; |
|
91 | - |
|
92 | - /** |
|
93 | - * If present, the priority will sequence addresses in all the optimal routes so that |
|
94 | - * higher priority addresses are general at the beginning of the route sequence. |
|
95 | - * 1 is the highest priority, 100000 is the lowest. |
|
96 | - * @var integer |
|
97 | - */ |
|
98 | - public $priority; |
|
99 | - |
|
100 | - /** |
|
101 | - * The ID of the route being viewed, modified, or erased. |
|
102 | - * @var string |
|
103 | - */ |
|
104 | - public $route_id; |
|
105 | - |
|
106 | - /** |
|
107 | - * If this route was duplicated from an existing route, |
|
108 | - * this value would have the original route's ID. |
|
109 | - * @var string |
|
110 | - */ |
|
111 | - public $original_route_id; |
|
112 | - |
|
113 | - /** |
|
114 | - * Route name of a depot address. |
|
115 | - * @var string |
|
116 | - */ |
|
117 | - public $route_name; |
|
118 | - |
|
119 | - /** |
|
120 | - * The ID of the optimization request that was used to initially instantiate this route. |
|
121 | - * @var string |
|
122 | - */ |
|
123 | - public $optimization_problem_id; |
|
124 | - |
|
125 | - /** |
|
126 | - * The destination's sequence number in the route. |
|
127 | - * @var integer |
|
128 | - */ |
|
129 | - public $sequence_no; |
|
130 | - |
|
131 | - /** |
|
132 | - * True if the address is geocoded. |
|
133 | - * @var boolean |
|
134 | - */ |
|
135 | - public $geocoded; |
|
136 | - |
|
137 | - /** |
|
138 | - * The preferred geocoding number. |
|
139 | - * @var integer |
|
140 | - */ |
|
141 | - public $preferred_geocoding; |
|
142 | - |
|
143 | - /** |
|
144 | - * True if geocoding failed. |
|
145 | - * @var boolean |
|
146 | - */ |
|
147 | - public $failed_geocoding; |
|
148 | - |
|
149 | - /** |
|
150 | - * An array containing Geocoding objects. |
|
151 | - * @var Geocoding[] |
|
152 | - */ |
|
153 | - public $geocodings = []; |
|
154 | - |
|
155 | - /** |
|
156 | - * When planning a route from the address book or using existing address book IDs, |
|
157 | - * pass the address book ID (contact_id) for an address so that Route4Me can run |
|
158 | - * analytics on the address book addresses that were used to plan routes, and to find previous visits to |
|
159 | - * favorite addresses. |
|
160 | - * @var integer |
|
161 | - */ |
|
162 | - public $contact_id; |
|
163 | - |
|
164 | - /** |
|
165 | - * The address order ID |
|
166 | - * @var integer |
|
167 | - */ |
|
168 | - public $order_id; |
|
169 | - |
|
170 | - /** |
|
171 | - * Route address stop type |
|
172 | - * @var string |
|
173 | - */ |
|
174 | - public $address_stop_type; |
|
175 | - |
|
176 | - /** |
|
177 | - * The status flag to mark an address as visited (aka check in). |
|
178 | - * @var boolean |
|
179 | - */ |
|
180 | - public $is_visited; |
|
181 | - |
|
182 | - /** |
|
183 | - * The last known visited timestamp of this address. |
|
184 | - * @var integer |
|
185 | - */ |
|
186 | - public $timestamp_last_visited; |
|
187 | - |
|
188 | - /** |
|
189 | - * Latitude of the visited address |
|
190 | - * @var double |
|
191 | - */ |
|
192 | - public $visited_lat; |
|
193 | - |
|
194 | - /** |
|
195 | - * Longitude of the visited address |
|
196 | - * @var double |
|
197 | - */ |
|
198 | - public $visited_lng; |
|
199 | - |
|
200 | - /** |
|
201 | - * The status flag to mark an address as departed (aka check out). |
|
202 | - * @var boolean |
|
203 | - */ |
|
204 | - public $is_departed; |
|
205 | - |
|
206 | - /** |
|
207 | - * Departed address latitude |
|
208 | - * @var double |
|
209 | - */ |
|
210 | - public $departed_lat; |
|
211 | - |
|
212 | - /** Departed address longitude |
|
213 | - * @var double |
|
214 | - */ |
|
215 | - public $departed_lng; |
|
216 | - |
|
217 | - /** |
|
218 | - * he last known departed timestamp of this address. |
|
219 | - * @var integer |
|
220 | - */ |
|
221 | - public $timestamp_last_departed; |
|
222 | - |
|
223 | - /** |
|
224 | - * The address group |
|
225 | - * @var string |
|
226 | - */ |
|
227 | - public $group; |
|
228 | - |
|
229 | - /** |
|
230 | - * Pass-through data about this route destination.<br> |
|
231 | - * The data will be visible on the manifest, website, and mobile apps. |
|
232 | - * @var string |
|
233 | - */ |
|
234 | - public $customer_po; |
|
235 | - |
|
236 | - /** |
|
237 | - * Pass-through data about this route destination.<br> |
|
238 | - * The data will be visible on the manifest, website, and mobile apps. |
|
239 | - * @var string |
|
240 | - */ |
|
241 | - public $invoice_no; |
|
242 | - |
|
243 | - /** |
|
244 | - * Pass-through data about this route destination.<br> |
|
245 | - * The data will be visible on the manifest, website, and mobile apps. |
|
246 | - * @var string |
|
247 | - */ |
|
248 | - public $reference_no; |
|
249 | - |
|
250 | - /** |
|
251 | - * Pass-through data about this route destination.<br> |
|
252 | - * The data will be visible on the manifest, website, and mobile apps. |
|
253 | - * @var string |
|
254 | - */ |
|
255 | - public $order_no; |
|
256 | - |
|
257 | - /** |
|
258 | - * The address cargo weight |
|
259 | - * @var double |
|
260 | - */ |
|
261 | - public $weight; |
|
262 | - |
|
263 | - /** |
|
264 | - * The address cost |
|
265 | - * @var double |
|
266 | - */ |
|
267 | - public $cost; |
|
268 | - |
|
269 | - /** |
|
270 | - * The address revenue |
|
271 | - * @var double |
|
272 | - */ |
|
273 | - public $revenue; |
|
274 | - |
|
275 | - /** |
|
276 | - * The cubic volume that this destination/order/line-item consumes/contains.<br> |
|
277 | - * This is how much space it will take up on a vehicle. |
|
278 | - * @var double |
|
279 | - */ |
|
280 | - public $cube; |
|
281 | - |
|
282 | - /** |
|
283 | - * The number of pieces/palllets that this destination/order/line-item consumes/contains on a vehicle. |
|
284 | - * @var integer |
|
285 | - */ |
|
286 | - public $pieces; |
|
287 | - |
|
288 | - /** |
|
289 | - * First name |
|
290 | - * @var string |
|
291 | - */ |
|
292 | - public $first_name; |
|
293 | - |
|
294 | - /** |
|
295 | - * Last name |
|
296 | - * @var string |
|
297 | - */ |
|
298 | - public $last_name; |
|
299 | - |
|
300 | - /** |
|
301 | - * Pass-through data about this route destination. |
|
302 | - * The data will be visible on the manifest, website, and mobile apps. |
|
303 | - * Also used to email clients when vehicles are approaching (future capability). |
|
304 | - * @var string |
|
305 | - */ |
|
306 | - public $email; |
|
307 | - |
|
308 | - /** |
|
309 | - * Pass-through data about this route destination. |
|
310 | - * The data will be visible on the manifest, website, and mobile apps. |
|
311 | - * Also used to send SMS messages to clients when vehicles are approaching (future capability). |
|
312 | - * @var string |
|
313 | - */ |
|
314 | - public $phone; |
|
315 | - |
|
316 | - /** |
|
317 | - * The number of notes that are already associated with this address on the route. |
|
318 | - * @var integer |
|
319 | - */ |
|
320 | - public $destination_note_count; |
|
321 | - |
|
322 | - /** |
|
323 | - * Server-side generated amount of km/miles that |
|
324 | - * it will take to get to the next location on the route. |
|
325 | - * @var integer |
|
326 | - */ |
|
327 | - public $drive_time_to_next_destination; |
|
328 | - |
|
329 | - /** |
|
330 | - * Abnormal traffic time to next destination. |
|
331 | - * @var integer |
|
332 | - */ |
|
333 | - public $abnormal_traffic_time_to_next_destination; |
|
334 | - |
|
335 | - /** |
|
336 | - * Uncongested time to next destination. |
|
337 | - * @var integer |
|
338 | - */ |
|
339 | - public $uncongested_time_to_next_destination; |
|
340 | - |
|
341 | - /** |
|
342 | - * Traffic time to next destination. |
|
343 | - * @var integer |
|
344 | - */ |
|
345 | - public $traffic_time_to_next_destination; |
|
346 | - |
|
347 | - /** |
|
348 | - * Server-side generated amount of seconds |
|
349 | - * that it will take to get to the next location. |
|
350 | - * @var double |
|
351 | - */ |
|
352 | - public $distance_to_next_destination; |
|
353 | - |
|
354 | - /** |
|
355 | - * The unique socket channel name which |
|
356 | - * should be used to get real time alerts. |
|
357 | - * @var string |
|
358 | - */ |
|
359 | - public $channel_name; |
|
360 | - |
|
361 | - /** |
|
362 | - * Alias of a pickup point. |
|
363 | - * @var string |
|
364 | - */ |
|
365 | - public $pickup; |
|
366 | - |
|
367 | - /** |
|
368 | - * Alias of the paired pickup point. |
|
369 | - * @var string |
|
370 | - */ |
|
371 | - public $dropoff; |
|
372 | - |
|
373 | - /** |
|
374 | - * If equal to 1, the pickup and dropoff addresses are joint |
|
375 | - * (one by one despite the regular pickup-dropoff addresses |
|
376 | - * when it's possible to have multiple pickup addresses with one dropoff address). |
|
377 | - * @var integer |
|
378 | - */ |
|
379 | - public $joint; |
|
380 | - |
|
381 | - /** |
|
382 | - * Generated time window start. |
|
383 | - * @var integer |
|
384 | - */ |
|
385 | - public $generated_time_window_start; |
|
386 | - |
|
387 | - /** |
|
388 | - * Estimated time window end based on the optimization engine, |
|
389 | - * after all the sequencing has been completed. |
|
390 | - * @var integer |
|
391 | - */ |
|
392 | - public $generated_time_window_end; |
|
393 | - |
|
394 | - /** |
|
395 | - * The address time window start. |
|
396 | - * @var integer |
|
397 | - */ |
|
398 | - public $time_window_start; |
|
399 | - |
|
400 | - /** |
|
401 | - * The address time window end. |
|
402 | - * @var integer |
|
403 | - */ |
|
404 | - public $time_window_end; |
|
405 | - |
|
406 | - /** |
|
407 | - * The address time window start 2. |
|
408 | - * @var integer |
|
409 | - */ |
|
410 | - public $time_window_start_2; |
|
411 | - |
|
412 | - /** |
|
413 | - * The address time window end 2. |
|
414 | - * @var integer |
|
415 | - */ |
|
416 | - public $time_window_end_2; |
|
417 | - |
|
418 | - /** |
|
419 | - * Geofence detected visited timestamp |
|
420 | - * @var integer |
|
421 | - */ |
|
422 | - public $geofence_detected_visited_timestamp; |
|
423 | - |
|
424 | - /** |
|
425 | - * Geofence detected departed timestamp |
|
426 | - * @var integer |
|
427 | - */ |
|
428 | - public $geofence_detected_departed_timestamp; |
|
429 | - |
|
430 | - /** |
|
431 | - * Geofence detected service time |
|
432 | - * @var integer |
|
433 | - */ |
|
434 | - public $geofence_detected_service_time; |
|
435 | - |
|
436 | - /** |
|
437 | - * Geofence detected visited latitude |
|
438 | - * @var double |
|
439 | - */ |
|
440 | - public $geofence_detected_visited_lat; |
|
441 | - |
|
442 | - /** |
|
443 | - * Geofence detected visited longitude |
|
444 | - * @var double |
|
445 | - */ |
|
446 | - public $geofence_detected_visited_lng; |
|
447 | - |
|
448 | - /** |
|
449 | - * Geofence detected departed latitude |
|
450 | - * @var double |
|
451 | - */ |
|
452 | - public $geofence_detected_departed_lat; |
|
453 | - |
|
454 | - /** |
|
455 | - * Geofence detected departed longitude |
|
456 | - * @var double |
|
457 | - */ |
|
458 | - public $geofence_detected_departed_lng; |
|
459 | - |
|
460 | - /** |
|
461 | - * The expected amount of time that will be spent |
|
462 | - * at this address by the driver/user. |
|
463 | - * @var integer |
|
464 | - */ |
|
465 | - public $time; |
|
466 | - |
|
467 | - /** |
|
468 | - * System-wide unique code, which permits end-users (recipients) |
|
469 | - * to track the status of their order. |
|
470 | - * @var string |
|
471 | - */ |
|
472 | - public $tracking_number; |
|
473 | - |
|
474 | - /** |
|
475 | - * The address custom fields. |
|
476 | - * @var array |
|
477 | - */ |
|
478 | - public $custom_fields = []; |
|
479 | - |
|
480 | - /** |
|
481 | - * The custom fields configuration in JSON format. |
|
482 | - * @var string |
|
483 | - */ |
|
484 | - public $custom_fields_str_json; |
|
485 | - |
|
486 | - /** |
|
487 | - * The custom fields configuration. |
|
488 | - * @var string[] |
|
489 | - */ |
|
490 | - public $custom_fields_config = []; |
|
491 | - |
|
492 | - /** |
|
493 | - * The custom fields configuration in JSON format. |
|
494 | - * @var string |
|
495 | - */ |
|
496 | - public $custom_fields_config_str_json; |
|
497 | - |
|
498 | - /** |
|
499 | - * The address notes |
|
500 | - * @var AddressNote[] |
|
501 | - */ |
|
502 | - public $notes = []; |
|
503 | - |
|
504 | - /** |
|
505 | - * Bundle count |
|
506 | - * @var integer |
|
507 | - */ |
|
508 | - public $bundle_count; |
|
509 | - |
|
510 | - /** |
|
511 | - * Bundle items |
|
512 | - * @var BundledItemResponse[] |
|
513 | - */ |
|
514 | - public $bundle_items; |
|
515 | - |
|
516 | - /** |
|
517 | - * List of the order inventories |
|
518 | - * @var OrderInventory[] |
|
519 | - */ |
|
520 | - public $order_inventory; |
|
521 | - |
|
522 | - /** |
|
523 | - * UDU distance to next destination. |
|
524 | - * @var double |
|
525 | - */ |
|
526 | - public $udu_distance_to_next_destination; |
|
527 | - |
|
528 | - /** |
|
529 | - * Wait time to next destination. |
|
530 | - * @var integer |
|
531 | - */ |
|
532 | - public $wait_time_to_next_destination; |
|
533 | - |
|
534 | - /** |
|
535 | - * Manifest of a route address. |
|
536 | - * @var AddressManifest |
|
537 | - */ |
|
538 | - public $manifest; |
|
539 | - |
|
540 | - /** |
|
541 | - * An array of the required driver skills for the address. |
|
542 | - * @var array |
|
543 | - */ |
|
544 | - public $required_skills = []; |
|
545 | - |
|
546 | - public $additional_status; |
|
547 | - |
|
548 | - public function __construct() |
|
549 | - { |
|
550 | - // TO DO: replace with API 5 endpoint after finishing. |
|
551 | - Route4Me::setBaseUrl( Endpoint4::BASE_URL); |
|
552 | - } |
|
553 | - |
|
554 | - public static function fromArray(array $params) |
|
555 | - { |
|
556 | - $address = new self(); |
|
557 | - |
|
558 | - foreach ($params as $key => $value) { |
|
559 | - if (property_exists($address, $key)) { |
|
560 | - $address->{$key} = $value; |
|
561 | - } else { |
|
562 | - throw new BadParam("Correct parameter must be provided. Wrong Parameter: $key"); |
|
563 | - } |
|
564 | - } |
|
565 | - |
|
566 | - return $address; |
|
567 | - } |
|
568 | - |
|
569 | - public static function getAddress($routeId, $addressId) |
|
570 | - { |
|
571 | - $address = Route4Me::makeRequst([ |
|
572 | - 'url' => Endpoint4::ADDRESS_V4, |
|
573 | - 'method' => 'GET', |
|
574 | - 'query' => [ |
|
575 | - 'route_id' => $routeId, |
|
576 | - 'route_destination_id' => $addressId, |
|
577 | - ], |
|
578 | - ]); |
|
579 | - |
|
580 | - return self::fromArray($address); |
|
581 | - } |
|
582 | - |
|
583 | - public function update() |
|
584 | - { |
|
585 | - $addressUpdate = Route4Me::makeRequst([ |
|
586 | - 'url' => Endpoint4::ADDRESS_V4, |
|
587 | - 'method' => 'PUT', |
|
588 | - 'body' => $this->toArray(), |
|
589 | - 'query' => [ |
|
590 | - 'route_id' => $this->route_id, |
|
591 | - 'route_destination_id' => $this->route_destination_id, |
|
592 | - ], |
|
593 | - ]); |
|
594 | - |
|
595 | - return self::fromArray($addressUpdate); |
|
596 | - } |
|
597 | - |
|
598 | - /** |
|
599 | - * Marks an address as marked as visited/as departed |
|
600 | - * depending on which parameter is specified: 'is_visited' or 'is_departed'. |
|
601 | - */ |
|
602 | - public function markAddress($params) |
|
603 | - { |
|
604 | - $allQueryFields = ['route_id', 'route_destination_id']; |
|
605 | - $allBodyFields = ['is_visited', 'is_departed']; |
|
606 | - |
|
607 | - $result = Route4Me::makeRequst([ |
|
608 | - 'url' => Endpoint4::ADDRESS_V4, |
|
609 | - 'method' => 'PUT', |
|
610 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
611 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
612 | - ]); |
|
613 | - |
|
614 | - return $result; |
|
615 | - } |
|
616 | - |
|
617 | - /** |
|
618 | - * Marks an address as departed. |
|
619 | - */ |
|
620 | - public function markAsDeparted($params) |
|
621 | - { |
|
622 | - $allQueryFields = ['route_id', 'address_id', 'is_departed', 'member_id']; |
|
623 | - |
|
624 | - $address = Route4Me::makeRequst([ |
|
625 | - 'url' => Endpoint4::MARK_ADDRESS_DEPARTED, |
|
626 | - 'method' => 'PUT', |
|
627 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
628 | - ]); |
|
629 | - |
|
630 | - return $address; |
|
631 | - } |
|
632 | - |
|
633 | - /** |
|
634 | - * Marks an address as visited. |
|
635 | - */ |
|
636 | - public function markAsVisited($params) |
|
637 | - { |
|
638 | - $allQueryFields = ['route_id', 'address_id', 'is_visited', 'member_id']; |
|
639 | - |
|
640 | - $address = Route4Me::makeRequst([ |
|
641 | - 'url' => Endpoint4::UPDATE_ADDRESS_VISITED, |
|
642 | - 'method' => 'PUT', |
|
643 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
644 | - ]); |
|
645 | - |
|
646 | - return $address; |
|
647 | - } |
|
648 | - |
|
649 | - public function deleteAddress() |
|
650 | - { |
|
651 | - $address = Route4Me::makeRequst([ |
|
652 | - 'url' => Endpoint4::ADDRESS_V4, |
|
653 | - 'method' => 'DELETE', |
|
654 | - 'query' => [ |
|
655 | - 'route_id' => $this->route_id, |
|
656 | - 'route_destination_id' => $this->route_destination_id, |
|
657 | - ], |
|
658 | - ]); |
|
659 | - |
|
660 | - return (bool)$address['deleted']; |
|
661 | - } |
|
662 | - |
|
663 | - public function moveDestinationToRoute($params) |
|
664 | - { |
|
665 | - $allBodyFields = ['to_route_id', 'route_destination_id', 'after_destination_id']; |
|
666 | - |
|
667 | - $result = Route4Me::makeRequst([ |
|
668 | - 'url' => Endpoint4::MOVE_ROUTE_DESTINATION, |
|
669 | - 'method' => 'POST', |
|
670 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
671 | - 'HTTPHEADER' => 'Content-Type: multipart/form-data', |
|
672 | - ]); |
|
673 | - |
|
674 | - return $result; |
|
675 | - } |
|
676 | - |
|
677 | - public function getAddressId() |
|
678 | - { |
|
679 | - return $this->route_destination_id; |
|
680 | - } |
|
17 | + /** |
|
18 | + * Route destination ID |
|
19 | + * @var integer |
|
20 | + */ |
|
21 | + public $route_destination_id; |
|
22 | + |
|
23 | + /** |
|
24 | + * Route alias |
|
25 | + * @var string |
|
26 | + */ |
|
27 | + public $alias; |
|
28 | + |
|
29 | + /** |
|
30 | + * The ID of the member inside the Route4Me system. |
|
31 | + * @var integer |
|
32 | + */ |
|
33 | + public $member_id; |
|
34 | + |
|
35 | + /** |
|
36 | + * Route destination address |
|
37 | + * @var string |
|
38 | + */ |
|
39 | + public $address; |
|
40 | + |
|
41 | + /** |
|
42 | + * Designate this stop as a depot. |
|
43 | + * A route may have multiple depots/points of origin. |
|
44 | + * @var boolean |
|
45 | + */ |
|
46 | + public $is_depot; |
|
47 | + |
|
48 | + /** |
|
49 | + * Timeframe violation state |
|
50 | + * @var integer |
|
51 | + */ |
|
52 | + public $timeframe_violation_state; |
|
53 | + |
|
54 | + /** |
|
55 | + * Timeframe violation time |
|
56 | + * @var integer |
|
57 | + */ |
|
58 | + public $timeframe_violation_time; |
|
59 | + |
|
60 | + /** |
|
61 | + * Timeframe violation rate |
|
62 | + * @var double |
|
63 | + */ |
|
64 | + public $timeframe_violation_rate; |
|
65 | + |
|
66 | + /** |
|
67 | + * The latitude of this address |
|
68 | + * @var double |
|
69 | + */ |
|
70 | + public $lat; |
|
71 | + |
|
72 | + /** |
|
73 | + * The longitude of this address |
|
74 | + * @var double |
|
75 | + */ |
|
76 | + public $lng; |
|
77 | + |
|
78 | + /** |
|
79 | + * Curbside latitude. |
|
80 | + * Generate optimal routes and driving directions to this curbside latitude. |
|
81 | + * @var double |
|
82 | + */ |
|
83 | + public $curbside_lat; |
|
84 | + |
|
85 | + /** |
|
86 | + * Curbside longitude. |
|
87 | + * Generate optimal routes and driving directions to the curbside longitude. |
|
88 | + * @var double |
|
89 | + */ |
|
90 | + public $curbside_lng; |
|
91 | + |
|
92 | + /** |
|
93 | + * If present, the priority will sequence addresses in all the optimal routes so that |
|
94 | + * higher priority addresses are general at the beginning of the route sequence. |
|
95 | + * 1 is the highest priority, 100000 is the lowest. |
|
96 | + * @var integer |
|
97 | + */ |
|
98 | + public $priority; |
|
99 | + |
|
100 | + /** |
|
101 | + * The ID of the route being viewed, modified, or erased. |
|
102 | + * @var string |
|
103 | + */ |
|
104 | + public $route_id; |
|
105 | + |
|
106 | + /** |
|
107 | + * If this route was duplicated from an existing route, |
|
108 | + * this value would have the original route's ID. |
|
109 | + * @var string |
|
110 | + */ |
|
111 | + public $original_route_id; |
|
112 | + |
|
113 | + /** |
|
114 | + * Route name of a depot address. |
|
115 | + * @var string |
|
116 | + */ |
|
117 | + public $route_name; |
|
118 | + |
|
119 | + /** |
|
120 | + * The ID of the optimization request that was used to initially instantiate this route. |
|
121 | + * @var string |
|
122 | + */ |
|
123 | + public $optimization_problem_id; |
|
124 | + |
|
125 | + /** |
|
126 | + * The destination's sequence number in the route. |
|
127 | + * @var integer |
|
128 | + */ |
|
129 | + public $sequence_no; |
|
130 | + |
|
131 | + /** |
|
132 | + * True if the address is geocoded. |
|
133 | + * @var boolean |
|
134 | + */ |
|
135 | + public $geocoded; |
|
136 | + |
|
137 | + /** |
|
138 | + * The preferred geocoding number. |
|
139 | + * @var integer |
|
140 | + */ |
|
141 | + public $preferred_geocoding; |
|
142 | + |
|
143 | + /** |
|
144 | + * True if geocoding failed. |
|
145 | + * @var boolean |
|
146 | + */ |
|
147 | + public $failed_geocoding; |
|
148 | + |
|
149 | + /** |
|
150 | + * An array containing Geocoding objects. |
|
151 | + * @var Geocoding[] |
|
152 | + */ |
|
153 | + public $geocodings = []; |
|
154 | + |
|
155 | + /** |
|
156 | + * When planning a route from the address book or using existing address book IDs, |
|
157 | + * pass the address book ID (contact_id) for an address so that Route4Me can run |
|
158 | + * analytics on the address book addresses that were used to plan routes, and to find previous visits to |
|
159 | + * favorite addresses. |
|
160 | + * @var integer |
|
161 | + */ |
|
162 | + public $contact_id; |
|
163 | + |
|
164 | + /** |
|
165 | + * The address order ID |
|
166 | + * @var integer |
|
167 | + */ |
|
168 | + public $order_id; |
|
169 | + |
|
170 | + /** |
|
171 | + * Route address stop type |
|
172 | + * @var string |
|
173 | + */ |
|
174 | + public $address_stop_type; |
|
175 | + |
|
176 | + /** |
|
177 | + * The status flag to mark an address as visited (aka check in). |
|
178 | + * @var boolean |
|
179 | + */ |
|
180 | + public $is_visited; |
|
181 | + |
|
182 | + /** |
|
183 | + * The last known visited timestamp of this address. |
|
184 | + * @var integer |
|
185 | + */ |
|
186 | + public $timestamp_last_visited; |
|
187 | + |
|
188 | + /** |
|
189 | + * Latitude of the visited address |
|
190 | + * @var double |
|
191 | + */ |
|
192 | + public $visited_lat; |
|
193 | + |
|
194 | + /** |
|
195 | + * Longitude of the visited address |
|
196 | + * @var double |
|
197 | + */ |
|
198 | + public $visited_lng; |
|
199 | + |
|
200 | + /** |
|
201 | + * The status flag to mark an address as departed (aka check out). |
|
202 | + * @var boolean |
|
203 | + */ |
|
204 | + public $is_departed; |
|
205 | + |
|
206 | + /** |
|
207 | + * Departed address latitude |
|
208 | + * @var double |
|
209 | + */ |
|
210 | + public $departed_lat; |
|
211 | + |
|
212 | + /** Departed address longitude |
|
213 | + * @var double |
|
214 | + */ |
|
215 | + public $departed_lng; |
|
216 | + |
|
217 | + /** |
|
218 | + * he last known departed timestamp of this address. |
|
219 | + * @var integer |
|
220 | + */ |
|
221 | + public $timestamp_last_departed; |
|
222 | + |
|
223 | + /** |
|
224 | + * The address group |
|
225 | + * @var string |
|
226 | + */ |
|
227 | + public $group; |
|
228 | + |
|
229 | + /** |
|
230 | + * Pass-through data about this route destination.<br> |
|
231 | + * The data will be visible on the manifest, website, and mobile apps. |
|
232 | + * @var string |
|
233 | + */ |
|
234 | + public $customer_po; |
|
235 | + |
|
236 | + /** |
|
237 | + * Pass-through data about this route destination.<br> |
|
238 | + * The data will be visible on the manifest, website, and mobile apps. |
|
239 | + * @var string |
|
240 | + */ |
|
241 | + public $invoice_no; |
|
242 | + |
|
243 | + /** |
|
244 | + * Pass-through data about this route destination.<br> |
|
245 | + * The data will be visible on the manifest, website, and mobile apps. |
|
246 | + * @var string |
|
247 | + */ |
|
248 | + public $reference_no; |
|
249 | + |
|
250 | + /** |
|
251 | + * Pass-through data about this route destination.<br> |
|
252 | + * The data will be visible on the manifest, website, and mobile apps. |
|
253 | + * @var string |
|
254 | + */ |
|
255 | + public $order_no; |
|
256 | + |
|
257 | + /** |
|
258 | + * The address cargo weight |
|
259 | + * @var double |
|
260 | + */ |
|
261 | + public $weight; |
|
262 | + |
|
263 | + /** |
|
264 | + * The address cost |
|
265 | + * @var double |
|
266 | + */ |
|
267 | + public $cost; |
|
268 | + |
|
269 | + /** |
|
270 | + * The address revenue |
|
271 | + * @var double |
|
272 | + */ |
|
273 | + public $revenue; |
|
274 | + |
|
275 | + /** |
|
276 | + * The cubic volume that this destination/order/line-item consumes/contains.<br> |
|
277 | + * This is how much space it will take up on a vehicle. |
|
278 | + * @var double |
|
279 | + */ |
|
280 | + public $cube; |
|
281 | + |
|
282 | + /** |
|
283 | + * The number of pieces/palllets that this destination/order/line-item consumes/contains on a vehicle. |
|
284 | + * @var integer |
|
285 | + */ |
|
286 | + public $pieces; |
|
287 | + |
|
288 | + /** |
|
289 | + * First name |
|
290 | + * @var string |
|
291 | + */ |
|
292 | + public $first_name; |
|
293 | + |
|
294 | + /** |
|
295 | + * Last name |
|
296 | + * @var string |
|
297 | + */ |
|
298 | + public $last_name; |
|
299 | + |
|
300 | + /** |
|
301 | + * Pass-through data about this route destination. |
|
302 | + * The data will be visible on the manifest, website, and mobile apps. |
|
303 | + * Also used to email clients when vehicles are approaching (future capability). |
|
304 | + * @var string |
|
305 | + */ |
|
306 | + public $email; |
|
307 | + |
|
308 | + /** |
|
309 | + * Pass-through data about this route destination. |
|
310 | + * The data will be visible on the manifest, website, and mobile apps. |
|
311 | + * Also used to send SMS messages to clients when vehicles are approaching (future capability). |
|
312 | + * @var string |
|
313 | + */ |
|
314 | + public $phone; |
|
315 | + |
|
316 | + /** |
|
317 | + * The number of notes that are already associated with this address on the route. |
|
318 | + * @var integer |
|
319 | + */ |
|
320 | + public $destination_note_count; |
|
321 | + |
|
322 | + /** |
|
323 | + * Server-side generated amount of km/miles that |
|
324 | + * it will take to get to the next location on the route. |
|
325 | + * @var integer |
|
326 | + */ |
|
327 | + public $drive_time_to_next_destination; |
|
328 | + |
|
329 | + /** |
|
330 | + * Abnormal traffic time to next destination. |
|
331 | + * @var integer |
|
332 | + */ |
|
333 | + public $abnormal_traffic_time_to_next_destination; |
|
334 | + |
|
335 | + /** |
|
336 | + * Uncongested time to next destination. |
|
337 | + * @var integer |
|
338 | + */ |
|
339 | + public $uncongested_time_to_next_destination; |
|
340 | + |
|
341 | + /** |
|
342 | + * Traffic time to next destination. |
|
343 | + * @var integer |
|
344 | + */ |
|
345 | + public $traffic_time_to_next_destination; |
|
346 | + |
|
347 | + /** |
|
348 | + * Server-side generated amount of seconds |
|
349 | + * that it will take to get to the next location. |
|
350 | + * @var double |
|
351 | + */ |
|
352 | + public $distance_to_next_destination; |
|
353 | + |
|
354 | + /** |
|
355 | + * The unique socket channel name which |
|
356 | + * should be used to get real time alerts. |
|
357 | + * @var string |
|
358 | + */ |
|
359 | + public $channel_name; |
|
360 | + |
|
361 | + /** |
|
362 | + * Alias of a pickup point. |
|
363 | + * @var string |
|
364 | + */ |
|
365 | + public $pickup; |
|
366 | + |
|
367 | + /** |
|
368 | + * Alias of the paired pickup point. |
|
369 | + * @var string |
|
370 | + */ |
|
371 | + public $dropoff; |
|
372 | + |
|
373 | + /** |
|
374 | + * If equal to 1, the pickup and dropoff addresses are joint |
|
375 | + * (one by one despite the regular pickup-dropoff addresses |
|
376 | + * when it's possible to have multiple pickup addresses with one dropoff address). |
|
377 | + * @var integer |
|
378 | + */ |
|
379 | + public $joint; |
|
380 | + |
|
381 | + /** |
|
382 | + * Generated time window start. |
|
383 | + * @var integer |
|
384 | + */ |
|
385 | + public $generated_time_window_start; |
|
386 | + |
|
387 | + /** |
|
388 | + * Estimated time window end based on the optimization engine, |
|
389 | + * after all the sequencing has been completed. |
|
390 | + * @var integer |
|
391 | + */ |
|
392 | + public $generated_time_window_end; |
|
393 | + |
|
394 | + /** |
|
395 | + * The address time window start. |
|
396 | + * @var integer |
|
397 | + */ |
|
398 | + public $time_window_start; |
|
399 | + |
|
400 | + /** |
|
401 | + * The address time window end. |
|
402 | + * @var integer |
|
403 | + */ |
|
404 | + public $time_window_end; |
|
405 | + |
|
406 | + /** |
|
407 | + * The address time window start 2. |
|
408 | + * @var integer |
|
409 | + */ |
|
410 | + public $time_window_start_2; |
|
411 | + |
|
412 | + /** |
|
413 | + * The address time window end 2. |
|
414 | + * @var integer |
|
415 | + */ |
|
416 | + public $time_window_end_2; |
|
417 | + |
|
418 | + /** |
|
419 | + * Geofence detected visited timestamp |
|
420 | + * @var integer |
|
421 | + */ |
|
422 | + public $geofence_detected_visited_timestamp; |
|
423 | + |
|
424 | + /** |
|
425 | + * Geofence detected departed timestamp |
|
426 | + * @var integer |
|
427 | + */ |
|
428 | + public $geofence_detected_departed_timestamp; |
|
429 | + |
|
430 | + /** |
|
431 | + * Geofence detected service time |
|
432 | + * @var integer |
|
433 | + */ |
|
434 | + public $geofence_detected_service_time; |
|
435 | + |
|
436 | + /** |
|
437 | + * Geofence detected visited latitude |
|
438 | + * @var double |
|
439 | + */ |
|
440 | + public $geofence_detected_visited_lat; |
|
441 | + |
|
442 | + /** |
|
443 | + * Geofence detected visited longitude |
|
444 | + * @var double |
|
445 | + */ |
|
446 | + public $geofence_detected_visited_lng; |
|
447 | + |
|
448 | + /** |
|
449 | + * Geofence detected departed latitude |
|
450 | + * @var double |
|
451 | + */ |
|
452 | + public $geofence_detected_departed_lat; |
|
453 | + |
|
454 | + /** |
|
455 | + * Geofence detected departed longitude |
|
456 | + * @var double |
|
457 | + */ |
|
458 | + public $geofence_detected_departed_lng; |
|
459 | + |
|
460 | + /** |
|
461 | + * The expected amount of time that will be spent |
|
462 | + * at this address by the driver/user. |
|
463 | + * @var integer |
|
464 | + */ |
|
465 | + public $time; |
|
466 | + |
|
467 | + /** |
|
468 | + * System-wide unique code, which permits end-users (recipients) |
|
469 | + * to track the status of their order. |
|
470 | + * @var string |
|
471 | + */ |
|
472 | + public $tracking_number; |
|
473 | + |
|
474 | + /** |
|
475 | + * The address custom fields. |
|
476 | + * @var array |
|
477 | + */ |
|
478 | + public $custom_fields = []; |
|
479 | + |
|
480 | + /** |
|
481 | + * The custom fields configuration in JSON format. |
|
482 | + * @var string |
|
483 | + */ |
|
484 | + public $custom_fields_str_json; |
|
485 | + |
|
486 | + /** |
|
487 | + * The custom fields configuration. |
|
488 | + * @var string[] |
|
489 | + */ |
|
490 | + public $custom_fields_config = []; |
|
491 | + |
|
492 | + /** |
|
493 | + * The custom fields configuration in JSON format. |
|
494 | + * @var string |
|
495 | + */ |
|
496 | + public $custom_fields_config_str_json; |
|
497 | + |
|
498 | + /** |
|
499 | + * The address notes |
|
500 | + * @var AddressNote[] |
|
501 | + */ |
|
502 | + public $notes = []; |
|
503 | + |
|
504 | + /** |
|
505 | + * Bundle count |
|
506 | + * @var integer |
|
507 | + */ |
|
508 | + public $bundle_count; |
|
509 | + |
|
510 | + /** |
|
511 | + * Bundle items |
|
512 | + * @var BundledItemResponse[] |
|
513 | + */ |
|
514 | + public $bundle_items; |
|
515 | + |
|
516 | + /** |
|
517 | + * List of the order inventories |
|
518 | + * @var OrderInventory[] |
|
519 | + */ |
|
520 | + public $order_inventory; |
|
521 | + |
|
522 | + /** |
|
523 | + * UDU distance to next destination. |
|
524 | + * @var double |
|
525 | + */ |
|
526 | + public $udu_distance_to_next_destination; |
|
527 | + |
|
528 | + /** |
|
529 | + * Wait time to next destination. |
|
530 | + * @var integer |
|
531 | + */ |
|
532 | + public $wait_time_to_next_destination; |
|
533 | + |
|
534 | + /** |
|
535 | + * Manifest of a route address. |
|
536 | + * @var AddressManifest |
|
537 | + */ |
|
538 | + public $manifest; |
|
539 | + |
|
540 | + /** |
|
541 | + * An array of the required driver skills for the address. |
|
542 | + * @var array |
|
543 | + */ |
|
544 | + public $required_skills = []; |
|
545 | + |
|
546 | + public $additional_status; |
|
547 | + |
|
548 | + public function __construct() |
|
549 | + { |
|
550 | + // TO DO: replace with API 5 endpoint after finishing. |
|
551 | + Route4Me::setBaseUrl( Endpoint4::BASE_URL); |
|
552 | + } |
|
553 | + |
|
554 | + public static function fromArray(array $params) |
|
555 | + { |
|
556 | + $address = new self(); |
|
557 | + |
|
558 | + foreach ($params as $key => $value) { |
|
559 | + if (property_exists($address, $key)) { |
|
560 | + $address->{$key} = $value; |
|
561 | + } else { |
|
562 | + throw new BadParam("Correct parameter must be provided. Wrong Parameter: $key"); |
|
563 | + } |
|
564 | + } |
|
565 | + |
|
566 | + return $address; |
|
567 | + } |
|
568 | + |
|
569 | + public static function getAddress($routeId, $addressId) |
|
570 | + { |
|
571 | + $address = Route4Me::makeRequst([ |
|
572 | + 'url' => Endpoint4::ADDRESS_V4, |
|
573 | + 'method' => 'GET', |
|
574 | + 'query' => [ |
|
575 | + 'route_id' => $routeId, |
|
576 | + 'route_destination_id' => $addressId, |
|
577 | + ], |
|
578 | + ]); |
|
579 | + |
|
580 | + return self::fromArray($address); |
|
581 | + } |
|
582 | + |
|
583 | + public function update() |
|
584 | + { |
|
585 | + $addressUpdate = Route4Me::makeRequst([ |
|
586 | + 'url' => Endpoint4::ADDRESS_V4, |
|
587 | + 'method' => 'PUT', |
|
588 | + 'body' => $this->toArray(), |
|
589 | + 'query' => [ |
|
590 | + 'route_id' => $this->route_id, |
|
591 | + 'route_destination_id' => $this->route_destination_id, |
|
592 | + ], |
|
593 | + ]); |
|
594 | + |
|
595 | + return self::fromArray($addressUpdate); |
|
596 | + } |
|
597 | + |
|
598 | + /** |
|
599 | + * Marks an address as marked as visited/as departed |
|
600 | + * depending on which parameter is specified: 'is_visited' or 'is_departed'. |
|
601 | + */ |
|
602 | + public function markAddress($params) |
|
603 | + { |
|
604 | + $allQueryFields = ['route_id', 'route_destination_id']; |
|
605 | + $allBodyFields = ['is_visited', 'is_departed']; |
|
606 | + |
|
607 | + $result = Route4Me::makeRequst([ |
|
608 | + 'url' => Endpoint4::ADDRESS_V4, |
|
609 | + 'method' => 'PUT', |
|
610 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
611 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
612 | + ]); |
|
613 | + |
|
614 | + return $result; |
|
615 | + } |
|
616 | + |
|
617 | + /** |
|
618 | + * Marks an address as departed. |
|
619 | + */ |
|
620 | + public function markAsDeparted($params) |
|
621 | + { |
|
622 | + $allQueryFields = ['route_id', 'address_id', 'is_departed', 'member_id']; |
|
623 | + |
|
624 | + $address = Route4Me::makeRequst([ |
|
625 | + 'url' => Endpoint4::MARK_ADDRESS_DEPARTED, |
|
626 | + 'method' => 'PUT', |
|
627 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
628 | + ]); |
|
629 | + |
|
630 | + return $address; |
|
631 | + } |
|
632 | + |
|
633 | + /** |
|
634 | + * Marks an address as visited. |
|
635 | + */ |
|
636 | + public function markAsVisited($params) |
|
637 | + { |
|
638 | + $allQueryFields = ['route_id', 'address_id', 'is_visited', 'member_id']; |
|
639 | + |
|
640 | + $address = Route4Me::makeRequst([ |
|
641 | + 'url' => Endpoint4::UPDATE_ADDRESS_VISITED, |
|
642 | + 'method' => 'PUT', |
|
643 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
644 | + ]); |
|
645 | + |
|
646 | + return $address; |
|
647 | + } |
|
648 | + |
|
649 | + public function deleteAddress() |
|
650 | + { |
|
651 | + $address = Route4Me::makeRequst([ |
|
652 | + 'url' => Endpoint4::ADDRESS_V4, |
|
653 | + 'method' => 'DELETE', |
|
654 | + 'query' => [ |
|
655 | + 'route_id' => $this->route_id, |
|
656 | + 'route_destination_id' => $this->route_destination_id, |
|
657 | + ], |
|
658 | + ]); |
|
659 | + |
|
660 | + return (bool)$address['deleted']; |
|
661 | + } |
|
662 | + |
|
663 | + public function moveDestinationToRoute($params) |
|
664 | + { |
|
665 | + $allBodyFields = ['to_route_id', 'route_destination_id', 'after_destination_id']; |
|
666 | + |
|
667 | + $result = Route4Me::makeRequst([ |
|
668 | + 'url' => Endpoint4::MOVE_ROUTE_DESTINATION, |
|
669 | + 'method' => 'POST', |
|
670 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
671 | + 'HTTPHEADER' => 'Content-Type: multipart/form-data', |
|
672 | + ]); |
|
673 | + |
|
674 | + return $result; |
|
675 | + } |
|
676 | + |
|
677 | + public function getAddressId() |
|
678 | + { |
|
679 | + return $this->route_destination_id; |
|
680 | + } |
|
681 | 681 | } |
@@ -548,7 +548,7 @@ |
||
548 | 548 | public function __construct() |
549 | 549 | { |
550 | 550 | // TO DO: replace with API 5 endpoint after finishing. |
551 | - Route4Me::setBaseUrl( Endpoint4::BASE_URL); |
|
551 | + Route4Me::setBaseUrl(Endpoint4::BASE_URL); |
|
552 | 552 | } |
553 | 553 | |
554 | 554 | public static function fromArray(array $params) |
@@ -9,34 +9,34 @@ |
||
9 | 9 | */ |
10 | 10 | class Country extends Common |
11 | 11 | { |
12 | - /** |
|
13 | - * Country ID |
|
14 | - * @var type string |
|
15 | - */ |
|
16 | - public $id; |
|
12 | + /** |
|
13 | + * Country ID |
|
14 | + * @var type string |
|
15 | + */ |
|
16 | + public $id; |
|
17 | 17 | |
18 | - /** |
|
19 | - * Country code |
|
20 | - * @var type string |
|
21 | - */ |
|
22 | - public $country_code; |
|
18 | + /** |
|
19 | + * Country code |
|
20 | + * @var type string |
|
21 | + */ |
|
22 | + public $country_code; |
|
23 | 23 | |
24 | - /** |
|
25 | - * Country name |
|
26 | - * @var type string |
|
27 | - */ |
|
28 | - public $country_name; |
|
24 | + /** |
|
25 | + * Country name |
|
26 | + * @var type string |
|
27 | + */ |
|
28 | + public $country_name; |
|
29 | 29 | |
30 | - public static function fromArray(array $params) |
|
31 | - { |
|
32 | - $thisParams = new self(); |
|
30 | + public static function fromArray(array $params) |
|
31 | + { |
|
32 | + $thisParams = new self(); |
|
33 | 33 | |
34 | - foreach ($params as $key => $value) { |
|
35 | - if (property_exists($thisParams, $key)) { |
|
36 | - $thisParams->{$key} = $value; |
|
37 | - } |
|
38 | - } |
|
34 | + foreach ($params as $key => $value) { |
|
35 | + if (property_exists($thisParams, $key)) { |
|
36 | + $thisParams->{$key} = $value; |
|
37 | + } |
|
38 | + } |
|
39 | 39 | |
40 | - return $thisParams; |
|
41 | - } |
|
40 | + return $thisParams; |
|
41 | + } |
|
42 | 42 | } |
@@ -12,18 +12,18 @@ |
||
12 | 12 | */ |
13 | 13 | class VehicleSearchParameters extends \Route4Me\Common |
14 | 14 | { |
15 | - /** An array of the vehicle IDs. |
|
16 | - * @var string[] $vehicle_ids |
|
17 | - */ |
|
18 | - public $vehicle_ids = []; |
|
15 | + /** An array of the vehicle IDs. |
|
16 | + * @var string[] $vehicle_ids |
|
17 | + */ |
|
18 | + public $vehicle_ids = []; |
|
19 | 19 | |
20 | - /** Latitude of a vehicle position. |
|
21 | - * @var float $lat |
|
22 | - */ |
|
23 | - public $lat; |
|
20 | + /** Latitude of a vehicle position. |
|
21 | + * @var float $lat |
|
22 | + */ |
|
23 | + public $lat; |
|
24 | 24 | |
25 | - /** Longitude of a vehicle position. |
|
26 | - * @var float $lng |
|
27 | - */ |
|
28 | - public $lng; |
|
25 | + /** Longitude of a vehicle position. |
|
26 | + * @var float $lng |
|
27 | + */ |
|
28 | + public $lng; |
|
29 | 29 | } |
30 | 30 | \ No newline at end of file |
@@ -12,23 +12,23 @@ |
||
12 | 12 | */ |
13 | 13 | class VehicleProfileParameters extends Common |
14 | 14 | { |
15 | - /** If true, returned vehicle profile is paginated. |
|
16 | - * @var boolean $with_pagination |
|
17 | - */ |
|
18 | - public $with_pagination; |
|
15 | + /** If true, returned vehicle profile is paginated. |
|
16 | + * @var boolean $with_pagination |
|
17 | + */ |
|
18 | + public $with_pagination; |
|
19 | 19 | |
20 | - /** Current page number in the vehicles collection |
|
21 | - * @var integer $page |
|
22 | - */ |
|
23 | - public $page; |
|
20 | + /** Current page number in the vehicles collection |
|
21 | + * @var integer $page |
|
22 | + */ |
|
23 | + public $page; |
|
24 | 24 | |
25 | - /** Returned vehicles number per page |
|
26 | - * @var integer $perPage |
|
27 | - */ |
|
28 | - public $perPage; |
|
25 | + /** Returned vehicles number per page |
|
26 | + * @var integer $perPage |
|
27 | + */ |
|
28 | + public $perPage; |
|
29 | 29 | |
30 | - /** Vehicle profile ID |
|
31 | - * @var integer $id |
|
32 | - */ |
|
33 | - public $id; |
|
30 | + /** Vehicle profile ID |
|
31 | + * @var integer $id |
|
32 | + */ |
|
33 | + public $id; |
|
34 | 34 | } |
35 | 35 | \ No newline at end of file |
@@ -12,32 +12,32 @@ |
||
12 | 12 | */ |
13 | 13 | class VehicleOrderParameters extends Common |
14 | 14 | { |
15 | - /** The vehicle ID |
|
16 | - * @var string $vehicle_id |
|
17 | - */ |
|
18 | - public $vehicle_id; |
|
19 | - |
|
20 | - /** Latitude of a vehicle position. |
|
21 | - * @var float $lat |
|
22 | - */ |
|
23 | - public $lat; |
|
24 | - |
|
25 | - /** Longitude of a vehicle position. |
|
26 | - * @var float $lng |
|
27 | - */ |
|
28 | - public $lng; |
|
29 | - |
|
30 | - public static function fromArray(array $params) |
|
31 | - { |
|
32 | - $orderParams = new self(); |
|
33 | - |
|
34 | - foreach ($params as $key => $value) { |
|
35 | - if (is_null(Common::getValue($params, $key))) continue; |
|
36 | - if (property_exists($orderParams, $key)) { |
|
37 | - $orderParams->$key = $value; |
|
38 | - } |
|
39 | - } |
|
40 | - |
|
41 | - return $orderParams; |
|
42 | - } |
|
15 | + /** The vehicle ID |
|
16 | + * @var string $vehicle_id |
|
17 | + */ |
|
18 | + public $vehicle_id; |
|
19 | + |
|
20 | + /** Latitude of a vehicle position. |
|
21 | + * @var float $lat |
|
22 | + */ |
|
23 | + public $lat; |
|
24 | + |
|
25 | + /** Longitude of a vehicle position. |
|
26 | + * @var float $lng |
|
27 | + */ |
|
28 | + public $lng; |
|
29 | + |
|
30 | + public static function fromArray(array $params) |
|
31 | + { |
|
32 | + $orderParams = new self(); |
|
33 | + |
|
34 | + foreach ($params as $key => $value) { |
|
35 | + if (is_null(Common::getValue($params, $key))) continue; |
|
36 | + if (property_exists($orderParams, $key)) { |
|
37 | + $orderParams->$key = $value; |
|
38 | + } |
|
39 | + } |
|
40 | + |
|
41 | + return $orderParams; |
|
42 | + } |
|
43 | 43 | } |
44 | 44 | \ No newline at end of file |
@@ -32,7 +32,9 @@ |
||
32 | 32 | $orderParams = new self(); |
33 | 33 | |
34 | 34 | foreach ($params as $key => $value) { |
35 | - if (is_null(Common::getValue($params, $key))) continue; |
|
35 | + if (is_null(Common::getValue($params, $key))) { |
|
36 | + continue; |
|
37 | + } |
|
36 | 38 | if (property_exists($orderParams, $key)) { |
37 | 39 | $orderParams->$key = $value; |
38 | 40 | } |
@@ -7,47 +7,47 @@ |
||
7 | 7 | |
8 | 8 | class VehicleParameters extends Common |
9 | 9 | { |
10 | - /** If true, returned vehicles array will be paginated |
|
11 | - * @var boolean $with_pagination |
|
12 | - */ |
|
13 | - public $with_pagination; |
|
14 | - |
|
15 | - /** Current page number in the vehicles collection |
|
16 | - * @var integer $page |
|
17 | - */ |
|
18 | - public $page; |
|
19 | - |
|
20 | - /** Returned vehicles number per page |
|
21 | - * @var integer $perPage |
|
22 | - */ |
|
23 | - public $perPage; |
|
24 | - |
|
25 | - /** An array of the Vehicle IDs. |
|
26 | - * @var string[] $ids = [] |
|
27 | - */ |
|
28 | - public $ids; |
|
29 | - |
|
30 | - /** Vehicle ID |
|
31 | - * @var string $vehicle_id |
|
32 | - */ |
|
33 | - public $vehicle_id; |
|
34 | - |
|
35 | - /** Vehicle license plate |
|
36 | - * @var string $vehicle_license_plate |
|
37 | - */ |
|
38 | - public $vehicle_license_plate; |
|
39 | - |
|
40 | - public static function fromArray(array $params) |
|
41 | - { |
|
42 | - $vehParams = new self(); |
|
43 | - |
|
44 | - foreach ($params as $key => $value) { |
|
45 | - if (is_null(Common::getValue($params, $key))) continue; |
|
46 | - if (property_exists($vehParams, $key)) { |
|
47 | - $vehParams->$key = $value; |
|
48 | - } |
|
49 | - } |
|
50 | - |
|
51 | - return $vehParams; |
|
52 | - } |
|
10 | + /** If true, returned vehicles array will be paginated |
|
11 | + * @var boolean $with_pagination |
|
12 | + */ |
|
13 | + public $with_pagination; |
|
14 | + |
|
15 | + /** Current page number in the vehicles collection |
|
16 | + * @var integer $page |
|
17 | + */ |
|
18 | + public $page; |
|
19 | + |
|
20 | + /** Returned vehicles number per page |
|
21 | + * @var integer $perPage |
|
22 | + */ |
|
23 | + public $perPage; |
|
24 | + |
|
25 | + /** An array of the Vehicle IDs. |
|
26 | + * @var string[] $ids = [] |
|
27 | + */ |
|
28 | + public $ids; |
|
29 | + |
|
30 | + /** Vehicle ID |
|
31 | + * @var string $vehicle_id |
|
32 | + */ |
|
33 | + public $vehicle_id; |
|
34 | + |
|
35 | + /** Vehicle license plate |
|
36 | + * @var string $vehicle_license_plate |
|
37 | + */ |
|
38 | + public $vehicle_license_plate; |
|
39 | + |
|
40 | + public static function fromArray(array $params) |
|
41 | + { |
|
42 | + $vehParams = new self(); |
|
43 | + |
|
44 | + foreach ($params as $key => $value) { |
|
45 | + if (is_null(Common::getValue($params, $key))) continue; |
|
46 | + if (property_exists($vehParams, $key)) { |
|
47 | + $vehParams->$key = $value; |
|
48 | + } |
|
49 | + } |
|
50 | + |
|
51 | + return $vehParams; |
|
52 | + } |
|
53 | 53 | } |
54 | 54 | \ No newline at end of file |
@@ -42,7 +42,9 @@ |
||
42 | 42 | $vehParams = new self(); |
43 | 43 | |
44 | 44 | foreach ($params as $key => $value) { |
45 | - if (is_null(Common::getValue($params, $key))) continue; |
|
45 | + if (is_null(Common::getValue($params, $key))) { |
|
46 | + continue; |
|
47 | + } |
|
46 | 48 | if (property_exists($vehParams, $key)) { |
47 | 49 | $vehParams->$key = $value; |
48 | 50 | } |