Class: AftershipAPI::TrackingApi
- Inherits:
-
Object
- Object
- AftershipAPI::TrackingApi
- Defined in:
- lib/aftership-tracking-sdk/api/tracking.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
- #create_tracking(body:, opts: {}) ⇒ Model::CreateTrackingResponse
- #create_tracking_with_http_info(opts: {}) ⇒ Object
-
#delete_tracking_by_id(id:, opts: {}) ⇒ Model::DeleteTrackingByIdResponse
delete_tracking_by_id Delete a tracking.
- #delete_tracking_by_id_with_http_info(id:, opts: {}) ⇒ Object
-
#get_tracking_by_id(id:, opts: {}) ⇒ Model::GetTrackingByIdResponse
get_tracking_by_id Get tracking results of a single tracking.
- #get_tracking_by_id_with_http_info(id:, opts: {}) ⇒ Object
-
#get_trackings(opts: {}) ⇒ Model::GetTrackingsResponse
get_trackings Get tracking results of multiple trackings.<div style=“visibility:hidden; height: 0”></div>.
- #get_trackings_with_http_info(opts: {}) ⇒ Object
-
#initialize(api_client = ApiClient.default) ⇒ TrackingApi
constructor
A new instance of TrackingApi.
- #mark_tracking_completed_by_id(id:, body:, opts: {}) ⇒ Model::MarkTrackingCompletedByIdResponse
- #mark_tracking_completed_by_id_with_http_info(id:, opts: {}) ⇒ Object
-
#retrack_tracking_by_id(id:, opts: {}) ⇒ Model::RetrackTrackingByIdResponse
retrack_tracking_by_id Retrack an expired tracking.
- #retrack_tracking_by_id_with_http_info(id:, opts: {}) ⇒ Object
- #update_tracking_by_id(id:, body:, opts: {}) ⇒ Model::UpdateTrackingByIdResponse
- #update_tracking_by_id_with_http_info(id:, opts: {}) ⇒ Object
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ TrackingApi
Returns a new instance of TrackingApi.
9 10 11 |
# File 'lib/aftership-tracking-sdk/api/tracking.rb', line 9 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
7 8 9 |
# File 'lib/aftership-tracking-sdk/api/tracking.rb', line 7 def api_client @api_client end |
Instance Method Details
#create_tracking(body:, opts: {}) ⇒ Model::CreateTrackingResponse
19 20 21 22 23 24 25 26 |
# File 'lib/aftership-tracking-sdk/api/tracking.rb', line 19 def create_tracking(body:,opts: {}) if "" != "" body = {:'' => body} end opts[:body] = body data, _status_code, _headers = create_tracking_with_http_info(opts: opts) data end |
#create_tracking_with_http_info(opts: {}) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/aftership-tracking-sdk/api/tracking.rb', line 28 def create_tracking_with_http_info(opts: {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TrackingApi.create_tracking ...' end # resource path local_var_path = "/tracking/2024-10/trackings" method = :'POST' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = 'CreateTrackingResponse' = opts.merge( :operation => :"TrackingApi.create_tracking", :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => return_type, :response_legacy_tag => "", :is_paging => false ) data, status_code, headers = @api_client.call_api(method, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TrackingApi#create_tracking\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_tracking_by_id(id:, opts: {}) ⇒ Model::DeleteTrackingByIdResponse
delete_tracking_by_id Delete a tracking.
72 73 74 75 |
# File 'lib/aftership-tracking-sdk/api/tracking.rb', line 72 def delete_tracking_by_id(id:, opts: {}) data, _status_code, _headers = delete_tracking_by_id_with_http_info(id:id, opts: opts) data end |
#delete_tracking_by_id_with_http_info(id:, opts: {}) ⇒ Object
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/aftership-tracking-sdk/api/tracking.rb', line 77 def delete_tracking_by_id_with_http_info(id:, opts: {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TrackingApi.delete_tracking_by_id ...' end if id.nil? or id.to_s == '' raise InvalidParamError.new "id cannot be nil or empty" end # resource path local_var_path = "/tracking/2024-10/trackings/#{id}" method = :'DELETE' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = 'DeleteTrackingByIdResponse' = opts.merge( :operation => :"TrackingApi.delete_tracking_by_id", :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => return_type, :response_legacy_tag => "", :is_paging => false ) data, status_code, headers = @api_client.call_api(method, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TrackingApi#delete_tracking_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_tracking_by_id(id:, opts: {}) ⇒ Model::GetTrackingByIdResponse
get_tracking_by_id Get tracking results of a single tracking.
126 127 128 129 |
# File 'lib/aftership-tracking-sdk/api/tracking.rb', line 126 def get_tracking_by_id(id:, opts: {}) data, _status_code, _headers = get_tracking_by_id_with_http_info(id:id, opts: opts) data end |
#get_tracking_by_id_with_http_info(id:, opts: {}) ⇒ Object
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/aftership-tracking-sdk/api/tracking.rb', line 131 def get_tracking_by_id_with_http_info(id:, opts: {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TrackingApi.get_tracking_by_id ...' end if id.nil? or id.to_s == '' raise InvalidParamError.new "id cannot be nil or empty" end # resource path local_var_path = "/tracking/2024-10/trackings/#{id}" method = :'GET' # query parameters query_params = opts[:query_params] || {} query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil? query_params[:'lang'] = opts[:'lang'] if !opts[:'lang'].nil? # header parameters header_params = opts[:header_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = 'GetTrackingByIdResponse' = opts.merge( :operation => :"TrackingApi.get_tracking_by_id", :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => return_type, :response_legacy_tag => "", :is_paging => false ) data, status_code, headers = @api_client.call_api(method, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TrackingApi#get_tracking_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_trackings(opts: {}) ⇒ Model::GetTrackingsResponse
get_trackings Get tracking results of multiple trackings.<div style=“visibility:hidden; height: 0”></div>
197 198 199 200 |
# File 'lib/aftership-tracking-sdk/api/tracking.rb', line 197 def get_trackings(opts: {}) data, _status_code, _headers = get_trackings_with_http_info(opts: opts) data end |
#get_trackings_with_http_info(opts: {}) ⇒ Object
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/aftership-tracking-sdk/api/tracking.rb', line 202 def get_trackings_with_http_info(opts: {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TrackingApi.get_trackings ...' end # resource path local_var_path = "/tracking/2024-10/trackings" method = :'GET' # query parameters query_params = opts[:query_params] || {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'keyword'] = opts[:'keyword'] if !opts[:'keyword'].nil? query_params[:'tracking_numbers'] = opts[:'tracking_numbers'] if !opts[:'tracking_numbers'].nil? query_params[:'slug'] = opts[:'slug'] if !opts[:'slug'].nil? query_params[:'transit_time'] = opts[:'transit_time'] if !opts[:'transit_time'].nil? query_params[:'origin'] = opts[:'origin'] if !opts[:'origin'].nil? query_params[:'destination'] = opts[:'destination'] if !opts[:'destination'].nil? query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil? query_params[:'created_at_min'] = opts[:'created_at_min'] if !opts[:'created_at_min'].nil? query_params[:'created_at_max'] = opts[:'created_at_max'] if !opts[:'created_at_max'].nil? query_params[:'updated_at_min'] = opts[:'updated_at_min'] if !opts[:'updated_at_min'].nil? query_params[:'updated_at_max'] = opts[:'updated_at_max'] if !opts[:'updated_at_max'].nil? query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil? query_params[:'return_to_sender'] = opts[:'return_to_sender'] if !opts[:'return_to_sender'].nil? query_params[:'courier_destination_country_iso3'] = opts[:'courier_destination_country_iso3'] if !opts[:'courier_destination_country_iso3'].nil? query_params[:'shipment_tags'] = opts[:'shipment_tags'] if !opts[:'shipment_tags'].nil? query_params[:'order_id'] = opts[:'order_id'] if !opts[:'order_id'].nil? # header parameters header_params = opts[:header_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = 'GetTrackingsResponse' = opts.merge( :operation => :"TrackingApi.get_trackings", :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => return_type, :response_legacy_tag => "", :is_paging => false ) data, status_code, headers = @api_client.call_api(method, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TrackingApi#get_trackings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#mark_tracking_completed_by_id(id:, body:, opts: {}) ⇒ Model::MarkTrackingCompletedByIdResponse
266 267 268 269 270 271 272 273 |
# File 'lib/aftership-tracking-sdk/api/tracking.rb', line 266 def mark_tracking_completed_by_id(id:, body:,opts: {}) if "" != "" body = {:'' => body} end opts[:body] = body data, _status_code, _headers = mark_tracking_completed_by_id_with_http_info(id:id, opts: opts) data end |
#mark_tracking_completed_by_id_with_http_info(id:, opts: {}) ⇒ Object
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 |
# File 'lib/aftership-tracking-sdk/api/tracking.rb', line 275 def mark_tracking_completed_by_id_with_http_info(id:, opts: {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TrackingApi.mark_tracking_completed_by_id ...' end if id.nil? or id.to_s == '' raise InvalidParamError.new "id cannot be nil or empty" end # resource path local_var_path = "/tracking/2024-10/trackings/#{id}/mark-as-completed" method = :'POST' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = 'MarkTrackingCompletedByIdResponse' = opts.merge( :operation => :"TrackingApi.mark_tracking_completed_by_id", :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => return_type, :response_legacy_tag => "", :is_paging => false ) data, status_code, headers = @api_client.call_api(method, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TrackingApi#mark_tracking_completed_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#retrack_tracking_by_id(id:, opts: {}) ⇒ Model::RetrackTrackingByIdResponse
retrack_tracking_by_id Retrack an expired tracking. Max 3 times per tracking.
322 323 324 325 |
# File 'lib/aftership-tracking-sdk/api/tracking.rb', line 322 def retrack_tracking_by_id(id:, opts: {}) data, _status_code, _headers = retrack_tracking_by_id_with_http_info(id:id, opts: opts) data end |
#retrack_tracking_by_id_with_http_info(id:, opts: {}) ⇒ Object
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/aftership-tracking-sdk/api/tracking.rb', line 327 def retrack_tracking_by_id_with_http_info(id:, opts: {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TrackingApi.retrack_tracking_by_id ...' end if id.nil? or id.to_s == '' raise InvalidParamError.new "id cannot be nil or empty" end # resource path local_var_path = "/tracking/2024-10/trackings/#{id}/retrack" method = :'POST' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = 'RetrackTrackingByIdResponse' = opts.merge( :operation => :"TrackingApi.retrack_tracking_by_id", :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => return_type, :response_legacy_tag => "", :is_paging => false ) data, status_code, headers = @api_client.call_api(method, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TrackingApi#retrack_tracking_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_tracking_by_id(id:, body:, opts: {}) ⇒ Model::UpdateTrackingByIdResponse
376 377 378 379 380 381 382 383 |
# File 'lib/aftership-tracking-sdk/api/tracking.rb', line 376 def update_tracking_by_id(id:, body:,opts: {}) if "" != "" body = {:'' => body} end opts[:body] = body data, _status_code, _headers = update_tracking_by_id_with_http_info(id:id, opts: opts) data end |
#update_tracking_by_id_with_http_info(id:, opts: {}) ⇒ Object
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 |
# File 'lib/aftership-tracking-sdk/api/tracking.rb', line 385 def update_tracking_by_id_with_http_info(id:, opts: {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TrackingApi.update_tracking_by_id ...' end if id.nil? or id.to_s == '' raise InvalidParamError.new "id cannot be nil or empty" end # resource path local_var_path = "/tracking/2024-10/trackings/#{id}" method = :'PUT' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = 'UpdateTrackingByIdResponse' = opts.merge( :operation => :"TrackingApi.update_tracking_by_id", :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => return_type, :response_legacy_tag => "", :is_paging => false ) data, status_code, headers = @api_client.call_api(method, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TrackingApi#update_tracking_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |