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
@@ -33,7 +33,7 @@ module AftershipAPI
33
33
 
34
34
 
35
35
  # resource path
36
- local_var_path = "/tracking/2024-10/trackings"
36
+ local_var_path = "/tracking/2025-04/trackings"
37
37
  method = :'POST'
38
38
 
39
39
  # query parameters
@@ -85,7 +85,7 @@ module AftershipAPI
85
85
 
86
86
 
87
87
  # resource path
88
- local_var_path = "/tracking/2024-10/trackings/#{id}"
88
+ local_var_path = "/tracking/2025-04/trackings/#{id}"
89
89
  method = :'DELETE'
90
90
 
91
91
  # query parameters
@@ -120,7 +120,7 @@ module AftershipAPI
120
120
  # Get tracking results of a single tracking.
121
121
  # @param id [String] tracking ID
122
122
  # @param [Hash] opts the optional parameters
123
- # @option opts [String] :fields List of fields to include in the response. Use comma for multiple values. Fields to include: `tracking_postal_code`, `tracking_ship_date`, `tracking_account_number`, `tracking_key`, `tracking_origin_country`, `tracking_destination_country`, `tracking_state`, `title`, `order_id`, `tag`, `checkpoints`
123
+ # @option opts [String] :fields List of fields to include in the response. Use comma for multiple values. Fields to include: `destination_postal_code`, `tracking_ship_date`, `tracking_account_number`, `tracking_key`, `origin_country_region`, `destination_country_region`, `destination_state`, `title`, `order_id`, `tag`, `checkpoints`
124
124
  # @option opts [String] :lang Translate checkpoint messages from the carrier’s provided language to the target language. Supported target languages include:</br>&nbsp;&nbsp;&nbsp;&nbsp;- English (en)</br>&nbsp;&nbsp;&nbsp;&nbsp;- French (fr)</br>&nbsp;&nbsp;&nbsp;&nbsp;- French Canadian (fr-CA)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Arabic (ar)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Bulgarian (bg)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Catalan (ca)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Croatian (hr)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Czech (cs)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Danish (da)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Dutch (nl)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Estonian (et)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Filipino (tl)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Finnish (fi)</br>&nbsp;&nbsp;&nbsp;&nbsp;- German (de)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Greek (el)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Hebrew (he)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Hindi (hi)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Hungarian (hu)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Indonesian (id)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Italian (it)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Japanese (ja)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Korean (ko)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Latvian (lv)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Lithuanian (lt)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Malay (ms)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Polish (pl)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Portuguese (pt)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Romanian (ro)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Russian (ru)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Serbian (sr)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Slovak (sk)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Slovenian (sl)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Spanish (es)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Swedish (sv)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Thai (th)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Turkish (tr)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Ukrainian (uk)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Vietnamese (vi)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Simplified Chinese (zh-Hans)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Traditional Chinese (zh-Hant)</br>&nbsp;&nbsp;&nbsp;&nbsp;- Norwegian (nb)</br>
125
125
  # @return [Model::GetTrackingByIdResponse]
126
126
  def get_tracking_by_id(id:, opts: {})
@@ -139,7 +139,7 @@ module AftershipAPI
139
139
 
140
140
 
141
141
  # resource path
142
- local_var_path = "/tracking/2024-10/trackings/#{id}"
142
+ local_var_path = "/tracking/2025-04/trackings/#{id}"
143
143
  method = :'GET'
144
144
 
145
145
  # query parameters
@@ -177,20 +177,20 @@ module AftershipAPI
177
177
  # @param [Hash] opts the optional parameters
178
178
  # @option opts [String] :cursor A string representing the cursor value for the current page of results.
179
179
  # @option opts [Integer] :limit Number of trackings each page contain. (Default: 100, Max: 200)
180
- # @option opts [String] :keyword Search the content of the tracking record fields: `tracking_number`, `title`, `order_id`, `customer_name`, `custom_fields`, `emails`, `smses`
180
+ # @option opts [String] :keyword Search the content of the tracking record fields: `tracking_number`, `title`, `order_id`, `customers[x].name`, `custom_fields`, `customers[x].email`, `customers[x].phone_number`
181
181
  # @option opts [String] :tracking_numbers Tracking number of shipments. Use comma to separate multiple values (Example: RA123456789US,LE123456789US). Supports up to 50 tracking numbers.
182
182
  # @option opts [String] :slug Unique courier code Use comma for multiple values. (Example: dhl,ups,usps)
183
183
  # @option opts [Integer] :transit_time Total delivery time in days.- When the shipment is delivered: Transit time = Delivered date - Picked up date- When the shipment is not delivered: Transit time = Current date - Picked up dateValue as `null` for the shipment without pickup date.
184
184
  # @option opts [String] :origin Origin country/region of trackings. Use ISO Alpha-3 (three letters). Use comma for multiple values. (Example: USA,HKG)
185
185
  # @option opts [String] :destination Destination country/region of trackings. Use ISO Alpha-3 (three letters). Use comma for multiple values. (Example: USA,HKG)
186
186
  # @option opts [String] :tag Current status of tracking. Values include `Pending`, `InfoReceived`, `InTransit`, `OutForDelivery`, `AttemptFail`, `Delivered`, `AvailableForPickup`, `Exception`, `Expired` (See tag definition)
187
- # @option opts [String] :created_at_min Start date and time of trackings created. AfterShip only stores data of 120 days.(Defaults: 30 days ago, Example: 2013-03-15T16:41:56+08:00)
188
- # @option opts [String] :created_at_max End date and time of trackings created.(Defaults: now, Example: 2013-04-15T16:41:56+08:00)
189
- # @option opts [String] :updated_at_min Start date and time of trackings updated. (Example: 2013-04-15T16:41:56+08:00)
190
- # @option opts [String] :updated_at_max End date and time of trackings updated. (Example: 2013-04-15T16:41:56+08:00)
187
+ # @option opts [String] :created_at_min Start date and time of trackings created. AfterShip only stores data of 120 days. Please make sure the value of the parameter is properly escaped in
188
+ # @option opts [String] :created_at_max End date and time of trackings created. Please make sure the value of the parameter is properly escaped in
189
+ # @option opts [String] :updated_at_min Start date and time of trackings updated. Please make sure the value of the parameter is properly escaped in
190
+ # @option opts [String] :updated_at_max End date and time of trackings updated. Please make sure the value of the parameter is properly escaped in
191
191
  # @option opts [String] :fields List of fields to include in the response. Use comma for multiple values. Available options: `title`, `order_id`, `tag`, `checkpoints`. Example: `title,order_id`
192
192
  # @option opts [String] :return_to_sender Select return to sender, the value should be `true` or `false`, with optional comma separated.
193
- # @option opts [String] :courier_destination_country_iso3 Destination country/region of trackings returned by courier. Use ISO Alpha-3 (three letters). Use comma for multiple values. (Example: USA,HKG)
193
+ # @option opts [String] :courier_destination_country_region Destination country/region of trackings returned by courier. Use ISO Alpha-3 (three letters). Use comma for multiple values. (Example: USA,HKG)
194
194
  # @option opts [String] :shipment_tags Tags you added to your shipments to help categorize and filter them easily. Use a comma to separate multiple values (Example: a,b)
195
195
  # @option opts [String] :order_id A globally-unique identifier for the order. Use comma for multiple values.(Example: 6845a095a27a4caeb27487806f058add,4845a095a27a4caeb27487806f058abc)
196
196
  # @return [Model::GetTrackingsResponse]
@@ -207,7 +207,7 @@ module AftershipAPI
207
207
 
208
208
 
209
209
  # resource path
210
- local_var_path = "/tracking/2024-10/trackings"
210
+ local_var_path = "/tracking/2025-04/trackings"
211
211
  method = :'GET'
212
212
 
213
213
  # query parameters
@@ -227,7 +227,7 @@ module AftershipAPI
227
227
  query_params[:'updated_at_max'] = opts[:'updated_at_max'] if !opts[:'updated_at_max'].nil?
228
228
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
229
229
  query_params[:'return_to_sender'] = opts[:'return_to_sender'] if !opts[:'return_to_sender'].nil?
230
- query_params[:'courier_destination_country_iso3'] = opts[:'courier_destination_country_iso3'] if !opts[:'courier_destination_country_iso3'].nil?
230
+ query_params[:'courier_destination_country_region'] = opts[:'courier_destination_country_region'] if !opts[:'courier_destination_country_region'].nil?
231
231
  query_params[:'shipment_tags'] = opts[:'shipment_tags'] if !opts[:'shipment_tags'].nil?
232
232
  query_params[:'order_id'] = opts[:'order_id'] if !opts[:'order_id'].nil?
233
233
  # header parameters
@@ -245,8 +245,8 @@ module AftershipAPI
245
245
  :query_params => query_params,
246
246
  :body => post_body,
247
247
  :return_type => return_type,
248
- :response_legacy_tag => "",
249
- :is_paging => false
248
+ :response_legacy_tag => "trackings",
249
+ :is_paging => true
250
250
  )
251
251
 
252
252
  data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
@@ -283,7 +283,7 @@ module AftershipAPI
283
283
 
284
284
 
285
285
  # resource path
286
- local_var_path = "/tracking/2024-10/trackings/#{id}/mark-as-completed"
286
+ local_var_path = "/tracking/2025-04/trackings/#{id}/mark-as-completed"
287
287
  method = :'POST'
288
288
 
289
289
  # query parameters
@@ -335,7 +335,7 @@ module AftershipAPI
335
335
 
336
336
 
337
337
  # resource path
338
- local_var_path = "/tracking/2024-10/trackings/#{id}/retrack"
338
+ local_var_path = "/tracking/2025-04/trackings/#{id}/retrack"
339
339
  method = :'POST'
340
340
 
341
341
  # query parameters
@@ -393,7 +393,7 @@ module AftershipAPI
393
393
 
394
394
 
395
395
  # resource path
396
- local_var_path = "/tracking/2024-10/trackings/#{id}"
396
+ local_var_path = "/tracking/2025-04/trackings/#{id}"
397
397
  method = :'PUT'
398
398
 
399
399
  # query parameters
@@ -2,16 +2,16 @@
2
2
  # Do not edit the class manually.
3
3
 
4
4
  module AftershipAPI::Model
5
- class AdditionalFieldsV1
5
+ class AdditionalFields
6
6
  TRACKING_ACCOUNT_NUMBER = "tracking_account_number".freeze
7
- TRACKING_POSTAL_CODE = "tracking_postal_code".freeze
8
- TRACKING_SHIP_DATE = "tracking_ship_date".freeze
7
+ DESTINATION_POSTAL_CODE = "destination_postal_code".freeze
8
+ DESTINATION_STATE = "destination_state".freeze
9
9
  TRACKING_KEY = "tracking_key".freeze
10
- TRACKING_ORIGIN_COUNTRY = "tracking_origin_country".freeze
11
- TRACKING_DESTINATION_COUNTRY = "tracking_destination_country".freeze
12
- TRACKING_STATE = "tracking_state".freeze
10
+ ORIGIN_COUNTRY_REGION = "origin_country_region".freeze
11
+ DESTINATION_COUNTRY_REGION = "destination_country_region".freeze
12
+ TRACKING_SHIP_DATE = "tracking_ship_date".freeze
13
13
  def self.all_vars
14
- @all_vars ||= [TRACKING_ACCOUNT_NUMBER,TRACKING_POSTAL_CODE,TRACKING_SHIP_DATE,TRACKING_KEY,TRACKING_ORIGIN_COUNTRY,TRACKING_DESTINATION_COUNTRY,TRACKING_STATE,].freeze
14
+ @all_vars ||= [TRACKING_ACCOUNT_NUMBER,DESTINATION_POSTAL_CODE,DESTINATION_STATE,TRACKING_KEY,ORIGIN_COUNTRY_REGION,DESTINATION_COUNTRY_REGION,TRACKING_SHIP_DATE,].freeze
15
15
  end
16
16
 
17
17
  # Builds the enum from string
@@ -25,8 +25,8 @@ module AftershipAPI::Model
25
25
  # @param value [String] The enum value in the form of the string
26
26
  # @return [String] The enum value
27
27
  def build_from_hash(value)
28
- return value if AdditionalFieldsV1.all_vars.include?(value)
29
- raise "Invalid ENUM value #{value} for class #AdditionalFieldsV1"
28
+ return value if AdditionalFields.all_vars.include?(value)
29
+ raise "Invalid ENUM value #{value} for class #AdditionalFields"
30
30
  end
31
31
  end
32
32
  end
@@ -36,19 +36,19 @@ module AftershipAPI::Model
36
36
  attr_accessor :coordinate
37
37
 
38
38
  # Country/Region ISO Alpha-3 (three letters) of the checkpoint
39
- # country_iso3?: String;
40
- attr_accessor :country_iso3
39
+ # country_region?: String;
40
+ attr_accessor :country_region
41
41
 
42
42
  # Country/Region name of the checkpoint, may also contain other location info.
43
- # country_name?: String;
44
- attr_accessor :country_name
43
+ # country_region_name?: String;
44
+ attr_accessor :country_region_name
45
45
 
46
46
  # Checkpoint message
47
47
  # message?: String;
48
48
  attr_accessor :message
49
49
 
50
50
  # Current status of tracking. (
51
- # tag?: TagV1;
51
+ # tag?: Tag;
52
52
  attr_accessor :tag
53
53
 
54
54
  # Current subtag of checkpoint. (
@@ -67,6 +67,10 @@ module AftershipAPI::Model
67
67
  # events?: EventsCheckpoint[];
68
68
  attr_accessor :events
69
69
 
70
+ # The source of the checkpoint, which can either be from the carrier or when the user marks the tracking as completed.
71
+ # source?: String;
72
+ attr_accessor :source
73
+
70
74
  # Initializes the object
71
75
  # @param [Hash] attributes Model attributes in the form of hash
72
76
  def initialize(attributes = {})
@@ -110,12 +114,12 @@ module AftershipAPI::Model
110
114
  self.coordinate = attributes[:'coordinate']
111
115
  end
112
116
 
113
- if attributes.key?(:'country_iso3')
114
- self.country_iso3 = attributes[:'country_iso3']
117
+ if attributes.key?(:'country_region')
118
+ self.country_region = attributes[:'country_region']
115
119
  end
116
120
 
117
- if attributes.key?(:'country_name')
118
- self.country_name = attributes[:'country_name']
121
+ if attributes.key?(:'country_region_name')
122
+ self.country_region_name = attributes[:'country_region_name']
119
123
  end
120
124
 
121
125
  if attributes.key?(:'message')
@@ -141,6 +145,10 @@ module AftershipAPI::Model
141
145
  if attributes.key?(:'events')
142
146
  self.events = attributes[:'events']
143
147
  end
148
+
149
+ if attributes.key?(:'source')
150
+ self.source = attributes[:'source']
151
+ end
144
152
  end
145
153
 
146
154
  # Attribute type mapping.
@@ -154,14 +162,15 @@ module AftershipAPI::Model
154
162
  :'state' => :'String',
155
163
  :'zip' => :'String',
156
164
  :'coordinate' => :'CoordinateCheckpoint',
157
- :'country_iso3' => :'String',
158
- :'country_name' => :'String',
165
+ :'country_region' => :'String',
166
+ :'country_region_name' => :'String',
159
167
  :'message' => :'String',
160
- :'tag' => :'TagV1',
168
+ :'tag' => :'Tag',
161
169
  :'subtag' => :'String',
162
170
  :'subtag_message' => :'String',
163
171
  :'raw_tag' => :'String',
164
172
  :'events' => :'Array<EventsCheckpoint>',
173
+ :'source' => :'String',
165
174
  }
166
175
  end
167
176
 
@@ -176,14 +185,15 @@ module AftershipAPI::Model
176
185
  :'state' => :'state',
177
186
  :'zip' => :'zip',
178
187
  :'coordinate' => :'coordinate',
179
- :'country_iso3' => :'country_iso3',
180
- :'country_name' => :'country_name',
188
+ :'country_region' => :'country_region',
189
+ :'country_region_name' => :'country_region_name',
181
190
  :'message' => :'message',
182
191
  :'tag' => :'tag',
183
192
  :'subtag' => :'subtag',
184
193
  :'subtag_message' => :'subtag_message',
185
194
  :'raw_tag' => :'raw_tag',
186
195
  :'events' => :'events',
196
+ :'source' => :'source',
187
197
  }
188
198
  end
189
199
 
@@ -23,7 +23,7 @@ module AftershipAPI::Model
23
23
  # web_url?: String;
24
24
  attr_accessor :web_url
25
25
 
26
- # The extra fields need for tracking, such as `tracking_account_number`, `tracking_postal_code`, `tracking_ship_date`, `tracking_key`, `tracking_destination_country`
26
+ # The extra fields need for tracking, such as `tracking_account_number`, `tracking_postal_code`, `tracking_ship_date`, `tracking_key`, `tracking_destination_country_region`
27
27
  # required_fields?: String[];
28
28
  attr_accessor :required_fields
29
29
 
@@ -40,8 +40,12 @@ module AftershipAPI::Model
40
40
  attr_accessor :support_languages
41
41
 
42
42
  # Country/Region code (ISO Alpha-3) where the courier provides service
43
- # service_from_country_iso3?: String[];
44
- attr_accessor :service_from_country_iso3
43
+ # service_from_country_regions?: String[];
44
+ attr_accessor :service_from_country_regions
45
+
46
+ # Refers to the authentication details required for each specific carrier (such as API keys, username, password, etc.) that the user must provide to create a carrier connection. The content varies by carrier.
47
+ # credentials?: CredentialsCourier;
48
+ attr_accessor :credentials
45
49
 
46
50
  # Initializes the object
47
51
  # @param [Hash] attributes Model attributes in the form of hash
@@ -90,8 +94,12 @@ module AftershipAPI::Model
90
94
  self.support_languages = attributes[:'support_languages']
91
95
  end
92
96
 
93
- if attributes.key?(:'service_from_country_iso3')
94
- self.service_from_country_iso3 = attributes[:'service_from_country_iso3']
97
+ if attributes.key?(:'service_from_country_regions')
98
+ self.service_from_country_regions = attributes[:'service_from_country_regions']
99
+ end
100
+
101
+ if attributes.key?(:'credentials')
102
+ self.credentials = attributes[:'credentials']
95
103
  end
96
104
  end
97
105
 
@@ -107,7 +115,8 @@ module AftershipAPI::Model
107
115
  :'optional_fields' => :'Array<String>',
108
116
  :'default_language' => :'String',
109
117
  :'support_languages' => :'Array<String>',
110
- :'service_from_country_iso3' => :'Array<String>',
118
+ :'service_from_country_regions' => :'Array<String>',
119
+ :'credentials' => :'CredentialsCourier',
111
120
  }
112
121
  end
113
122
 
@@ -123,7 +132,8 @@ module AftershipAPI::Model
123
132
  :'optional_fields' => :'optional_fields',
124
133
  :'default_language' => :'default_language',
125
134
  :'support_languages' => :'support_languages',
126
- :'service_from_country_iso3' => :'service_from_country_iso3',
135
+ :'service_from_country_regions' => :'service_from_country_regions',
136
+ :'credentials' => :'credentials',
127
137
  }
128
138
  end
129
139
 
@@ -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 CourierConnection
5
+
6
+ # The courier connection ID is a special set of numbers generated by AfterShip to define each user-created connection.
7
+ # id?: String;
8
+ attr_accessor :id
9
+
10
+ # Unique courier code. Get courier codes .
11
+ # courier_slug?: String;
12
+ attr_accessor :courier_slug
13
+
14
+ # It refers to the authentication details required for each specific carrier details required for each specific carrier (such as API keys, username, password, etc.) that the user must provide to establish a carrier connection. The content varies by carrier.
15
+ # credentials?: Object;
16
+ attr_accessor :credentials
17
+
18
+ # The date and time the courier connection was created. It uses the format YYYY-MM-DDTHH:mm:ssZ for the timezone GMT +0.
19
+ # created_at?: String;
20
+ attr_accessor :created_at
21
+
22
+ # The date and time the courier connection was updated. It uses the format YYYY-MM-DDTHH:mm:ssZ for the timezone GMT +0.
23
+ # updated_at?: String;
24
+ attr_accessor :updated_at
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::CourierConnection` 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?(:'id')
38
+ self.id = attributes[:'id']
39
+ end
40
+
41
+ if attributes.key?(:'courier_slug')
42
+ self.courier_slug = attributes[:'courier_slug']
43
+ end
44
+
45
+ if attributes.key?(:'credentials')
46
+ self.credentials = attributes[:'credentials']
47
+ end
48
+
49
+ if attributes.key?(:'created_at')
50
+ self.created_at = attributes[:'created_at']
51
+ end
52
+
53
+ if attributes.key?(:'updated_at')
54
+ self.updated_at = attributes[:'updated_at']
55
+ end
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'id' => :'String',
62
+ :'courier_slug' => :'String',
63
+ :'credentials' => :'Object',
64
+ :'created_at' => :'String',
65
+ :'updated_at' => :'String',
66
+ }
67
+ end
68
+
69
+ # Attribute mapping from ruby-style variable name to JSON key.
70
+ def self.attribute_map
71
+ {
72
+ :'id' => :'id',
73
+ :'courier_slug' => :'courier_slug',
74
+ :'credentials' => :'credentials',
75
+ :'created_at' => :'created_at',
76
+ :'updated_at' => :'updated_at',
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
+
@@ -0,0 +1,163 @@
1
+ # This code was auto generated by AfterShip SDK Generator.
2
+ # Do not edit the class manually.
3
+ module AftershipAPI::Model
4
+ class CourierConnectionResponseForGetCourierConnections
5
+
6
+ # Meta data
7
+ # meta: Meta;
8
+ attr_accessor :meta
9
+
10
+ #
11
+ # data?: DataCourierConnectionResponseForGetCourierConnections;
12
+ attr_accessor :data
13
+
14
+ # Initializes the object
15
+ # @param [Hash] attributes Model attributes in the form of hash
16
+ def initialize(attributes = {})
17
+ if (!attributes.is_a?(Hash))
18
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AftershipAPI::CourierConnectionResponseForGetCourierConnections` initialize method"
19
+ end
20
+
21
+ attributes = attributes.each_with_object({}) { |(k, v), h|
22
+ h[k.to_sym] = v
23
+ }
24
+
25
+ if attributes.key?(:'meta')
26
+ self.meta = attributes[:'meta']
27
+ end
28
+
29
+ if attributes.key?(:'data')
30
+ self.data = attributes[:'data']
31
+ end
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.openapi_types
36
+ {
37
+ :'meta' => :'Meta',
38
+ :'data' => :'DataCourierConnectionResponseForGetCourierConnections',
39
+ }
40
+ end
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'meta' => :'meta',
46
+ :'data' => :'data',
47
+ }
48
+ end
49
+
50
+ # Builds the object from hash
51
+ # @param attributes [Hash] Model attributes in the form of hash
52
+ # @return [Object] Returns the model itself
53
+ def self.build_from_hash(attributes)
54
+ return nil unless attributes.is_a?(Hash)
55
+ attributes = attributes.transform_keys(&:to_sym)
56
+ transformed_hash = {}
57
+ openapi_types.each_pair do |key, type|
58
+ if attributes.key?(key) && attributes[key].nil?
59
+ transformed_hash["#{key}"] = nil
60
+ elsif type =~ /\AArray<(.*)>/i
61
+ # check to ensure the input is an array given that the attribute
62
+ # is documented as an array but the input is not
63
+ if attributes[key].is_a?(Array)
64
+ transformed_hash["#{key}"] = attributes[key].map { |v| _deserialize($1, v) }
65
+ end
66
+ elsif !attributes[key].nil?
67
+ transformed_hash["#{key}"] = _deserialize(type, attributes[key])
68
+ end
69
+ end
70
+ new(transformed_hash)
71
+ end
72
+
73
+ # Deserializes the data based on type
74
+ # @param type [String] Data type
75
+ # @param value [String] Value to be deserialized
76
+ # @return [Object] Deserialized data
77
+ def self._deserialize(type, value)
78
+ case type.to_sym
79
+ when :Time
80
+ Time.parse(value)
81
+ when :Date
82
+ Date.parse(value)
83
+ when :String
84
+ value.to_s
85
+ when :Integer
86
+ value.to_i
87
+ when :Float
88
+ value.to_f
89
+ when :Boolean
90
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
91
+ true
92
+ else
93
+ false
94
+ end
95
+ when :Object
96
+ # generic object (usually a Hash), return directly
97
+ value
98
+ when /\AArray<(?<inner_type>.+)>\z/
99
+ inner_type = Regexp.last_match[:inner_type]
100
+ value.map { |v| _deserialize(inner_type, v) }
101
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
102
+ k_type = Regexp.last_match[:k_type]
103
+ v_type = Regexp.last_match[:v_type]
104
+ {}.tap do |hash|
105
+ value.each do |k, v|
106
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
107
+ end
108
+ end
109
+ else # model
110
+ klass = AftershipAPI::Model.const_get(type)
111
+ klass.build_from_hash(value)
112
+ end
113
+ end
114
+
115
+ # Returns the string representation of the object
116
+ # @return [String] String presentation of the object
117
+ def to_s
118
+ to_hash.to_s
119
+ end
120
+
121
+ # to_body is an alias to to_hash (backward compatibility)
122
+ # @return [Hash] Returns the object in the form of hash
123
+ def to_body
124
+ to_hash
125
+ end
126
+
127
+ # Returns the object in the form of hash
128
+ # @return [Hash] Returns the object in the form of hash
129
+ def to_hash
130
+ hash = {}
131
+ self.class.attribute_map.each_pair do |attr, param|
132
+ value = self.send(attr)
133
+ next if value.nil?
134
+
135
+ hash[param] = _to_hash(value)
136
+ end
137
+ hash
138
+ end
139
+
140
+ # Outputs non-array value in the form of hash
141
+ # For object, use to_hash. Otherwise, just return the value
142
+ # @param value [Object] Any valid value
143
+ # @return [Hash] Returns the value in the form of hash
144
+ def _to_hash(value)
145
+ if value.is_a?(Array)
146
+ value.compact.map { |v| _to_hash(v) }
147
+ elsif value.is_a?(Hash)
148
+ {}.tap do |hash|
149
+ value.each { |k, v| hash[k] = _to_hash(v) }
150
+ end
151
+ elsif value.respond_to? :to_hash
152
+ value.to_hash
153
+ else
154
+ value
155
+ end
156
+ end
157
+
158
+ def to_json(*a)
159
+ to_hash.to_json(*a)
160
+ end
161
+ end
162
+ end
163
+