aftership-tracking-sdk 8.0.0 → 9.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/README.md +4 -3
- data/lib/aftership-tracking-sdk/api/courier.rb +6 -6
- data/lib/aftership-tracking-sdk/api/estimated_delivery_date.rb +4 -4
- data/lib/aftership-tracking-sdk/api/tracking.rb +23 -389
- data/lib/aftership-tracking-sdk/api_client.rb +2 -2
- data/lib/aftership-tracking-sdk/configuration.rb +108 -108
- data/lib/aftership-tracking-sdk/models/additional_fields_v1.rb +1 -1
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_create_tracking_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_delete_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_get_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_mark_tracking_completed_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_retrack_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_tracking.rb +2 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_update_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_create_tracking_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_delete_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_get_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_mark_tracking_completed_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_retrack_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_tracking.rb +2 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_update_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/checkpoint.rb +2 -0
- data/lib/aftership-tracking-sdk/models/coordinate_checkpoint.rb +2 -0
- data/lib/aftership-tracking-sdk/models/courier.rb +2 -0
- data/lib/aftership-tracking-sdk/models/{aftership_estimated_delivery_date_get_tracking_by_slug_tracking_number_response.rb → courier_estimated_delivery_date_create_tracking_response.rb} +7 -15
- data/lib/aftership-tracking-sdk/models/{aftership_estimated_delivery_date_retrack_tracking_by_slug_tracking_number_response.rb → courier_estimated_delivery_date_delete_tracking_by_id_response.rb} +7 -15
- data/lib/aftership-tracking-sdk/models/{aftership_estimated_delivery_date_mark_tracking_completed_by_slug_tracking_number_response.rb → courier_estimated_delivery_date_get_tracking_by_id_response.rb} +7 -15
- data/lib/aftership-tracking-sdk/models/courier_estimated_delivery_date_mark_tracking_completed_by_id_response.rb +173 -0
- data/lib/aftership-tracking-sdk/models/courier_estimated_delivery_date_retrack_tracking_by_id_response.rb +173 -0
- data/lib/aftership-tracking-sdk/models/{aftership_estimated_delivery_date_delete_tracking_by_slug_tracking_number_response.rb → courier_estimated_delivery_date_tracking.rb} +7 -15
- data/lib/aftership-tracking-sdk/models/courier_estimated_delivery_date_update_tracking_by_id_response.rb +173 -0
- data/lib/aftership-tracking-sdk/models/courier_response_v1.rb +2 -0
- data/lib/aftership-tracking-sdk/models/create_tracking_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/create_tracking_response.rb +29 -7
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_create_tracking_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_delete_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_get_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_mark_tracking_completed_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_retrack_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_tracking.rb +2 -0
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_update_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/data_courier_response_v1.rb +2 -0
- data/lib/aftership-tracking-sdk/models/data_tracking_response_get_multiple_v1.rb +8 -126
- data/lib/aftership-tracking-sdk/models/delete_tracking_by_id_response.rb +29 -7
- data/lib/aftership-tracking-sdk/models/destination_address_estimated_delivery_date_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/destination_address_estimated_delivery_date_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/detect_courier_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/detect_courier_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/estimated_delivery_date_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/estimated_delivery_date_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/estimated_pickup_estimated_delivery_date_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/estimated_pickup_estimated_delivery_date_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/events_checkpoint.rb +2 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_create_tracking_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_delete_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_get_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_mark_tracking_completed_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_retrack_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_tracking.rb +2 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_update_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/get_all_couriers_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb +29 -7
- data/lib/aftership-tracking-sdk/models/get_trackings_response.rb +5 -3
- data/lib/aftership-tracking-sdk/models/get_user_couriers_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_create_tracking_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_delete_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_get_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_mark_tracking_completed_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_retrack_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_tracking.rb +2 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_update_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/mark_tracking_completed_by_id_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/mark_tracking_completed_by_id_response.rb +29 -7
- data/lib/aftership-tracking-sdk/models/meta_v1.rb +2 -0
- data/lib/aftership-tracking-sdk/models/next_couriers_create_tracking_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/next_couriers_create_tracking_response.rb +22 -0
- data/lib/aftership-tracking-sdk/models/next_couriers_delete_tracking_by_id_response.rb +22 -0
- data/lib/aftership-tracking-sdk/models/next_couriers_get_tracking_by_id_response.rb +22 -0
- data/lib/aftership-tracking-sdk/models/next_couriers_mark_tracking_completed_by_id_response.rb +22 -0
- data/lib/aftership-tracking-sdk/models/next_couriers_retrack_tracking_by_id_response.rb +22 -0
- data/lib/aftership-tracking-sdk/models/next_couriers_tracking.rb +22 -0
- data/lib/aftership-tracking-sdk/models/next_couriers_update_tracking_by_id_response.rb +22 -0
- data/lib/aftership-tracking-sdk/models/order_processing_time_estimated_pickup_estimated_delivery_date_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/order_processing_time_estimated_pickup_estimated_delivery_date_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/origin_address_estimated_delivery_date_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/origin_address_estimated_delivery_date_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/pagination.rb +14 -6
- data/lib/aftership-tracking-sdk/models/{next_couriers_get_tracking_by_slug_tracking_number_response.rb → pagination_data_tracking_response_get_multiple_v1.rb} +25 -23
- data/lib/aftership-tracking-sdk/models/{next_couriers_delete_tracking_by_slug_tracking_number_response.rb → pagination_get_trackings_response.rb} +25 -23
- data/lib/aftership-tracking-sdk/models/predict_batch_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/predict_batch_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/reason_events_checkpoint.rb +2 -0
- data/lib/aftership-tracking-sdk/models/retrack_tracking_by_id_response.rb +29 -7
- data/lib/aftership-tracking-sdk/models/shipment_weight_create_tracking_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/shipment_weight_delete_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/shipment_weight_get_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/shipment_weight_mark_tracking_completed_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/shipment_weight_retrack_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/shipment_weight_tracking.rb +2 -0
- data/lib/aftership-tracking-sdk/models/shipment_weight_update_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/slug_group_v1.rb +1 -1
- data/lib/aftership-tracking-sdk/models/tag_v1.rb +1 -1
- data/lib/aftership-tracking-sdk/models/tracking.rb +29 -7
- data/lib/aftership-tracking-sdk/models/tracking_response_get_multiple_v1.rb +2 -0
- data/lib/aftership-tracking-sdk/models/tracking_response_v1.rb +2 -0
- data/lib/aftership-tracking-sdk/models/update_tracking_by_id_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/update_tracking_by_id_response.rb +29 -7
- data/lib/aftership-tracking-sdk/models/weight_estimated_delivery_date_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/weight_estimated_delivery_date_response.rb +2 -0
- data/lib/aftership-tracking-sdk/version.rb +1 -1
- metadata +11 -45
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_update_tracking_by_slug_tracking_number_response.rb +0 -181
- data/lib/aftership-tracking-sdk/models/carbon_emissions_delete_tracking_by_slug_tracking_number_response.rb +0 -161
- data/lib/aftership-tracking-sdk/models/carbon_emissions_get_tracking_by_slug_tracking_number_response.rb +0 -161
- data/lib/aftership-tracking-sdk/models/carbon_emissions_mark_tracking_completed_by_slug_tracking_number_response.rb +0 -161
- data/lib/aftership-tracking-sdk/models/carbon_emissions_retrack_tracking_by_slug_tracking_number_response.rb +0 -161
- data/lib/aftership-tracking-sdk/models/carbon_emissions_update_tracking_by_slug_tracking_number_response.rb +0 -161
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_delete_tracking_by_slug_tracking_number_response.rb +0 -181
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_get_tracking_by_slug_tracking_number_response.rb +0 -181
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_mark_tracking_completed_by_slug_tracking_number_response.rb +0 -181
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_retrack_tracking_by_slug_tracking_number_response.rb +0 -181
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_update_tracking_by_slug_tracking_number_response.rb +0 -181
- data/lib/aftership-tracking-sdk/models/custom_fields_update_tracking_by_slug_tracking_number_request.rb +0 -139
- data/lib/aftership-tracking-sdk/models/delete_tracking_by_slug_tracking_number_response.rb +0 -931
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_delete_tracking_by_slug_tracking_number_response.rb +0 -191
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_get_tracking_by_slug_tracking_number_response.rb +0 -191
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_mark_tracking_completed_by_slug_tracking_number_response.rb +0 -191
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_retrack_tracking_by_slug_tracking_number_response.rb +0 -191
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_update_tracking_by_slug_tracking_number_response.rb +0 -191
- data/lib/aftership-tracking-sdk/models/get_tracking_by_slug_tracking_number_response.rb +0 -931
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_delete_tracking_by_slug_tracking_number_response.rb +0 -191
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_get_tracking_by_slug_tracking_number_response.rb +0 -191
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_mark_tracking_completed_by_slug_tracking_number_response.rb +0 -191
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_retrack_tracking_by_slug_tracking_number_response.rb +0 -191
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_update_tracking_by_slug_tracking_number_response.rb +0 -191
- data/lib/aftership-tracking-sdk/models/mark_tracking_completed_by_slug_tracking_number_request.rb +0 -151
- data/lib/aftership-tracking-sdk/models/mark_tracking_completed_by_slug_tracking_number_response.rb +0 -931
- data/lib/aftership-tracking-sdk/models/next_couriers_mark_tracking_completed_by_slug_tracking_number_response.rb +0 -171
- data/lib/aftership-tracking-sdk/models/next_couriers_retrack_tracking_by_slug_tracking_number_response.rb +0 -171
- data/lib/aftership-tracking-sdk/models/next_couriers_update_tracking_by_slug_tracking_number_response.rb +0 -171
- data/lib/aftership-tracking-sdk/models/retrack_tracking_by_slug_tracking_number_response.rb +0 -931
- data/lib/aftership-tracking-sdk/models/shipment_weight_delete_tracking_by_slug_tracking_number_response.rb +0 -161
- data/lib/aftership-tracking-sdk/models/shipment_weight_get_tracking_by_slug_tracking_number_response.rb +0 -161
- data/lib/aftership-tracking-sdk/models/shipment_weight_mark_tracking_completed_by_slug_tracking_number_response.rb +0 -161
- data/lib/aftership-tracking-sdk/models/shipment_weight_retrack_tracking_by_slug_tracking_number_response.rb +0 -161
- data/lib/aftership-tracking-sdk/models/shipment_weight_update_tracking_by_slug_tracking_number_response.rb +0 -161
- data/lib/aftership-tracking-sdk/models/update_tracking_by_slug_tracking_number_request.rb +0 -391
- data/lib/aftership-tracking-sdk/models/update_tracking_by_slug_tracking_number_response.rb +0 -931
@@ -16,9 +16,9 @@ module AftershipAPI
|
|
16
16
|
# @param body [Model::CreateTrackingRequest]
|
17
17
|
# @param [Hash] opts the optional parameters
|
18
18
|
# @return [Model::CreateTrackingResponse]
|
19
|
-
def create_tracking(body:,
|
19
|
+
def create_tracking(body:,opts: {})
|
20
20
|
if "" != ""
|
21
|
-
body = {
|
21
|
+
body = {:'' => body}
|
22
22
|
end
|
23
23
|
opts[:body] = body
|
24
24
|
data, _status_code, _headers = create_tracking_with_http_info(opts: opts)
|
@@ -33,7 +33,7 @@ module AftershipAPI
|
|
33
33
|
|
34
34
|
|
35
35
|
# resource path
|
36
|
-
local_var_path = "/tracking/2024-
|
36
|
+
local_var_path = "/tracking/2024-10/trackings"
|
37
37
|
method = :'POST'
|
38
38
|
|
39
39
|
# query parameters
|
@@ -70,7 +70,7 @@ module AftershipAPI
|
|
70
70
|
# @param [Hash] opts the optional parameters
|
71
71
|
# @return [Model::DeleteTrackingByIdResponse]
|
72
72
|
def delete_tracking_by_id(id:, opts: {})
|
73
|
-
data, _status_code, _headers = delete_tracking_by_id_with_http_info(id:
|
73
|
+
data, _status_code, _headers = delete_tracking_by_id_with_http_info(id:id, opts: opts)
|
74
74
|
data
|
75
75
|
end
|
76
76
|
|
@@ -85,7 +85,7 @@ module AftershipAPI
|
|
85
85
|
|
86
86
|
|
87
87
|
# resource path
|
88
|
-
local_var_path = "/tracking/2024-
|
88
|
+
local_var_path = "/tracking/2024-10/trackings/#{id}"
|
89
89
|
method = :'DELETE'
|
90
90
|
|
91
91
|
# query parameters
|
@@ -116,76 +116,6 @@ module AftershipAPI
|
|
116
116
|
return data, status_code, headers
|
117
117
|
end
|
118
118
|
|
119
|
-
# delete_tracking_by_slug_tracking_number
|
120
|
-
# Delete a tracking.<b style="color:#FF0000">(This endpoint will be deprecated in version 2024-10)</b>
|
121
|
-
# @param slug [String] Tracking slug
|
122
|
-
# @param tracking_number [String] Tracking number
|
123
|
-
# @param [Hash] opts the optional parameters
|
124
|
-
# @option opts [String] :tracking_account_number Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
|
125
|
-
# @option opts [String] :tracking_origin_country 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.
|
126
|
-
# @option opts [String] :tracking_destination_country 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.
|
127
|
-
# @option opts [String] :tracking_key Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
|
128
|
-
# @option opts [String] :tracking_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.
|
129
|
-
# @option opts [String] :tracking_ship_date 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.
|
130
|
-
# @option opts [String] :tracking_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.
|
131
|
-
# @return [Model::DeleteTrackingBySlugTrackingNumberResponse]
|
132
|
-
def delete_tracking_by_slug_tracking_number(slug:, tracking_number:, opts: {})
|
133
|
-
data, _status_code, _headers = delete_tracking_by_slug_tracking_number_with_http_info(slug: slug, tracking_number: tracking_number, opts: opts)
|
134
|
-
data
|
135
|
-
end
|
136
|
-
|
137
|
-
def delete_tracking_by_slug_tracking_number_with_http_info(slug:, tracking_number:, opts: {})
|
138
|
-
if @api_client.config.debugging
|
139
|
-
@api_client.config.logger.debug 'Calling API: TrackingApi.delete_tracking_by_slug_tracking_number ...'
|
140
|
-
end
|
141
|
-
|
142
|
-
if slug.nil? or slug.to_s == ''
|
143
|
-
raise InvalidParamError.new "slug cannot be nil or empty"
|
144
|
-
end
|
145
|
-
if tracking_number.nil? or tracking_number.to_s == ''
|
146
|
-
raise InvalidParamError.new "tracking_number cannot be nil or empty"
|
147
|
-
end
|
148
|
-
|
149
|
-
|
150
|
-
# resource path
|
151
|
-
local_var_path = "/tracking/2024-07/trackings/#{slug}/#{tracking_number}"
|
152
|
-
method = :'DELETE'
|
153
|
-
|
154
|
-
# query parameters
|
155
|
-
query_params = opts[:query_params] || {}
|
156
|
-
query_params[:'tracking_account_number'] = opts[:'tracking_account_number'] if !opts[:'tracking_account_number'].nil?
|
157
|
-
query_params[:'tracking_origin_country'] = opts[:'tracking_origin_country'] if !opts[:'tracking_origin_country'].nil?
|
158
|
-
query_params[:'tracking_destination_country'] = opts[:'tracking_destination_country'] if !opts[:'tracking_destination_country'].nil?
|
159
|
-
query_params[:'tracking_key'] = opts[:'tracking_key'] if !opts[:'tracking_key'].nil?
|
160
|
-
query_params[:'tracking_postal_code'] = opts[:'tracking_postal_code'] if !opts[:'tracking_postal_code'].nil?
|
161
|
-
query_params[:'tracking_ship_date'] = opts[:'tracking_ship_date'] if !opts[:'tracking_ship_date'].nil?
|
162
|
-
query_params[:'tracking_state'] = opts[:'tracking_state'] if !opts[:'tracking_state'].nil?
|
163
|
-
# header parameters
|
164
|
-
header_params = opts[:header_params] || {}
|
165
|
-
|
166
|
-
# http body (model)
|
167
|
-
post_body = opts[:body]
|
168
|
-
|
169
|
-
# return_type
|
170
|
-
return_type = 'DeleteTrackingBySlugTrackingNumberResponse'
|
171
|
-
|
172
|
-
new_options = opts.merge(
|
173
|
-
:operation => :"TrackingApi.delete_tracking_by_slug_tracking_number",
|
174
|
-
:header_params => header_params,
|
175
|
-
:query_params => query_params,
|
176
|
-
:body => post_body,
|
177
|
-
:return_type => return_type,
|
178
|
-
:response_legacy_tag => "",
|
179
|
-
:is_paging => false
|
180
|
-
)
|
181
|
-
|
182
|
-
data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
|
183
|
-
if @api_client.config.debugging
|
184
|
-
@api_client.config.logger.debug "API called: TrackingApi#delete_tracking_by_slug_tracking_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
185
|
-
end
|
186
|
-
return data, status_code, headers
|
187
|
-
end
|
188
|
-
|
189
119
|
# get_tracking_by_id
|
190
120
|
# Get tracking results of a single tracking.
|
191
121
|
# @param id [String] tracking ID
|
@@ -194,7 +124,7 @@ module AftershipAPI
|
|
194
124
|
# @option opts [String] :lang Translate checkpoint messages from the carrier’s provided language to the target language. Supported target languages include:</br> - English (en)</br> - French (fr)</br> - French Canadian (fr-CA)</br> - Arabic (ar)</br> - Bulgarian (bg)</br> - Catalan (ca)</br> - Croatian (hr)</br> - Czech (cs)</br> - Danish (da)</br> - Dutch (nl)</br> - Estonian (et)</br> - Filipino (tl)</br> - Finnish (fi)</br> - German (de)</br> - Greek (el)</br> - Hebrew (he)</br> - Hindi (hi)</br> - Hungarian (hu)</br> - Indonesian (id)</br> - Italian (it)</br> - Japanese (ja)</br> - Korean (ko)</br> - Latvian (lv)</br> - Lithuanian (lt)</br> - Malay (ms)</br> - Polish (pl)</br> - Portuguese (pt)</br> - Romanian (ro)</br> - Russian (ru)</br> - Serbian (sr)</br> - Slovak (sk)</br> - Slovenian (sl)</br> - Spanish (es)</br> - Swedish (sv)</br> - Thai (th)</br> - Turkish (tr)</br> - Ukrainian (uk)</br> - Vietnamese (vi)</br> - Simplified Chinese (zh-Hans)</br> - Traditional Chinese (zh-Hant)</br> - Norwegian (nb)</br>
|
195
125
|
# @return [Model::GetTrackingByIdResponse]
|
196
126
|
def get_tracking_by_id(id:, opts: {})
|
197
|
-
data, _status_code, _headers = get_tracking_by_id_with_http_info(id:
|
127
|
+
data, _status_code, _headers = get_tracking_by_id_with_http_info(id:id, opts: opts)
|
198
128
|
data
|
199
129
|
end
|
200
130
|
|
@@ -209,7 +139,7 @@ module AftershipAPI
|
|
209
139
|
|
210
140
|
|
211
141
|
# resource path
|
212
|
-
local_var_path = "/tracking/2024-
|
142
|
+
local_var_path = "/tracking/2024-10/trackings/#{id}"
|
213
143
|
method = :'GET'
|
214
144
|
|
215
145
|
# query parameters
|
@@ -242,84 +172,10 @@ module AftershipAPI
|
|
242
172
|
return data, status_code, headers
|
243
173
|
end
|
244
174
|
|
245
|
-
# get_tracking_by_slug_tracking_number
|
246
|
-
# Get tracking results of a single tracking.<b style="color:#FF0000">(This endpoint will be deprecated in version 2024-10)</b>
|
247
|
-
# @param slug [String] Tracking slug
|
248
|
-
# @param tracking_number [String] Tracking number
|
249
|
-
# @param [Hash] opts the optional parameters
|
250
|
-
# @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`
|
251
|
-
# @option opts [String] :lang Support Chinese to English translation for `china-ems` and `china-post` only
|
252
|
-
# @option opts [String] :tracking_account_number Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
|
253
|
-
# @option opts [String] :tracking_origin_country 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.
|
254
|
-
# @option opts [String] :tracking_destination_country 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.
|
255
|
-
# @option opts [String] :tracking_key Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
|
256
|
-
# @option opts [String] :tracking_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.
|
257
|
-
# @option opts [String] :tracking_ship_date 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.
|
258
|
-
# @option opts [String] :tracking_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.
|
259
|
-
# @return [Model::GetTrackingBySlugTrackingNumberResponse]
|
260
|
-
def get_tracking_by_slug_tracking_number(slug:, tracking_number:, opts: {})
|
261
|
-
data, _status_code, _headers = get_tracking_by_slug_tracking_number_with_http_info(slug: slug, tracking_number: tracking_number, opts: opts)
|
262
|
-
data
|
263
|
-
end
|
264
|
-
|
265
|
-
def get_tracking_by_slug_tracking_number_with_http_info(slug:, tracking_number:, opts: {})
|
266
|
-
if @api_client.config.debugging
|
267
|
-
@api_client.config.logger.debug 'Calling API: TrackingApi.get_tracking_by_slug_tracking_number ...'
|
268
|
-
end
|
269
|
-
|
270
|
-
if slug.nil? or slug.to_s == ''
|
271
|
-
raise InvalidParamError.new "slug cannot be nil or empty"
|
272
|
-
end
|
273
|
-
if tracking_number.nil? or tracking_number.to_s == ''
|
274
|
-
raise InvalidParamError.new "tracking_number cannot be nil or empty"
|
275
|
-
end
|
276
|
-
|
277
|
-
|
278
|
-
# resource path
|
279
|
-
local_var_path = "/tracking/2024-07/trackings/#{slug}/#{tracking_number}"
|
280
|
-
method = :'GET'
|
281
|
-
|
282
|
-
# query parameters
|
283
|
-
query_params = opts[:query_params] || {}
|
284
|
-
query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
|
285
|
-
query_params[:'lang'] = opts[:'lang'] if !opts[:'lang'].nil?
|
286
|
-
query_params[:'tracking_account_number'] = opts[:'tracking_account_number'] if !opts[:'tracking_account_number'].nil?
|
287
|
-
query_params[:'tracking_origin_country'] = opts[:'tracking_origin_country'] if !opts[:'tracking_origin_country'].nil?
|
288
|
-
query_params[:'tracking_destination_country'] = opts[:'tracking_destination_country'] if !opts[:'tracking_destination_country'].nil?
|
289
|
-
query_params[:'tracking_key'] = opts[:'tracking_key'] if !opts[:'tracking_key'].nil?
|
290
|
-
query_params[:'tracking_postal_code'] = opts[:'tracking_postal_code'] if !opts[:'tracking_postal_code'].nil?
|
291
|
-
query_params[:'tracking_ship_date'] = opts[:'tracking_ship_date'] if !opts[:'tracking_ship_date'].nil?
|
292
|
-
query_params[:'tracking_state'] = opts[:'tracking_state'] if !opts[:'tracking_state'].nil?
|
293
|
-
# header parameters
|
294
|
-
header_params = opts[:header_params] || {}
|
295
|
-
|
296
|
-
# http body (model)
|
297
|
-
post_body = opts[:body]
|
298
|
-
|
299
|
-
# return_type
|
300
|
-
return_type = 'GetTrackingBySlugTrackingNumberResponse'
|
301
|
-
|
302
|
-
new_options = opts.merge(
|
303
|
-
:operation => :"TrackingApi.get_tracking_by_slug_tracking_number",
|
304
|
-
:header_params => header_params,
|
305
|
-
:query_params => query_params,
|
306
|
-
:body => post_body,
|
307
|
-
:return_type => return_type,
|
308
|
-
:response_legacy_tag => "",
|
309
|
-
:is_paging => false
|
310
|
-
)
|
311
|
-
|
312
|
-
data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
|
313
|
-
if @api_client.config.debugging
|
314
|
-
@api_client.config.logger.debug "API called: TrackingApi#get_tracking_by_slug_tracking_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
315
|
-
end
|
316
|
-
return data, status_code, headers
|
317
|
-
end
|
318
|
-
|
319
175
|
# get_trackings
|
320
176
|
# Get tracking results of multiple trackings.<div style="visibility:hidden; height: 0"></div>
|
321
177
|
# @param [Hash] opts the optional parameters
|
322
|
-
# @option opts [
|
178
|
+
# @option opts [String] :cursor A string representing the cursor value for the current page of results.
|
323
179
|
# @option opts [Integer] :limit Number of trackings each page contain. (Default: 100, Max: 200)
|
324
180
|
# @option opts [String] :keyword Search the content of the tracking record fields: `tracking_number`, `title`, `order_id`, `customer_name`, `custom_fields`, `emails`, `smses`
|
325
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.
|
@@ -351,12 +207,12 @@ module AftershipAPI
|
|
351
207
|
|
352
208
|
|
353
209
|
# resource path
|
354
|
-
local_var_path = "/tracking/2024-
|
210
|
+
local_var_path = "/tracking/2024-10/trackings"
|
355
211
|
method = :'GET'
|
356
212
|
|
357
213
|
# query parameters
|
358
214
|
query_params = opts[:query_params] || {}
|
359
|
-
query_params[:'
|
215
|
+
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
360
216
|
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
361
217
|
query_params[:'keyword'] = opts[:'keyword'] if !opts[:'keyword'].nil?
|
362
218
|
query_params[:'tracking_numbers'] = opts[:'tracking_numbers'] if !opts[:'tracking_numbers'].nil?
|
@@ -389,8 +245,8 @@ module AftershipAPI
|
|
389
245
|
:query_params => query_params,
|
390
246
|
:body => post_body,
|
391
247
|
:return_type => return_type,
|
392
|
-
:response_legacy_tag => "
|
393
|
-
:is_paging =>
|
248
|
+
:response_legacy_tag => "",
|
249
|
+
:is_paging => false
|
394
250
|
)
|
395
251
|
|
396
252
|
data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
|
@@ -407,12 +263,12 @@ module AftershipAPI
|
|
407
263
|
# @param body [Model::MarkTrackingCompletedByIdRequest]
|
408
264
|
# @param [Hash] opts the optional parameters
|
409
265
|
# @return [Model::MarkTrackingCompletedByIdResponse]
|
410
|
-
def mark_tracking_completed_by_id(id:, body:,
|
266
|
+
def mark_tracking_completed_by_id(id:, body:,opts: {})
|
411
267
|
if "" != ""
|
412
|
-
body = {
|
268
|
+
body = {:'' => body}
|
413
269
|
end
|
414
270
|
opts[:body] = body
|
415
|
-
data, _status_code, _headers = mark_tracking_completed_by_id_with_http_info(id:
|
271
|
+
data, _status_code, _headers = mark_tracking_completed_by_id_with_http_info(id:id, opts: opts)
|
416
272
|
data
|
417
273
|
end
|
418
274
|
|
@@ -427,7 +283,7 @@ module AftershipAPI
|
|
427
283
|
|
428
284
|
|
429
285
|
# resource path
|
430
|
-
local_var_path = "/tracking/2024-
|
286
|
+
local_var_path = "/tracking/2024-10/trackings/#{id}/mark-as-completed"
|
431
287
|
method = :'POST'
|
432
288
|
|
433
289
|
# query parameters
|
@@ -458,89 +314,13 @@ module AftershipAPI
|
|
458
314
|
return data, status_code, headers
|
459
315
|
end
|
460
316
|
|
461
|
-
# mark_tracking_completed_by_slug_tracking_number
|
462
|
-
# Mark a tracking as completed. The tracking won't auto update until retrack it.<b style="color:#FF0000">(This endpoint will be deprecated in version 2024-10)</b>
|
463
|
-
# @param slug [String] Tracking slug
|
464
|
-
# @param tracking_number [String] Tracking number
|
465
|
-
|
466
|
-
# @param body [Model::MarkTrackingCompletedBySlugTrackingNumberRequest]
|
467
|
-
# @param [Hash] opts the optional parameters
|
468
|
-
# @option opts [String] :tracking_account_number Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
|
469
|
-
# @option opts [String] :tracking_origin_country 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.
|
470
|
-
# @option opts [String] :tracking_destination_country 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.
|
471
|
-
# @option opts [String] :tracking_key Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
|
472
|
-
# @option opts [String] :tracking_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.
|
473
|
-
# @option opts [String] :tracking_ship_date 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.
|
474
|
-
# @option opts [String] :tracking_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.
|
475
|
-
# @return [Model::MarkTrackingCompletedBySlugTrackingNumberResponse]
|
476
|
-
def mark_tracking_completed_by_slug_tracking_number(slug:, tracking_number:, body:, opts: {})
|
477
|
-
if "" != ""
|
478
|
-
body = { :'' => body }
|
479
|
-
end
|
480
|
-
opts[:body] = body
|
481
|
-
data, _status_code, _headers = mark_tracking_completed_by_slug_tracking_number_with_http_info(slug: slug, tracking_number: tracking_number, opts: opts)
|
482
|
-
data
|
483
|
-
end
|
484
|
-
|
485
|
-
def mark_tracking_completed_by_slug_tracking_number_with_http_info(slug:, tracking_number:, opts: {})
|
486
|
-
if @api_client.config.debugging
|
487
|
-
@api_client.config.logger.debug 'Calling API: TrackingApi.mark_tracking_completed_by_slug_tracking_number ...'
|
488
|
-
end
|
489
|
-
|
490
|
-
if slug.nil? or slug.to_s == ''
|
491
|
-
raise InvalidParamError.new "slug cannot be nil or empty"
|
492
|
-
end
|
493
|
-
if tracking_number.nil? or tracking_number.to_s == ''
|
494
|
-
raise InvalidParamError.new "tracking_number cannot be nil or empty"
|
495
|
-
end
|
496
|
-
|
497
|
-
|
498
|
-
# resource path
|
499
|
-
local_var_path = "/tracking/2024-07/trackings/#{slug}/#{tracking_number}/mark-as-completed"
|
500
|
-
method = :'POST'
|
501
|
-
|
502
|
-
# query parameters
|
503
|
-
query_params = opts[:query_params] || {}
|
504
|
-
query_params[:'tracking_account_number'] = opts[:'tracking_account_number'] if !opts[:'tracking_account_number'].nil?
|
505
|
-
query_params[:'tracking_origin_country'] = opts[:'tracking_origin_country'] if !opts[:'tracking_origin_country'].nil?
|
506
|
-
query_params[:'tracking_destination_country'] = opts[:'tracking_destination_country'] if !opts[:'tracking_destination_country'].nil?
|
507
|
-
query_params[:'tracking_key'] = opts[:'tracking_key'] if !opts[:'tracking_key'].nil?
|
508
|
-
query_params[:'tracking_postal_code'] = opts[:'tracking_postal_code'] if !opts[:'tracking_postal_code'].nil?
|
509
|
-
query_params[:'tracking_ship_date'] = opts[:'tracking_ship_date'] if !opts[:'tracking_ship_date'].nil?
|
510
|
-
query_params[:'tracking_state'] = opts[:'tracking_state'] if !opts[:'tracking_state'].nil?
|
511
|
-
# header parameters
|
512
|
-
header_params = opts[:header_params] || {}
|
513
|
-
|
514
|
-
# http body (model)
|
515
|
-
post_body = opts[:body]
|
516
|
-
|
517
|
-
# return_type
|
518
|
-
return_type = 'MarkTrackingCompletedBySlugTrackingNumberResponse'
|
519
|
-
|
520
|
-
new_options = opts.merge(
|
521
|
-
:operation => :"TrackingApi.mark_tracking_completed_by_slug_tracking_number",
|
522
|
-
:header_params => header_params,
|
523
|
-
:query_params => query_params,
|
524
|
-
:body => post_body,
|
525
|
-
:return_type => return_type,
|
526
|
-
:response_legacy_tag => "",
|
527
|
-
:is_paging => false
|
528
|
-
)
|
529
|
-
|
530
|
-
data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
|
531
|
-
if @api_client.config.debugging
|
532
|
-
@api_client.config.logger.debug "API called: TrackingApi#mark_tracking_completed_by_slug_tracking_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
533
|
-
end
|
534
|
-
return data, status_code, headers
|
535
|
-
end
|
536
|
-
|
537
317
|
# retrack_tracking_by_id
|
538
318
|
# Retrack an expired tracking. Max 3 times per tracking.
|
539
319
|
# @param id [String] tracking id
|
540
320
|
# @param [Hash] opts the optional parameters
|
541
321
|
# @return [Model::RetrackTrackingByIdResponse]
|
542
322
|
def retrack_tracking_by_id(id:, opts: {})
|
543
|
-
data, _status_code, _headers = retrack_tracking_by_id_with_http_info(id:
|
323
|
+
data, _status_code, _headers = retrack_tracking_by_id_with_http_info(id:id, opts: opts)
|
544
324
|
data
|
545
325
|
end
|
546
326
|
|
@@ -555,7 +335,7 @@ module AftershipAPI
|
|
555
335
|
|
556
336
|
|
557
337
|
# resource path
|
558
|
-
local_var_path = "/tracking/2024-
|
338
|
+
local_var_path = "/tracking/2024-10/trackings/#{id}/retrack"
|
559
339
|
method = :'POST'
|
560
340
|
|
561
341
|
# query parameters
|
@@ -586,76 +366,6 @@ module AftershipAPI
|
|
586
366
|
return data, status_code, headers
|
587
367
|
end
|
588
368
|
|
589
|
-
# retrack_tracking_by_slug_tracking_number
|
590
|
-
# Retrack an expired tracking. Max 3 times per tracking.<b style="color:#FF0000">(This endpoint will be deprecated in version 2024-10)</b>
|
591
|
-
# @param slug [String] Tracking slug
|
592
|
-
# @param tracking_number [String] Tracking number
|
593
|
-
# @param [Hash] opts the optional parameters
|
594
|
-
# @option opts [String] :tracking_account_number Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
|
595
|
-
# @option opts [String] :tracking_origin_country 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.
|
596
|
-
# @option opts [String] :tracking_destination_country 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.
|
597
|
-
# @option opts [String] :tracking_key Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
|
598
|
-
# @option opts [String] :tracking_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.
|
599
|
-
# @option opts [String] :tracking_ship_date 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.
|
600
|
-
# @option opts [String] :tracking_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.
|
601
|
-
# @return [Model::RetrackTrackingBySlugTrackingNumberResponse]
|
602
|
-
def retrack_tracking_by_slug_tracking_number(slug:, tracking_number:, opts: {})
|
603
|
-
data, _status_code, _headers = retrack_tracking_by_slug_tracking_number_with_http_info(slug: slug, tracking_number: tracking_number, opts: opts)
|
604
|
-
data
|
605
|
-
end
|
606
|
-
|
607
|
-
def retrack_tracking_by_slug_tracking_number_with_http_info(slug:, tracking_number:, opts: {})
|
608
|
-
if @api_client.config.debugging
|
609
|
-
@api_client.config.logger.debug 'Calling API: TrackingApi.retrack_tracking_by_slug_tracking_number ...'
|
610
|
-
end
|
611
|
-
|
612
|
-
if slug.nil? or slug.to_s == ''
|
613
|
-
raise InvalidParamError.new "slug cannot be nil or empty"
|
614
|
-
end
|
615
|
-
if tracking_number.nil? or tracking_number.to_s == ''
|
616
|
-
raise InvalidParamError.new "tracking_number cannot be nil or empty"
|
617
|
-
end
|
618
|
-
|
619
|
-
|
620
|
-
# resource path
|
621
|
-
local_var_path = "/tracking/2024-07/trackings/#{slug}/#{tracking_number}/retrack"
|
622
|
-
method = :'POST'
|
623
|
-
|
624
|
-
# query parameters
|
625
|
-
query_params = opts[:query_params] || {}
|
626
|
-
query_params[:'tracking_account_number'] = opts[:'tracking_account_number'] if !opts[:'tracking_account_number'].nil?
|
627
|
-
query_params[:'tracking_origin_country'] = opts[:'tracking_origin_country'] if !opts[:'tracking_origin_country'].nil?
|
628
|
-
query_params[:'tracking_destination_country'] = opts[:'tracking_destination_country'] if !opts[:'tracking_destination_country'].nil?
|
629
|
-
query_params[:'tracking_key'] = opts[:'tracking_key'] if !opts[:'tracking_key'].nil?
|
630
|
-
query_params[:'tracking_postal_code'] = opts[:'tracking_postal_code'] if !opts[:'tracking_postal_code'].nil?
|
631
|
-
query_params[:'tracking_ship_date'] = opts[:'tracking_ship_date'] if !opts[:'tracking_ship_date'].nil?
|
632
|
-
query_params[:'tracking_state'] = opts[:'tracking_state'] if !opts[:'tracking_state'].nil?
|
633
|
-
# header parameters
|
634
|
-
header_params = opts[:header_params] || {}
|
635
|
-
|
636
|
-
# http body (model)
|
637
|
-
post_body = opts[:body]
|
638
|
-
|
639
|
-
# return_type
|
640
|
-
return_type = 'RetrackTrackingBySlugTrackingNumberResponse'
|
641
|
-
|
642
|
-
new_options = opts.merge(
|
643
|
-
:operation => :"TrackingApi.retrack_tracking_by_slug_tracking_number",
|
644
|
-
:header_params => header_params,
|
645
|
-
:query_params => query_params,
|
646
|
-
:body => post_body,
|
647
|
-
:return_type => return_type,
|
648
|
-
:response_legacy_tag => "",
|
649
|
-
:is_paging => false
|
650
|
-
)
|
651
|
-
|
652
|
-
data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
|
653
|
-
if @api_client.config.debugging
|
654
|
-
@api_client.config.logger.debug "API called: TrackingApi#retrack_tracking_by_slug_tracking_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
655
|
-
end
|
656
|
-
return data, status_code, headers
|
657
|
-
end
|
658
|
-
|
659
369
|
# update_tracking_by_id
|
660
370
|
# Update a tracking.
|
661
371
|
# @param id [String] tracking ID
|
@@ -663,12 +373,12 @@ module AftershipAPI
|
|
663
373
|
# @param body [Model::UpdateTrackingByIdRequest]
|
664
374
|
# @param [Hash] opts the optional parameters
|
665
375
|
# @return [Model::UpdateTrackingByIdResponse]
|
666
|
-
def update_tracking_by_id(id:, body:,
|
376
|
+
def update_tracking_by_id(id:, body:,opts: {})
|
667
377
|
if "" != ""
|
668
|
-
body = {
|
378
|
+
body = {:'' => body}
|
669
379
|
end
|
670
380
|
opts[:body] = body
|
671
|
-
data, _status_code, _headers = update_tracking_by_id_with_http_info(id:
|
381
|
+
data, _status_code, _headers = update_tracking_by_id_with_http_info(id:id, opts: opts)
|
672
382
|
data
|
673
383
|
end
|
674
384
|
|
@@ -683,7 +393,7 @@ module AftershipAPI
|
|
683
393
|
|
684
394
|
|
685
395
|
# resource path
|
686
|
-
local_var_path = "/tracking/2024-
|
396
|
+
local_var_path = "/tracking/2024-10/trackings/#{id}"
|
687
397
|
method = :'PUT'
|
688
398
|
|
689
399
|
# query parameters
|
@@ -713,81 +423,5 @@ module AftershipAPI
|
|
713
423
|
end
|
714
424
|
return data, status_code, headers
|
715
425
|
end
|
716
|
-
|
717
|
-
# update_tracking_by_slug_tracking_number
|
718
|
-
# Update a tracking.<b style="color:#FF0000">(This endpoint will be deprecated in version 2024-10)</b>
|
719
|
-
# @param slug [String] Tracking slug
|
720
|
-
# @param tracking_number [String] Tracking number
|
721
|
-
|
722
|
-
# @param body [Model::UpdateTrackingBySlugTrackingNumberRequest]
|
723
|
-
# @param [Hash] opts the optional parameters
|
724
|
-
# @option opts [String] :tracking_account_number Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
|
725
|
-
# @option opts [String] :tracking_origin_country 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.
|
726
|
-
# @option opts [String] :tracking_destination_country 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.
|
727
|
-
# @option opts [String] :tracking_key Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
|
728
|
-
# @option opts [String] :tracking_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.
|
729
|
-
# @option opts [String] :tracking_ship_date 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.
|
730
|
-
# @option opts [String] :tracking_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.
|
731
|
-
# @return [Model::UpdateTrackingBySlugTrackingNumberResponse]
|
732
|
-
def update_tracking_by_slug_tracking_number(slug:, tracking_number:, body:, opts: {})
|
733
|
-
if "" != ""
|
734
|
-
body = { :'' => body }
|
735
|
-
end
|
736
|
-
opts[:body] = body
|
737
|
-
data, _status_code, _headers = update_tracking_by_slug_tracking_number_with_http_info(slug: slug, tracking_number: tracking_number, opts: opts)
|
738
|
-
data
|
739
|
-
end
|
740
|
-
|
741
|
-
def update_tracking_by_slug_tracking_number_with_http_info(slug:, tracking_number:, opts: {})
|
742
|
-
if @api_client.config.debugging
|
743
|
-
@api_client.config.logger.debug 'Calling API: TrackingApi.update_tracking_by_slug_tracking_number ...'
|
744
|
-
end
|
745
|
-
|
746
|
-
if slug.nil? or slug.to_s == ''
|
747
|
-
raise InvalidParamError.new "slug cannot be nil or empty"
|
748
|
-
end
|
749
|
-
if tracking_number.nil? or tracking_number.to_s == ''
|
750
|
-
raise InvalidParamError.new "tracking_number cannot be nil or empty"
|
751
|
-
end
|
752
|
-
|
753
|
-
|
754
|
-
# resource path
|
755
|
-
local_var_path = "/tracking/2024-07/trackings/#{slug}/#{tracking_number}"
|
756
|
-
method = :'PUT'
|
757
|
-
|
758
|
-
# query parameters
|
759
|
-
query_params = opts[:query_params] || {}
|
760
|
-
query_params[:'tracking_account_number'] = opts[:'tracking_account_number'] if !opts[:'tracking_account_number'].nil?
|
761
|
-
query_params[:'tracking_origin_country'] = opts[:'tracking_origin_country'] if !opts[:'tracking_origin_country'].nil?
|
762
|
-
query_params[:'tracking_destination_country'] = opts[:'tracking_destination_country'] if !opts[:'tracking_destination_country'].nil?
|
763
|
-
query_params[:'tracking_key'] = opts[:'tracking_key'] if !opts[:'tracking_key'].nil?
|
764
|
-
query_params[:'tracking_postal_code'] = opts[:'tracking_postal_code'] if !opts[:'tracking_postal_code'].nil?
|
765
|
-
query_params[:'tracking_ship_date'] = opts[:'tracking_ship_date'] if !opts[:'tracking_ship_date'].nil?
|
766
|
-
query_params[:'tracking_state'] = opts[:'tracking_state'] if !opts[:'tracking_state'].nil?
|
767
|
-
# header parameters
|
768
|
-
header_params = opts[:header_params] || {}
|
769
|
-
|
770
|
-
# http body (model)
|
771
|
-
post_body = opts[:body]
|
772
|
-
|
773
|
-
# return_type
|
774
|
-
return_type = 'UpdateTrackingBySlugTrackingNumberResponse'
|
775
|
-
|
776
|
-
new_options = opts.merge(
|
777
|
-
:operation => :"TrackingApi.update_tracking_by_slug_tracking_number",
|
778
|
-
:header_params => header_params,
|
779
|
-
:query_params => query_params,
|
780
|
-
:body => post_body,
|
781
|
-
:return_type => return_type,
|
782
|
-
:response_legacy_tag => "",
|
783
|
-
:is_paging => false
|
784
|
-
)
|
785
|
-
|
786
|
-
data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
|
787
|
-
if @api_client.config.debugging
|
788
|
-
@api_client.config.logger.debug "API called: TrackingApi#update_tracking_by_slug_tracking_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
789
|
-
end
|
790
|
-
return data, status_code, headers
|
791
|
-
end
|
792
426
|
end
|
793
|
-
end
|
427
|
+
end
|
@@ -44,7 +44,7 @@ module AftershipAPI
|
|
44
44
|
begin
|
45
45
|
call_api_internal(http_method, path, opts)
|
46
46
|
rescue ApiError => e
|
47
|
-
if retries > 0 && (e.error_code == AftershipAPI::TIMED_OUT || e.status_code >= 500)
|
47
|
+
if retries > 0 && (e.error_code == AftershipAPI::TIMED_OUT || e.status_code >= 500 )
|
48
48
|
retries -= 1
|
49
49
|
delay_with_jitter
|
50
50
|
retry
|
@@ -109,7 +109,7 @@ module AftershipAPI
|
|
109
109
|
url = build_request_url(path, opts)
|
110
110
|
http_method = http_method.to_sym.downcase
|
111
111
|
|
112
|
-
header_params = @default_headers.merge(opts[:header_params] || {}).merge({
|
112
|
+
header_params = @default_headers.merge(opts[:header_params] || {}).merge({'as-api-key' => config.as_api_key})
|
113
113
|
query_params = opts[:query_params] || {}
|
114
114
|
form_params = opts[:form_params] || {}
|
115
115
|
follow_location = opts[:follow_location] || true
|