aftership-tracking-sdk 7.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 +68 -83
- data/lib/aftership-tracking-sdk/api/courier.rb +8 -8
- data/lib/aftership-tracking-sdk/api/estimated_delivery_date.rb +4 -4
- data/lib/aftership-tracking-sdk/api/tracking.rb +50 -416
- 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 +183 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_delete_tracking_by_id_response.rb +183 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_get_tracking_by_id_response.rb +183 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_mark_tracking_completed_by_id_response.rb +183 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_retrack_tracking_by_id_response.rb +183 -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 +183 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_create_tracking_response.rb +163 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_delete_tracking_by_id_response.rb +163 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_get_tracking_by_id_response.rb +163 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_mark_tracking_completed_by_id_response.rb +163 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_retrack_tracking_by_id_response.rb +163 -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 +163 -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/courier_estimated_delivery_date_create_tracking_response.rb +173 -0
- data/lib/aftership-tracking-sdk/models/courier_estimated_delivery_date_delete_tracking_by_id_response.rb +173 -0
- data/lib/aftership-tracking-sdk/models/courier_estimated_delivery_date_get_tracking_by_id_response.rb +173 -0
- 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/courier_estimated_delivery_date_tracking.rb +173 -0
- 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/{tracking_create_tracking_request.rb → create_tracking_request.rb} +9 -7
- data/lib/aftership-tracking-sdk/models/create_tracking_response.rb +953 -0
- data/lib/aftership-tracking-sdk/models/{mark_tracking_completed_by_slug_tracking_number_request.rb → custom_estimated_delivery_date_create_tracking_response.rb} +41 -9
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_delete_tracking_by_id_response.rb +183 -0
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_get_tracking_by_id_response.rb +183 -0
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_mark_tracking_completed_by_id_response.rb +183 -0
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_retrack_tracking_by_id_response.rb +183 -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 +183 -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 +953 -0
- 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/{tracking_detect_courier_request.rb → detect_courier_request.rb} +5 -3
- 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 +12 -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 +193 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_delete_tracking_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_get_tracking_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_mark_tracking_completed_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_retrack_tracking_by_id_response.rb +193 -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 +193 -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 +953 -0
- 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 +193 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_delete_tracking_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_get_tracking_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_mark_tracking_completed_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_retrack_tracking_by_id_response.rb +193 -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 +193 -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 +953 -0
- data/lib/aftership-tracking-sdk/models/meta_v1.rb +2 -0
- data/lib/aftership-tracking-sdk/models/{next_couriers_tracking_create_tracking_request.rb → next_couriers_create_tracking_request.rb} +4 -2
- data/lib/aftership-tracking-sdk/models/{get_checkpoint_by_tracking_id_response.rb → next_couriers_create_tracking_response.rb} +33 -51
- data/lib/aftership-tracking-sdk/models/next_couriers_delete_tracking_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/{get_checkpoint_by_slug_tracking_number_response.rb → next_couriers_get_tracking_by_id_response.rb} +33 -51
- data/lib/aftership-tracking-sdk/models/next_couriers_mark_tracking_completed_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/next_couriers_retrack_tracking_by_id_response.rb +193 -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 +193 -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/pagination_data_tracking_response_get_multiple_v1.rb +173 -0
- data/lib/aftership-tracking-sdk/models/{notification_request_v1.rb → pagination_get_trackings_response.rb} +28 -16
- 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 +953 -0
- data/lib/aftership-tracking-sdk/models/{tracking_delete_response_v1.rb → shipment_weight_create_tracking_response.rb} +18 -16
- data/lib/aftership-tracking-sdk/models/{data_notification_response_v1.rb → shipment_weight_delete_tracking_by_id_response.rb} +21 -9
- data/lib/aftership-tracking-sdk/models/{notification.rb → shipment_weight_get_tracking_by_id_response.rb} +18 -16
- data/lib/aftership-tracking-sdk/models/shipment_weight_mark_tracking_completed_by_id_response.rb +163 -0
- data/lib/aftership-tracking-sdk/models/shipment_weight_retrack_tracking_by_id_response.rb +163 -0
- data/lib/aftership-tracking-sdk/models/{notification_response_v1.rb → shipment_weight_tracking.rb} +18 -16
- data/lib/aftership-tracking-sdk/models/shipment_weight_update_tracking_by_id_response.rb +163 -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 +56 -24
- data/lib/aftership-tracking-sdk/models/tracking_response_get_multiple_v1.rb +2 -0
- data/lib/aftership-tracking-sdk/models/tracking_response_v1.rb +5 -3
- data/lib/aftership-tracking-sdk/models/{tracking_update_tracking_by_id_request.rb → update_tracking_by_id_request.rb} +5 -3
- data/lib/aftership-tracking-sdk/models/update_tracking_by_id_response.rb +953 -0
- 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 +64 -22
- data/lib/aftership-tracking-sdk/api/last_checkpoint.rb +0 -143
- data/lib/aftership-tracking-sdk/api/notification.rb +0 -403
- data/lib/aftership-tracking-sdk/models/custom_fields_tracking_update_tracking_by_slug_tracking_number_request.rb +0 -139
- data/lib/aftership-tracking-sdk/models/data_tracking_delete_response_v1.rb +0 -151
- data/lib/aftership-tracking-sdk/models/data_tracking_response_v1.rb +0 -151
- data/lib/aftership-tracking-sdk/models/partial_delete_tracking.rb +0 -241
- data/lib/aftership-tracking-sdk/models/partial_update_tracking.rb +0 -251
- data/lib/aftership-tracking-sdk/models/tracking_update_tracking_by_slug_tracking_number_request.rb +0 -391
@@ -13,12 +13,12 @@ module AftershipAPI
|
|
13
13
|
# create_tracking
|
14
14
|
# Create a tracking.<div style="visibility:hidden; height: 0"></div>
|
15
15
|
|
16
|
-
# @param body [Model::
|
16
|
+
# @param body [Model::CreateTrackingRequest]
|
17
17
|
# @param [Hash] opts the optional parameters
|
18
|
-
# @return [Model::
|
19
|
-
def create_tracking(body:,
|
20
|
-
if "
|
21
|
-
body = {
|
18
|
+
# @return [Model::CreateTrackingResponse]
|
19
|
+
def create_tracking(body:,opts: {})
|
20
|
+
if "" != ""
|
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
|
@@ -45,7 +45,7 @@ module AftershipAPI
|
|
45
45
|
post_body = opts[:body]
|
46
46
|
|
47
47
|
# return_type
|
48
|
-
return_type = '
|
48
|
+
return_type = 'CreateTrackingResponse'
|
49
49
|
|
50
50
|
new_options = opts.merge(
|
51
51
|
:operation => :"TrackingApi.create_tracking",
|
@@ -53,7 +53,7 @@ module AftershipAPI
|
|
53
53
|
:query_params => query_params,
|
54
54
|
:body => post_body,
|
55
55
|
:return_type => return_type,
|
56
|
-
:response_legacy_tag => "
|
56
|
+
:response_legacy_tag => "",
|
57
57
|
:is_paging => false
|
58
58
|
)
|
59
59
|
|
@@ -68,9 +68,9 @@ module AftershipAPI
|
|
68
68
|
# Delete a tracking.
|
69
69
|
# @param id [String] tracking ID
|
70
70
|
# @param [Hash] opts the optional parameters
|
71
|
-
# @return [Model::
|
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
|
|
@@ -79,13 +79,13 @@ module AftershipAPI
|
|
79
79
|
@api_client.config.logger.debug 'Calling API: TrackingApi.delete_tracking_by_id ...'
|
80
80
|
end
|
81
81
|
|
82
|
-
if id.nil?
|
82
|
+
if id.nil? or id.to_s == ''
|
83
83
|
raise InvalidParamError.new "id cannot be nil or empty"
|
84
84
|
end
|
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
|
@@ -97,7 +97,7 @@ module AftershipAPI
|
|
97
97
|
post_body = opts[:body]
|
98
98
|
|
99
99
|
# return_type
|
100
|
-
return_type = '
|
100
|
+
return_type = 'DeleteTrackingByIdResponse'
|
101
101
|
|
102
102
|
new_options = opts.merge(
|
103
103
|
:operation => :"TrackingApi.delete_tracking_by_id",
|
@@ -105,7 +105,7 @@ module AftershipAPI
|
|
105
105
|
:query_params => query_params,
|
106
106
|
:body => post_body,
|
107
107
|
:return_type => return_type,
|
108
|
-
:response_legacy_tag => "
|
108
|
+
:response_legacy_tag => "",
|
109
109
|
:is_paging => false
|
110
110
|
)
|
111
111
|
|
@@ -116,85 +116,15 @@ 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.
|
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::PartialDeleteTracking]
|
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? || (slug.to_s == '')
|
143
|
-
raise InvalidParamError.new "slug cannot be nil or empty"
|
144
|
-
end
|
145
|
-
if tracking_number.nil? || (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-04/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 = 'PartialDeleteTracking'
|
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 => "tracking",
|
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
|
192
122
|
# @param [Hash] opts the optional parameters
|
193
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`
|
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
|
-
# @return [Model::
|
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
|
|
@@ -203,13 +133,13 @@ module AftershipAPI
|
|
203
133
|
@api_client.config.logger.debug 'Calling API: TrackingApi.get_tracking_by_id ...'
|
204
134
|
end
|
205
135
|
|
206
|
-
if id.nil?
|
136
|
+
if id.nil? or id.to_s == ''
|
207
137
|
raise InvalidParamError.new "id cannot be nil or empty"
|
208
138
|
end
|
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
|
@@ -223,7 +153,7 @@ module AftershipAPI
|
|
223
153
|
post_body = opts[:body]
|
224
154
|
|
225
155
|
# return_type
|
226
|
-
return_type = '
|
156
|
+
return_type = 'GetTrackingByIdResponse'
|
227
157
|
|
228
158
|
new_options = opts.merge(
|
229
159
|
:operation => :"TrackingApi.get_tracking_by_id",
|
@@ -231,7 +161,7 @@ module AftershipAPI
|
|
231
161
|
:query_params => query_params,
|
232
162
|
:body => post_body,
|
233
163
|
:return_type => return_type,
|
234
|
-
:response_legacy_tag => "
|
164
|
+
:response_legacy_tag => "",
|
235
165
|
:is_paging => false
|
236
166
|
)
|
237
167
|
|
@@ -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.
|
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::Tracking]
|
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? || (slug.to_s == '')
|
271
|
-
raise InvalidParamError.new "slug cannot be nil or empty"
|
272
|
-
end
|
273
|
-
if tracking_number.nil? || (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-04/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 = 'Tracking'
|
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 => "tracking",
|
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)
|
@@ -406,13 +262,13 @@ module AftershipAPI
|
|
406
262
|
|
407
263
|
# @param body [Model::MarkTrackingCompletedByIdRequest]
|
408
264
|
# @param [Hash] opts the optional parameters
|
409
|
-
# @return [Model::
|
410
|
-
def mark_tracking_completed_by_id(id:, body:,
|
265
|
+
# @return [Model::MarkTrackingCompletedByIdResponse]
|
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
|
|
@@ -421,13 +277,13 @@ module AftershipAPI
|
|
421
277
|
@api_client.config.logger.debug 'Calling API: TrackingApi.mark_tracking_completed_by_id ...'
|
422
278
|
end
|
423
279
|
|
424
|
-
if id.nil?
|
280
|
+
if id.nil? or id.to_s == ''
|
425
281
|
raise InvalidParamError.new "id cannot be nil or empty"
|
426
282
|
end
|
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
|
@@ -439,7 +295,7 @@ module AftershipAPI
|
|
439
295
|
post_body = opts[:body]
|
440
296
|
|
441
297
|
# return_type
|
442
|
-
return_type = '
|
298
|
+
return_type = 'MarkTrackingCompletedByIdResponse'
|
443
299
|
|
444
300
|
new_options = opts.merge(
|
445
301
|
:operation => :"TrackingApi.mark_tracking_completed_by_id",
|
@@ -447,7 +303,7 @@ module AftershipAPI
|
|
447
303
|
:query_params => query_params,
|
448
304
|
:body => post_body,
|
449
305
|
:return_type => return_type,
|
450
|
-
:response_legacy_tag => "
|
306
|
+
:response_legacy_tag => "",
|
451
307
|
:is_paging => false
|
452
308
|
)
|
453
309
|
|
@@ -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.
|
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::Tracking]
|
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? || (slug.to_s == '')
|
491
|
-
raise InvalidParamError.new "slug cannot be nil or empty"
|
492
|
-
end
|
493
|
-
if tracking_number.nil? || (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-04/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 = 'Tracking'
|
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 => "tracking",
|
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
|
-
# @return [Model::
|
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
|
|
@@ -549,13 +329,13 @@ module AftershipAPI
|
|
549
329
|
@api_client.config.logger.debug 'Calling API: TrackingApi.retrack_tracking_by_id ...'
|
550
330
|
end
|
551
331
|
|
552
|
-
if id.nil?
|
332
|
+
if id.nil? or id.to_s == ''
|
553
333
|
raise InvalidParamError.new "id cannot be nil or empty"
|
554
334
|
end
|
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
|
@@ -567,7 +347,7 @@ module AftershipAPI
|
|
567
347
|
post_body = opts[:body]
|
568
348
|
|
569
349
|
# return_type
|
570
|
-
return_type = '
|
350
|
+
return_type = 'RetrackTrackingByIdResponse'
|
571
351
|
|
572
352
|
new_options = opts.merge(
|
573
353
|
:operation => :"TrackingApi.retrack_tracking_by_id",
|
@@ -575,7 +355,7 @@ module AftershipAPI
|
|
575
355
|
:query_params => query_params,
|
576
356
|
:body => post_body,
|
577
357
|
:return_type => return_type,
|
578
|
-
:response_legacy_tag => "
|
358
|
+
:response_legacy_tag => "",
|
579
359
|
:is_paging => false
|
580
360
|
)
|
581
361
|
|
@@ -586,89 +366,19 @@ 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.
|
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::PartialUpdateTracking]
|
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? || (slug.to_s == '')
|
613
|
-
raise InvalidParamError.new "slug cannot be nil or empty"
|
614
|
-
end
|
615
|
-
if tracking_number.nil? || (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-04/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 = 'PartialUpdateTracking'
|
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 => "tracking",
|
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
|
662
372
|
|
663
|
-
# @param body [Model::
|
373
|
+
# @param body [Model::UpdateTrackingByIdRequest]
|
664
374
|
# @param [Hash] opts the optional parameters
|
665
|
-
# @return [Model::
|
666
|
-
def update_tracking_by_id(id:, body:,
|
667
|
-
if "
|
668
|
-
body = {
|
375
|
+
# @return [Model::UpdateTrackingByIdResponse]
|
376
|
+
def update_tracking_by_id(id:, body:,opts: {})
|
377
|
+
if "" != ""
|
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
|
|
@@ -677,13 +387,13 @@ module AftershipAPI
|
|
677
387
|
@api_client.config.logger.debug 'Calling API: TrackingApi.update_tracking_by_id ...'
|
678
388
|
end
|
679
389
|
|
680
|
-
if id.nil?
|
390
|
+
if id.nil? or id.to_s == ''
|
681
391
|
raise InvalidParamError.new "id cannot be nil or empty"
|
682
392
|
end
|
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
|
@@ -695,7 +405,7 @@ module AftershipAPI
|
|
695
405
|
post_body = opts[:body]
|
696
406
|
|
697
407
|
# return_type
|
698
|
-
return_type = '
|
408
|
+
return_type = 'UpdateTrackingByIdResponse'
|
699
409
|
|
700
410
|
new_options = opts.merge(
|
701
411
|
:operation => :"TrackingApi.update_tracking_by_id",
|
@@ -703,7 +413,7 @@ module AftershipAPI
|
|
703
413
|
:query_params => query_params,
|
704
414
|
:body => post_body,
|
705
415
|
:return_type => return_type,
|
706
|
-
:response_legacy_tag => "
|
416
|
+
:response_legacy_tag => "",
|
707
417
|
:is_paging => false
|
708
418
|
)
|
709
419
|
|
@@ -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.
|
719
|
-
# @param slug [String] Tracking slug
|
720
|
-
# @param tracking_number [String] Tracking number
|
721
|
-
|
722
|
-
# @param body [Model::TrackingUpdateTrackingBySlugTrackingNumberRequest]
|
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::Tracking]
|
732
|
-
def update_tracking_by_slug_tracking_number(slug:, tracking_number:, body:, opts: {})
|
733
|
-
if "tracking" != ""
|
734
|
-
body = { :'tracking' => 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? || (slug.to_s == '')
|
747
|
-
raise InvalidParamError.new "slug cannot be nil or empty"
|
748
|
-
end
|
749
|
-
if tracking_number.nil? || (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-04/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 = 'Tracking'
|
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 => "tracking",
|
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
|