aftership-tracking-sdk 9.0.0 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +16 -19
  4. data/lib/aftership-tracking-sdk/api/courier.rb +16 -60
  5. data/lib/aftership-tracking-sdk/api/courier_connection.rb +283 -0
  6. data/lib/aftership-tracking-sdk/api/estimated_delivery_date.rb +55 -1
  7. data/lib/aftership-tracking-sdk/api/tracking.rb +17 -17
  8. data/lib/aftership-tracking-sdk/models/{additional_fields_v1.rb → additional_fields.rb} +9 -9
  9. data/lib/aftership-tracking-sdk/models/checkpoint.rb +24 -14
  10. data/lib/aftership-tracking-sdk/models/courier.rb +17 -7
  11. data/lib/aftership-tracking-sdk/models/courier_connection.rb +193 -0
  12. data/lib/aftership-tracking-sdk/models/courier_connection_response_for_get_courier_connections.rb +163 -0
  13. data/lib/aftership-tracking-sdk/models/{courier_response_v1.rb → courier_response.rb} +6 -6
  14. data/lib/aftership-tracking-sdk/models/create_tracking_request.rb +55 -105
  15. data/lib/aftership-tracking-sdk/models/create_tracking_response.rb +53 -113
  16. data/lib/aftership-tracking-sdk/models/credential_field.rb +173 -0
  17. data/lib/aftership-tracking-sdk/models/{get_user_couriers_response.rb → credentials_courier.rb} +9 -19
  18. data/lib/aftership-tracking-sdk/models/customers_create_tracking_request.rb +193 -0
  19. data/lib/aftership-tracking-sdk/models/customers_create_tracking_response.rb +193 -0
  20. data/lib/aftership-tracking-sdk/models/customers_delete_tracking_by_id_response.rb +193 -0
  21. data/lib/aftership-tracking-sdk/models/customers_get_tracking_by_id_response.rb +193 -0
  22. data/lib/aftership-tracking-sdk/models/customers_mark_tracking_completed_by_id_response.rb +193 -0
  23. data/lib/aftership-tracking-sdk/models/customers_retrack_tracking_by_id_response.rb +193 -0
  24. data/lib/aftership-tracking-sdk/models/customers_tracking.rb +193 -0
  25. data/lib/aftership-tracking-sdk/models/customers_update_tracking_by_id_request.rb +193 -0
  26. data/lib/aftership-tracking-sdk/models/customers_update_tracking_by_id_response.rb +193 -0
  27. data/lib/aftership-tracking-sdk/models/data_courier_connection_response_for_get_courier_connections.rb +163 -0
  28. data/lib/aftership-tracking-sdk/models/{data_courier_response_v1.rb → data_courier_response.rb} +2 -2
  29. data/lib/aftership-tracking-sdk/models/{data_tracking_response_get_multiple_v1.rb → data_tracking_response_for_get_trackings.rb} +4 -4
  30. data/lib/aftership-tracking-sdk/models/delete_courier_connections_by_id_response.rb +193 -0
  31. data/lib/aftership-tracking-sdk/models/delete_tracking_by_id_response.rb +53 -113
  32. data/lib/aftership-tracking-sdk/models/destination_address_estimated_delivery_date_request.rb +6 -6
  33. data/lib/aftership-tracking-sdk/models/destination_address_estimated_delivery_date_response.rb +6 -6
  34. data/lib/aftership-tracking-sdk/models/destination_address_predict_request.rb +193 -0
  35. data/lib/aftership-tracking-sdk/models/destination_address_predict_response.rb +193 -0
  36. data/lib/aftership-tracking-sdk/models/detect_courier_request.rb +26 -46
  37. data/lib/aftership-tracking-sdk/models/estimated_pickup_predict_request.rb +183 -0
  38. data/lib/aftership-tracking-sdk/models/estimated_pickup_predict_response.rb +193 -0
  39. data/lib/aftership-tracking-sdk/models/{next_couriers_delete_tracking_by_id_response.rb → first_mile_create_tracking_response.rb} +29 -29
  40. data/lib/aftership-tracking-sdk/models/first_mile_delete_tracking_by_id_response.rb +193 -0
  41. data/lib/aftership-tracking-sdk/models/first_mile_get_tracking_by_id_response.rb +193 -0
  42. data/lib/aftership-tracking-sdk/models/first_mile_mark_tracking_completed_by_id_response.rb +193 -0
  43. data/lib/aftership-tracking-sdk/models/first_mile_retrack_tracking_by_id_response.rb +193 -0
  44. data/lib/aftership-tracking-sdk/models/{next_couriers_get_tracking_by_id_response.rb → first_mile_tracking.rb} +29 -29
  45. data/lib/aftership-tracking-sdk/models/first_mile_update_tracking_by_id_response.rb +193 -0
  46. data/lib/aftership-tracking-sdk/models/get_courier_connections_by_id_response.rb +193 -0
  47. data/lib/aftership-tracking-sdk/models/get_courier_connections_response.rb +163 -0
  48. data/lib/aftership-tracking-sdk/models/{get_all_couriers_response.rb → get_couriers_response.rb} +2 -2
  49. data/lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb +53 -113
  50. data/lib/aftership-tracking-sdk/models/{next_couriers_create_tracking_request.rb → last_mile_create_tracking_request.rb} +13 -13
  51. data/lib/aftership-tracking-sdk/models/last_mile_create_tracking_response.rb +203 -0
  52. data/lib/aftership-tracking-sdk/models/{next_couriers_create_tracking_response.rb → last_mile_delete_tracking_by_id_response.rb} +33 -23
  53. data/lib/aftership-tracking-sdk/models/last_mile_get_tracking_by_id_response.rb +203 -0
  54. data/lib/aftership-tracking-sdk/models/last_mile_mark_tracking_completed_by_id_response.rb +203 -0
  55. data/lib/aftership-tracking-sdk/models/last_mile_retrack_tracking_by_id_response.rb +203 -0
  56. data/lib/aftership-tracking-sdk/models/{next_couriers_mark_tracking_completed_by_id_response.rb → last_mile_tracking.rb} +33 -23
  57. data/lib/aftership-tracking-sdk/models/last_mile_update_tracking_by_id_response.rb +203 -0
  58. data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_create_tracking_response.rb +10 -0
  59. data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_delete_tracking_by_id_response.rb +10 -0
  60. data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_get_tracking_by_id_response.rb +10 -0
  61. data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_mark_tracking_completed_by_id_response.rb +10 -0
  62. data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_retrack_tracking_by_id_response.rb +10 -0
  63. data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_tracking.rb +10 -0
  64. data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_update_tracking_by_id_response.rb +10 -0
  65. data/lib/aftership-tracking-sdk/models/mark_tracking_completed_by_id_request.rb +10 -0
  66. data/lib/aftership-tracking-sdk/models/mark_tracking_completed_by_id_response.rb +53 -113
  67. data/lib/aftership-tracking-sdk/models/{meta_v1.rb → meta.rb} +2 -2
  68. data/lib/aftership-tracking-sdk/models/order_processing_time_estimated_pickup_predict_request.rb +163 -0
  69. data/lib/aftership-tracking-sdk/models/order_processing_time_estimated_pickup_predict_response.rb +163 -0
  70. data/lib/aftership-tracking-sdk/models/origin_address_estimated_delivery_date_request.rb +6 -6
  71. data/lib/aftership-tracking-sdk/models/origin_address_estimated_delivery_date_response.rb +6 -6
  72. data/lib/aftership-tracking-sdk/models/origin_address_predict_request.rb +193 -0
  73. data/lib/aftership-tracking-sdk/models/origin_address_predict_response.rb +193 -0
  74. data/lib/aftership-tracking-sdk/models/pagination_data_courier_connection_response_for_get_courier_connections.rb +173 -0
  75. data/lib/aftership-tracking-sdk/models/{pagination_data_tracking_response_get_multiple_v1.rb → pagination_data_tracking_response_for_get_trackings.rb} +2 -2
  76. data/lib/aftership-tracking-sdk/models/pagination_get_courier_connections_response.rb +173 -0
  77. data/lib/aftership-tracking-sdk/models/post_courier_connections_request.rb +163 -0
  78. data/lib/aftership-tracking-sdk/models/post_courier_connections_response.rb +193 -0
  79. data/lib/aftership-tracking-sdk/models/predict_request.rb +223 -0
  80. data/lib/aftership-tracking-sdk/models/predict_response.rb +273 -0
  81. data/lib/aftership-tracking-sdk/models/put_courier_connections_by_id_request.rb +153 -0
  82. data/lib/aftership-tracking-sdk/models/put_courier_connections_by_id_response.rb +193 -0
  83. data/lib/aftership-tracking-sdk/models/retrack_tracking_by_id_response.rb +53 -113
  84. data/lib/aftership-tracking-sdk/models/{slug_group_v1.rb → slug_group.rb} +3 -3
  85. data/lib/aftership-tracking-sdk/models/{tag_v1.rb → tag.rb} +3 -3
  86. data/lib/aftership-tracking-sdk/models/tracking.rb +53 -113
  87. data/lib/aftership-tracking-sdk/models/{tracking_response_v1.rb → tracking_response.rb} +4 -4
  88. data/lib/aftership-tracking-sdk/models/{tracking_response_get_multiple_v1.rb → tracking_response_for_get_trackings.rb} +6 -6
  89. data/lib/aftership-tracking-sdk/models/update_tracking_by_id_request.rb +23 -83
  90. data/lib/aftership-tracking-sdk/models/update_tracking_by_id_response.rb +53 -113
  91. data/lib/aftership-tracking-sdk/models/weight_predict_request.rb +163 -0
  92. data/lib/aftership-tracking-sdk/models/weight_predict_response.rb +163 -0
  93. data/lib/aftership-tracking-sdk/version.rb +1 -1
  94. metadata +67 -25
  95. data/lib/aftership-tracking-sdk/models/next_couriers_retrack_tracking_by_id_response.rb +0 -193
  96. data/lib/aftership-tracking-sdk/models/next_couriers_tracking.rb +0 -193
  97. data/lib/aftership-tracking-sdk/models/next_couriers_update_tracking_by_id_response.rb +0 -193
@@ -3,7 +3,7 @@
3
3
  module AftershipAPI::Model
4
4
  class DeleteTrackingByIdResponse
5
5
 
6
- # Tracking ID.
6
+ # A system-generated tracking ID by default, which can be customized by the user when creating a tracking.
7
7
  # id?: String;
8
8
  attr_accessor :id
9
9
 
@@ -19,10 +19,6 @@ module AftershipAPI::Model
19
19
  # updated_at?: String;
20
20
  attr_accessor :updated_at
21
21
 
22
- # (Legacy) The date and time the shipment was updated. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0.
23
- # last_updated_at?: String;
24
- attr_accessor :last_updated_at
25
-
26
22
  # Tracking number.
27
23
  # tracking_number?: String;
28
24
  attr_accessor :tracking_number
@@ -31,7 +27,7 @@ module AftershipAPI::Model
31
27
  # slug?: String;
32
28
  attr_accessor :slug
33
29
 
34
- # Whether or not AfterShip will continue tracking the shipments. Value is `false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update.
30
+ # Whether or not AfterShip will continue tracking the shipment. Value is false when no further updates for a few days since last update.
35
31
  # active?: Boolean;
36
32
  attr_accessor :active
37
33
 
@@ -39,17 +35,13 @@ module AftershipAPI::Model
39
35
  # custom_fields?: Object;
40
36
  attr_accessor :custom_fields
41
37
 
42
- # Customer name of the tracking.
43
- # customer_name?: String;
44
- attr_accessor :customer_name
45
-
46
38
  # Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as `null` for the shipment without pick-up date.
47
39
  # transit_time?: Integer;
48
40
  attr_accessor :transit_time
49
41
 
50
42
  # The for the origin country/region. E.g. USA for the United States.
51
- # origin_country_iso3?: String;
52
- attr_accessor :origin_country_iso3
43
+ # origin_country_region?: String;
44
+ attr_accessor :origin_country_region
53
45
 
54
46
  # The state of the sender’s address.
55
47
  # origin_state?: String;
@@ -68,8 +60,8 @@ module AftershipAPI::Model
68
60
  attr_accessor :origin_raw_location
69
61
 
70
62
  # The for the destination country/region. E.g. USA for the United States.
71
- # destination_country_iso3?: String;
72
- attr_accessor :destination_country_iso3
63
+ # destination_country_region?: String;
64
+ attr_accessor :destination_country_region
73
65
 
74
66
  # The state of the recipient’s address.
75
67
  # destination_state?: String;
@@ -88,12 +80,8 @@ module AftershipAPI::Model
88
80
  attr_accessor :destination_raw_location
89
81
 
90
82
  # Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be `null` if the courier doesn't provide the destination country.
91
- # courier_destination_country_iso3?: String;
92
- attr_accessor :courier_destination_country_iso3
93
-
94
- # Email address(es) to receive email notifications.
95
- # emails?: String[];
96
- attr_accessor :emails
83
+ # courier_destination_country_region?: String;
84
+ attr_accessor :courier_destination_country_region
97
85
 
98
86
  # The field contains the estimated delivery date provided by the carrier.
99
87
  # courier_estimated_delivery_date?: CourierEstimatedDeliveryDateDeleteTrackingByIdResponse;
@@ -139,16 +127,12 @@ module AftershipAPI::Model
139
127
  # signed_by?: String;
140
128
  attr_accessor :signed_by
141
129
 
142
- # The phone number(s) to receive sms notifications. Phone number should begin with `+` and `Area Code` before phone number.
143
- # smses?: String[];
144
- attr_accessor :smses
145
-
146
130
  # Source of how this tracking is added.
147
131
  # source?: String;
148
132
  attr_accessor :source
149
133
 
150
134
  # Current status of tracking. (
151
- # tag?: TagV1;
135
+ # tag?: Tag;
152
136
  attr_accessor :tag
153
137
 
154
138
  # Current subtag of tracking. (
@@ -231,7 +215,7 @@ module AftershipAPI::Model
231
215
  # tracking_key?: String;
232
216
  attr_accessor :tracking_key
233
217
 
234
- # Additional field required by some carriers to retrieve the tracking info. The date the shipment was sent, using the format YYYYMMDD. Refer to our article on for more details.
218
+ # The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it's recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field.
235
219
  # tracking_ship_date?: String;
236
220
  attr_accessor :tracking_ship_date
237
221
 
@@ -275,26 +259,6 @@ module AftershipAPI::Model
275
259
  # courier_connection_id?: String;
276
260
  attr_accessor :courier_connection_id
277
261
 
278
- # The next couriers get the second carrier information from user or AfterShip.
279
- # next_couriers?: NextCouriersDeleteTrackingByIdResponse[];
280
- attr_accessor :next_couriers
281
-
282
- # (Legacy) Replaced by `origin_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details.
283
- # tracking_origin_country?: String;
284
- attr_accessor :tracking_origin_country
285
-
286
- # (Legacy) Replaced by `destination_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details.
287
- # tracking_destination_country?: String;
288
- attr_accessor :tracking_destination_country
289
-
290
- # (Legacy) Replaced by `destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
291
- # tracking_postal_code?: String;
292
- attr_accessor :tracking_postal_code
293
-
294
- # (Legacy) Replaced by `destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
295
- # tracking_state?: String;
296
- attr_accessor :tracking_state
297
-
298
262
  # The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more.
299
263
  # carbon_emissions?: CarbonEmissionsDeleteTrackingByIdResponse;
300
264
  attr_accessor :carbon_emissions
@@ -327,6 +291,18 @@ module AftershipAPI::Model
327
291
  # aftership_tracking_order_url?: String;
328
292
  attr_accessor :aftership_tracking_order_url
329
293
 
294
+ # The field contains information about the first leg of the shipping starting from the carrier picking up the shipment from the shipper to the point where they hand it over to the last-mile carrier. Once AfterShip detects the shipment is multi-leg, we will populate the first-mile information under this object.
295
+ # first_mile?: FirstMileDeleteTrackingByIdResponse;
296
+ attr_accessor :first_mile
297
+
298
+ # This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically.
299
+ # last_mile?: LastMileDeleteTrackingByIdResponse;
300
+ attr_accessor :last_mile
301
+
302
+ # The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed.
303
+ # customers?: CustomersDeleteTrackingByIdResponse[];
304
+ attr_accessor :customers
305
+
330
306
  # Initializes the object
331
307
  # @param [Hash] attributes Model attributes in the form of hash
332
308
  def initialize(attributes = {})
@@ -354,10 +330,6 @@ module AftershipAPI::Model
354
330
  self.updated_at = attributes[:'updated_at']
355
331
  end
356
332
 
357
- if attributes.key?(:'last_updated_at')
358
- self.last_updated_at = attributes[:'last_updated_at']
359
- end
360
-
361
333
  if attributes.key?(:'tracking_number')
362
334
  self.tracking_number = attributes[:'tracking_number']
363
335
  end
@@ -374,16 +346,12 @@ module AftershipAPI::Model
374
346
  self.custom_fields = attributes[:'custom_fields']
375
347
  end
376
348
 
377
- if attributes.key?(:'customer_name')
378
- self.customer_name = attributes[:'customer_name']
379
- end
380
-
381
349
  if attributes.key?(:'transit_time')
382
350
  self.transit_time = attributes[:'transit_time']
383
351
  end
384
352
 
385
- if attributes.key?(:'origin_country_iso3')
386
- self.origin_country_iso3 = attributes[:'origin_country_iso3']
353
+ if attributes.key?(:'origin_country_region')
354
+ self.origin_country_region = attributes[:'origin_country_region']
387
355
  end
388
356
 
389
357
  if attributes.key?(:'origin_state')
@@ -402,8 +370,8 @@ module AftershipAPI::Model
402
370
  self.origin_raw_location = attributes[:'origin_raw_location']
403
371
  end
404
372
 
405
- if attributes.key?(:'destination_country_iso3')
406
- self.destination_country_iso3 = attributes[:'destination_country_iso3']
373
+ if attributes.key?(:'destination_country_region')
374
+ self.destination_country_region = attributes[:'destination_country_region']
407
375
  end
408
376
 
409
377
  if attributes.key?(:'destination_state')
@@ -422,12 +390,8 @@ module AftershipAPI::Model
422
390
  self.destination_raw_location = attributes[:'destination_raw_location']
423
391
  end
424
392
 
425
- if attributes.key?(:'courier_destination_country_iso3')
426
- self.courier_destination_country_iso3 = attributes[:'courier_destination_country_iso3']
427
- end
428
-
429
- if attributes.key?(:'emails')
430
- self.emails = attributes[:'emails']
393
+ if attributes.key?(:'courier_destination_country_region')
394
+ self.courier_destination_country_region = attributes[:'courier_destination_country_region']
431
395
  end
432
396
 
433
397
  if attributes.key?(:'courier_estimated_delivery_date')
@@ -474,10 +438,6 @@ module AftershipAPI::Model
474
438
  self.signed_by = attributes[:'signed_by']
475
439
  end
476
440
 
477
- if attributes.key?(:'smses')
478
- self.smses = attributes[:'smses']
479
- end
480
-
481
441
  if attributes.key?(:'source')
482
442
  self.source = attributes[:'source']
483
443
  end
@@ -610,26 +570,6 @@ module AftershipAPI::Model
610
570
  self.courier_connection_id = attributes[:'courier_connection_id']
611
571
  end
612
572
 
613
- if attributes.key?(:'next_couriers')
614
- self.next_couriers = attributes[:'next_couriers']
615
- end
616
-
617
- if attributes.key?(:'tracking_origin_country')
618
- self.tracking_origin_country = attributes[:'tracking_origin_country']
619
- end
620
-
621
- if attributes.key?(:'tracking_destination_country')
622
- self.tracking_destination_country = attributes[:'tracking_destination_country']
623
- end
624
-
625
- if attributes.key?(:'tracking_postal_code')
626
- self.tracking_postal_code = attributes[:'tracking_postal_code']
627
- end
628
-
629
- if attributes.key?(:'tracking_state')
630
- self.tracking_state = attributes[:'tracking_state']
631
- end
632
-
633
573
  if attributes.key?(:'carbon_emissions')
634
574
  self.carbon_emissions = attributes[:'carbon_emissions']
635
575
  end
@@ -661,6 +601,18 @@ module AftershipAPI::Model
661
601
  if attributes.key?(:'aftership_tracking_order_url')
662
602
  self.aftership_tracking_order_url = attributes[:'aftership_tracking_order_url']
663
603
  end
604
+
605
+ if attributes.key?(:'first_mile')
606
+ self.first_mile = attributes[:'first_mile']
607
+ end
608
+
609
+ if attributes.key?(:'last_mile')
610
+ self.last_mile = attributes[:'last_mile']
611
+ end
612
+
613
+ if attributes.key?(:'customers')
614
+ self.customers = attributes[:'customers']
615
+ end
664
616
  end
665
617
 
666
618
  # Attribute type mapping.
@@ -670,25 +622,22 @@ module AftershipAPI::Model
670
622
  :'legacy_id' => :'String',
671
623
  :'created_at' => :'String',
672
624
  :'updated_at' => :'String',
673
- :'last_updated_at' => :'String',
674
625
  :'tracking_number' => :'String',
675
626
  :'slug' => :'String',
676
627
  :'active' => :'Boolean',
677
628
  :'custom_fields' => :'Object',
678
- :'customer_name' => :'String',
679
629
  :'transit_time' => :'Integer',
680
- :'origin_country_iso3' => :'String',
630
+ :'origin_country_region' => :'String',
681
631
  :'origin_state' => :'String',
682
632
  :'origin_city' => :'String',
683
633
  :'origin_postal_code' => :'String',
684
634
  :'origin_raw_location' => :'String',
685
- :'destination_country_iso3' => :'String',
635
+ :'destination_country_region' => :'String',
686
636
  :'destination_state' => :'String',
687
637
  :'destination_city' => :'String',
688
638
  :'destination_postal_code' => :'String',
689
639
  :'destination_raw_location' => :'String',
690
- :'courier_destination_country_iso3' => :'String',
691
- :'emails' => :'Array<String>',
640
+ :'courier_destination_country_region' => :'String',
692
641
  :'courier_estimated_delivery_date' => :'CourierEstimatedDeliveryDateDeleteTrackingByIdResponse',
693
642
  :'note' => :'String',
694
643
  :'order_id' => :'String',
@@ -700,9 +649,8 @@ module AftershipAPI::Model
700
649
  :'shipment_type' => :'String',
701
650
  :'shipment_weight' => :'ShipmentWeightDeleteTrackingByIdResponse',
702
651
  :'signed_by' => :'String',
703
- :'smses' => :'Array<String>',
704
652
  :'source' => :'String',
705
- :'tag' => :'TagV1',
653
+ :'tag' => :'Tag',
706
654
  :'subtag' => :'String',
707
655
  :'subtag_message' => :'String',
708
656
  :'title' => :'String',
@@ -734,11 +682,6 @@ module AftershipAPI::Model
734
682
  :'latest_estimated_delivery' => :'LatestEstimatedDeliveryDeleteTrackingByIdResponse',
735
683
  :'shipment_tags' => :'Array<String>',
736
684
  :'courier_connection_id' => :'String',
737
- :'next_couriers' => :'Array<NextCouriersDeleteTrackingByIdResponse>',
738
- :'tracking_origin_country' => :'String',
739
- :'tracking_destination_country' => :'String',
740
- :'tracking_postal_code' => :'String',
741
- :'tracking_state' => :'String',
742
685
  :'carbon_emissions' => :'CarbonEmissionsDeleteTrackingByIdResponse',
743
686
  :'location_id' => :'String',
744
687
  :'shipping_method' => :'String',
@@ -747,6 +690,9 @@ module AftershipAPI::Model
747
690
  :'delivery_location_type' => :'String',
748
691
  :'aftership_tracking_url' => :'String',
749
692
  :'aftership_tracking_order_url' => :'String',
693
+ :'first_mile' => :'FirstMileDeleteTrackingByIdResponse',
694
+ :'last_mile' => :'LastMileDeleteTrackingByIdResponse',
695
+ :'customers' => :'Array<CustomersDeleteTrackingByIdResponse>',
750
696
  }
751
697
  end
752
698
 
@@ -757,25 +703,22 @@ module AftershipAPI::Model
757
703
  :'legacy_id' => :'legacy_id',
758
704
  :'created_at' => :'created_at',
759
705
  :'updated_at' => :'updated_at',
760
- :'last_updated_at' => :'last_updated_at',
761
706
  :'tracking_number' => :'tracking_number',
762
707
  :'slug' => :'slug',
763
708
  :'active' => :'active',
764
709
  :'custom_fields' => :'custom_fields',
765
- :'customer_name' => :'customer_name',
766
710
  :'transit_time' => :'transit_time',
767
- :'origin_country_iso3' => :'origin_country_iso3',
711
+ :'origin_country_region' => :'origin_country_region',
768
712
  :'origin_state' => :'origin_state',
769
713
  :'origin_city' => :'origin_city',
770
714
  :'origin_postal_code' => :'origin_postal_code',
771
715
  :'origin_raw_location' => :'origin_raw_location',
772
- :'destination_country_iso3' => :'destination_country_iso3',
716
+ :'destination_country_region' => :'destination_country_region',
773
717
  :'destination_state' => :'destination_state',
774
718
  :'destination_city' => :'destination_city',
775
719
  :'destination_postal_code' => :'destination_postal_code',
776
720
  :'destination_raw_location' => :'destination_raw_location',
777
- :'courier_destination_country_iso3' => :'courier_destination_country_iso3',
778
- :'emails' => :'emails',
721
+ :'courier_destination_country_region' => :'courier_destination_country_region',
779
722
  :'courier_estimated_delivery_date' => :'courier_estimated_delivery_date',
780
723
  :'note' => :'note',
781
724
  :'order_id' => :'order_id',
@@ -787,7 +730,6 @@ module AftershipAPI::Model
787
730
  :'shipment_type' => :'shipment_type',
788
731
  :'shipment_weight' => :'shipment_weight',
789
732
  :'signed_by' => :'signed_by',
790
- :'smses' => :'smses',
791
733
  :'source' => :'source',
792
734
  :'tag' => :'tag',
793
735
  :'subtag' => :'subtag',
@@ -821,11 +763,6 @@ module AftershipAPI::Model
821
763
  :'latest_estimated_delivery' => :'latest_estimated_delivery',
822
764
  :'shipment_tags' => :'shipment_tags',
823
765
  :'courier_connection_id' => :'courier_connection_id',
824
- :'next_couriers' => :'next_couriers',
825
- :'tracking_origin_country' => :'tracking_origin_country',
826
- :'tracking_destination_country' => :'tracking_destination_country',
827
- :'tracking_postal_code' => :'tracking_postal_code',
828
- :'tracking_state' => :'tracking_state',
829
766
  :'carbon_emissions' => :'carbon_emissions',
830
767
  :'location_id' => :'location_id',
831
768
  :'shipping_method' => :'shipping_method',
@@ -834,6 +771,9 @@ module AftershipAPI::Model
834
771
  :'delivery_location_type' => :'delivery_location_type',
835
772
  :'aftership_tracking_url' => :'aftership_tracking_url',
836
773
  :'aftership_tracking_order_url' => :'aftership_tracking_order_url',
774
+ :'first_mile' => :'first_mile',
775
+ :'last_mile' => :'last_mile',
776
+ :'customers' => :'customers',
837
777
  }
838
778
  end
839
779
 
@@ -4,8 +4,8 @@ module AftershipAPI::Model
4
4
  class DestinationAddressEstimatedDeliveryDateRequest
5
5
 
6
6
  # The country/region of the destination location where the package will be delivered. Use 3 letters of ISO 3166-1 country code.
7
- # country: String;
8
- attr_accessor :country
7
+ # country_region: String;
8
+ attr_accessor :country_region
9
9
 
10
10
  # State, province, or the equivalent location of the destination address where the package will be delivered.Either `destination_address.state` or `destination_address.postal_code` is required.
11
11
  # state?: String;
@@ -34,8 +34,8 @@ module AftershipAPI::Model
34
34
  h[k.to_sym] = v
35
35
  }
36
36
 
37
- if attributes.key?(:'country')
38
- self.country = attributes[:'country']
37
+ if attributes.key?(:'country_region')
38
+ self.country_region = attributes[:'country_region']
39
39
  end
40
40
 
41
41
  if attributes.key?(:'state')
@@ -58,7 +58,7 @@ module AftershipAPI::Model
58
58
  # Attribute type mapping.
59
59
  def self.openapi_types
60
60
  {
61
- :'country' => :'String',
61
+ :'country_region' => :'String',
62
62
  :'state' => :'String',
63
63
  :'city' => :'String',
64
64
  :'postal_code' => :'String',
@@ -69,7 +69,7 @@ module AftershipAPI::Model
69
69
  # Attribute mapping from ruby-style variable name to JSON key.
70
70
  def self.attribute_map
71
71
  {
72
- :'country' => :'country',
72
+ :'country_region' => :'country_region',
73
73
  :'state' => :'state',
74
74
  :'city' => :'city',
75
75
  :'postal_code' => :'postal_code',
@@ -4,8 +4,8 @@ module AftershipAPI::Model
4
4
  class DestinationAddressEstimatedDeliveryDateResponse
5
5
 
6
6
  # The country/region of the destination location where the package will be delivered. Use 3 letters of ISO 3166-1 country code.
7
- # country: String;
8
- attr_accessor :country
7
+ # country_region: String;
8
+ attr_accessor :country_region
9
9
 
10
10
  # State, province, or the equivalent location of the destination address where the package will be delivered.Either `destination_address.state` or `destination_address.postal_code` is required.
11
11
  # state?: String;
@@ -34,8 +34,8 @@ module AftershipAPI::Model
34
34
  h[k.to_sym] = v
35
35
  }
36
36
 
37
- if attributes.key?(:'country')
38
- self.country = attributes[:'country']
37
+ if attributes.key?(:'country_region')
38
+ self.country_region = attributes[:'country_region']
39
39
  end
40
40
 
41
41
  if attributes.key?(:'state')
@@ -58,7 +58,7 @@ module AftershipAPI::Model
58
58
  # Attribute type mapping.
59
59
  def self.openapi_types
60
60
  {
61
- :'country' => :'String',
61
+ :'country_region' => :'String',
62
62
  :'state' => :'String',
63
63
  :'city' => :'String',
64
64
  :'postal_code' => :'String',
@@ -69,7 +69,7 @@ module AftershipAPI::Model
69
69
  # Attribute mapping from ruby-style variable name to JSON key.
70
70
  def self.attribute_map
71
71
  {
72
- :'country' => :'country',
72
+ :'country_region' => :'country_region',
73
73
  :'state' => :'state',
74
74
  :'city' => :'city',
75
75
  :'postal_code' => :'postal_code',
@@ -0,0 +1,193 @@
1
+ # This code was auto generated by AfterShip SDK Generator.
2
+ # Do not edit the class manually.
3
+ module AftershipAPI::Model
4
+ class DestinationAddressPredictRequest
5
+
6
+ # The country/region of the destination location where the package will be delivered. Use 3 letters of ISO 3166-1 country code.
7
+ # country_region: String;
8
+ attr_accessor :country_region
9
+
10
+ # State, province, or the equivalent location of the destination address where the package will be delivered.Either `destination_address.state` or `destination_address.postal_code` is required.
11
+ # state?: String;
12
+ attr_accessor :state
13
+
14
+ # City of the destination address where the package will be delivered.
15
+ # city?: String;
16
+ attr_accessor :city
17
+
18
+ # Postal code of the destination address.Either `destination_address.state` or `destination_address.postal_code` is required.
19
+ # postal_code?: String;
20
+ attr_accessor :postal_code
21
+
22
+ # Raw location of the destination address. A raw address will help AI to identify the accurate location of the destination address.
23
+ # raw_location?: String;
24
+ attr_accessor :raw_location
25
+
26
+ # Initializes the object
27
+ # @param [Hash] attributes Model attributes in the form of hash
28
+ def initialize(attributes = {})
29
+ if (!attributes.is_a?(Hash))
30
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AftershipAPI::DestinationAddressPredictRequest` initialize method"
31
+ end
32
+
33
+ attributes = attributes.each_with_object({}) { |(k, v), h|
34
+ h[k.to_sym] = v
35
+ }
36
+
37
+ if attributes.key?(:'country_region')
38
+ self.country_region = attributes[:'country_region']
39
+ end
40
+
41
+ if attributes.key?(:'state')
42
+ self.state = attributes[:'state']
43
+ end
44
+
45
+ if attributes.key?(:'city')
46
+ self.city = attributes[:'city']
47
+ end
48
+
49
+ if attributes.key?(:'postal_code')
50
+ self.postal_code = attributes[:'postal_code']
51
+ end
52
+
53
+ if attributes.key?(:'raw_location')
54
+ self.raw_location = attributes[:'raw_location']
55
+ end
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'country_region' => :'String',
62
+ :'state' => :'String',
63
+ :'city' => :'String',
64
+ :'postal_code' => :'String',
65
+ :'raw_location' => :'String',
66
+ }
67
+ end
68
+
69
+ # Attribute mapping from ruby-style variable name to JSON key.
70
+ def self.attribute_map
71
+ {
72
+ :'country_region' => :'country_region',
73
+ :'state' => :'state',
74
+ :'city' => :'city',
75
+ :'postal_code' => :'postal_code',
76
+ :'raw_location' => :'raw_location',
77
+ }
78
+ end
79
+
80
+ # Builds the object from hash
81
+ # @param attributes [Hash] Model attributes in the form of hash
82
+ # @return [Object] Returns the model itself
83
+ def self.build_from_hash(attributes)
84
+ return nil unless attributes.is_a?(Hash)
85
+ attributes = attributes.transform_keys(&:to_sym)
86
+ transformed_hash = {}
87
+ openapi_types.each_pair do |key, type|
88
+ if attributes.key?(key) && attributes[key].nil?
89
+ transformed_hash["#{key}"] = nil
90
+ elsif type =~ /\AArray<(.*)>/i
91
+ # check to ensure the input is an array given that the attribute
92
+ # is documented as an array but the input is not
93
+ if attributes[key].is_a?(Array)
94
+ transformed_hash["#{key}"] = attributes[key].map { |v| _deserialize($1, v) }
95
+ end
96
+ elsif !attributes[key].nil?
97
+ transformed_hash["#{key}"] = _deserialize(type, attributes[key])
98
+ end
99
+ end
100
+ new(transformed_hash)
101
+ end
102
+
103
+ # Deserializes the data based on type
104
+ # @param type [String] Data type
105
+ # @param value [String] Value to be deserialized
106
+ # @return [Object] Deserialized data
107
+ def self._deserialize(type, value)
108
+ case type.to_sym
109
+ when :Time
110
+ Time.parse(value)
111
+ when :Date
112
+ Date.parse(value)
113
+ when :String
114
+ value.to_s
115
+ when :Integer
116
+ value.to_i
117
+ when :Float
118
+ value.to_f
119
+ when :Boolean
120
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
121
+ true
122
+ else
123
+ false
124
+ end
125
+ when :Object
126
+ # generic object (usually a Hash), return directly
127
+ value
128
+ when /\AArray<(?<inner_type>.+)>\z/
129
+ inner_type = Regexp.last_match[:inner_type]
130
+ value.map { |v| _deserialize(inner_type, v) }
131
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
132
+ k_type = Regexp.last_match[:k_type]
133
+ v_type = Regexp.last_match[:v_type]
134
+ {}.tap do |hash|
135
+ value.each do |k, v|
136
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
137
+ end
138
+ end
139
+ else # model
140
+ klass = AftershipAPI::Model.const_get(type)
141
+ klass.build_from_hash(value)
142
+ end
143
+ end
144
+
145
+ # Returns the string representation of the object
146
+ # @return [String] String presentation of the object
147
+ def to_s
148
+ to_hash.to_s
149
+ end
150
+
151
+ # to_body is an alias to to_hash (backward compatibility)
152
+ # @return [Hash] Returns the object in the form of hash
153
+ def to_body
154
+ to_hash
155
+ end
156
+
157
+ # Returns the object in the form of hash
158
+ # @return [Hash] Returns the object in the form of hash
159
+ def to_hash
160
+ hash = {}
161
+ self.class.attribute_map.each_pair do |attr, param|
162
+ value = self.send(attr)
163
+ next if value.nil?
164
+
165
+ hash[param] = _to_hash(value)
166
+ end
167
+ hash
168
+ end
169
+
170
+ # Outputs non-array value in the form of hash
171
+ # For object, use to_hash. Otherwise, just return the value
172
+ # @param value [Object] Any valid value
173
+ # @return [Hash] Returns the value in the form of hash
174
+ def _to_hash(value)
175
+ if value.is_a?(Array)
176
+ value.compact.map { |v| _to_hash(v) }
177
+ elsif value.is_a?(Hash)
178
+ {}.tap do |hash|
179
+ value.each { |k, v| hash[k] = _to_hash(v) }
180
+ end
181
+ elsif value.respond_to? :to_hash
182
+ value.to_hash
183
+ else
184
+ value
185
+ end
186
+ end
187
+
188
+ def to_json(*a)
189
+ to_hash.to_json(*a)
190
+ end
191
+ end
192
+ end
193
+