Class: AftershipAPI::Model::GetTrackingByIdResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ GetTrackingByIdResponse

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
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
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 332

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `AftershipAPI::GetTrackingByIdResponse` initialize method"
  end

  attributes = attributes.each_with_object({}) { |(k, v), h|
    h[k.to_sym] = v
  }

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  end 

  if attributes.key?(:'legacy_id')
    self.legacy_id = attributes[:'legacy_id']
  end 

  if attributes.key?(:'created_at')
    self.created_at = attributes[:'created_at']
  end 

  if attributes.key?(:'updated_at')
    self.updated_at = attributes[:'updated_at']
  end 

  if attributes.key?(:'last_updated_at')
    self.last_updated_at = attributes[:'last_updated_at']
  end 

  if attributes.key?(:'tracking_number')
    self.tracking_number = attributes[:'tracking_number']
  end 

  if attributes.key?(:'slug')
    self.slug = attributes[:'slug']
  end 

  if attributes.key?(:'active')
    self.active = attributes[:'active']
  end 

  if attributes.key?(:'custom_fields')
    self.custom_fields = attributes[:'custom_fields']
  end 

  if attributes.key?(:'customer_name')
    self.customer_name = attributes[:'customer_name']
  end 

  if attributes.key?(:'transit_time')
    self.transit_time = attributes[:'transit_time']
  end 

  if attributes.key?(:'origin_country_iso3')
    self.origin_country_iso3 = attributes[:'origin_country_iso3']
  end 

  if attributes.key?(:'origin_state')
    self.origin_state = attributes[:'origin_state']
  end 

  if attributes.key?(:'origin_city')
    self.origin_city = attributes[:'origin_city']
  end 

  if attributes.key?(:'origin_postal_code')
    self.origin_postal_code = attributes[:'origin_postal_code']
  end 

  if attributes.key?(:'origin_raw_location')
    self.origin_raw_location = attributes[:'origin_raw_location']
  end 

  if attributes.key?(:'destination_country_iso3')
    self.destination_country_iso3 = attributes[:'destination_country_iso3']
  end 

  if attributes.key?(:'destination_state')
    self.destination_state = attributes[:'destination_state']
  end 

  if attributes.key?(:'destination_city')
    self.destination_city = attributes[:'destination_city']
  end 

  if attributes.key?(:'destination_postal_code')
    self.destination_postal_code = attributes[:'destination_postal_code']
  end 

  if attributes.key?(:'destination_raw_location')
    self.destination_raw_location = attributes[:'destination_raw_location']
  end 

  if attributes.key?(:'courier_destination_country_iso3')
    self.courier_destination_country_iso3 = attributes[:'courier_destination_country_iso3']
  end 

  if attributes.key?(:'emails')
    self.emails = attributes[:'emails']
  end 

  if attributes.key?(:'courier_estimated_delivery_date')
    self.courier_estimated_delivery_date = attributes[:'courier_estimated_delivery_date']
  end 

  if attributes.key?(:'note')
    self.note = attributes[:'note']
  end 

  if attributes.key?(:'order_id')
    self.order_id = attributes[:'order_id']
  end 

  if attributes.key?(:'order_id_path')
    self.order_id_path = attributes[:'order_id_path']
  end 

  if attributes.key?(:'order_date')
    self.order_date = attributes[:'order_date']
  end 

  if attributes.key?(:'shipment_package_count')
    self.shipment_package_count = attributes[:'shipment_package_count']
  end 

  if attributes.key?(:'shipment_pickup_date')
    self.shipment_pickup_date = attributes[:'shipment_pickup_date']
  end 

  if attributes.key?(:'shipment_delivery_date')
    self.shipment_delivery_date = attributes[:'shipment_delivery_date']
  end 

  if attributes.key?(:'shipment_type')
    self.shipment_type = attributes[:'shipment_type']
  end 

  if attributes.key?(:'shipment_weight')
    self.shipment_weight = attributes[:'shipment_weight']
  end 

  if attributes.key?(:'signed_by')
    self.signed_by = attributes[:'signed_by']
  end 

  if attributes.key?(:'smses')
    self.smses = attributes[:'smses']
  end 

  if attributes.key?(:'source')
    self.source = attributes[:'source']
  end 

  if attributes.key?(:'tag')
    self.tag = attributes[:'tag']
  end 

  if attributes.key?(:'subtag')
    self.subtag = attributes[:'subtag']
  end 

  if attributes.key?(:'subtag_message')
    self.subtag_message = attributes[:'subtag_message']
  end 

  if attributes.key?(:'title')
    self.title = attributes[:'title']
  end 

  if attributes.key?(:'tracked_count')
    self.tracked_count = attributes[:'tracked_count']
  end 

  if attributes.key?(:'last_mile_tracking_supported')
    self.last_mile_tracking_supported = attributes[:'last_mile_tracking_supported']
  end 

  if attributes.key?(:'language')
    self.language = attributes[:'language']
  end 

  if attributes.key?(:'unique_token')
    self.unique_token = attributes[:'unique_token']
  end 

  if attributes.key?(:'checkpoints')
    self.checkpoints = attributes[:'checkpoints']
  end 

  if attributes.key?(:'subscribed_smses')
    self.subscribed_smses = attributes[:'subscribed_smses']
  end 

  if attributes.key?(:'subscribed_emails')
    self.subscribed_emails = attributes[:'subscribed_emails']
  end 

  if attributes.key?(:'return_to_sender')
    self.return_to_sender = attributes[:'return_to_sender']
  end 

  if attributes.key?(:'order_promised_delivery_date')
    self.order_promised_delivery_date = attributes[:'order_promised_delivery_date']
  end 

  if attributes.key?(:'delivery_type')
    self.delivery_type = attributes[:'delivery_type']
  end 

  if attributes.key?(:'pickup_location')
    self.pickup_location = attributes[:'pickup_location']
  end 

  if attributes.key?(:'pickup_note')
    self.pickup_note = attributes[:'pickup_note']
  end 

  if attributes.key?(:'courier_tracking_link')
    self.courier_tracking_link = attributes[:'courier_tracking_link']
  end 

  if attributes.key?(:'first_attempted_at')
    self.first_attempted_at = attributes[:'first_attempted_at']
  end 

  if attributes.key?(:'courier_redirect_link')
    self.courier_redirect_link = attributes[:'courier_redirect_link']
  end 

  if attributes.key?(:'tracking_account_number')
    self. = attributes[:'tracking_account_number']
  end 

  if attributes.key?(:'tracking_key')
    self.tracking_key = attributes[:'tracking_key']
  end 

  if attributes.key?(:'tracking_ship_date')
    self.tracking_ship_date = attributes[:'tracking_ship_date']
  end 

  if attributes.key?(:'on_time_status')
    self.on_time_status = attributes[:'on_time_status']
  end 

  if attributes.key?(:'on_time_difference')
    self.on_time_difference = attributes[:'on_time_difference']
  end 

  if attributes.key?(:'order_tags')
    self.order_tags = attributes[:'order_tags']
  end 

  if attributes.key?(:'aftership_estimated_delivery_date')
    self.aftership_estimated_delivery_date = attributes[:'aftership_estimated_delivery_date']
  end 

  if attributes.key?(:'custom_estimated_delivery_date')
    self.custom_estimated_delivery_date = attributes[:'custom_estimated_delivery_date']
  end 

  if attributes.key?(:'order_number')
    self.order_number = attributes[:'order_number']
  end 

  if attributes.key?(:'first_estimated_delivery')
    self.first_estimated_delivery = attributes[:'first_estimated_delivery']
  end 

  if attributes.key?(:'latest_estimated_delivery')
    self.latest_estimated_delivery = attributes[:'latest_estimated_delivery']
  end 

  if attributes.key?(:'shipment_tags')
    self.shipment_tags = attributes[:'shipment_tags']
  end 

  if attributes.key?(:'courier_connection_id')
    self.courier_connection_id = attributes[:'courier_connection_id']
  end 

  if attributes.key?(:'next_couriers')
    self.next_couriers = attributes[:'next_couriers']
  end 

  if attributes.key?(:'tracking_origin_country')
    self.tracking_origin_country = attributes[:'tracking_origin_country']
  end 

  if attributes.key?(:'tracking_destination_country')
    self.tracking_destination_country = attributes[:'tracking_destination_country']
  end 

  if attributes.key?(:'tracking_postal_code')
    self.tracking_postal_code = attributes[:'tracking_postal_code']
  end 

  if attributes.key?(:'tracking_state')
    self.tracking_state = attributes[:'tracking_state']
  end 

  if attributes.key?(:'carbon_emissions')
    self.carbon_emissions = attributes[:'carbon_emissions']
  end 

  if attributes.key?(:'location_id')
    self.location_id = attributes[:'location_id']
  end 

  if attributes.key?(:'shipping_method')
    self.shipping_method = attributes[:'shipping_method']
  end 

  if attributes.key?(:'failed_delivery_attempts')
    self.failed_delivery_attempts = attributes[:'failed_delivery_attempts']
  end 

  if attributes.key?(:'signature_requirement')
    self.signature_requirement = attributes[:'signature_requirement']
  end 

  if attributes.key?(:'delivery_location_type')
    self.delivery_location_type = attributes[:'delivery_location_type']
  end 

  if attributes.key?(:'aftership_tracking_url')
    self.aftership_tracking_url = attributes[:'aftership_tracking_url']
  end 

  if attributes.key?(:'aftership_tracking_order_url')
    self.aftership_tracking_order_url = attributes[:'aftership_tracking_order_url']
  end 
end

Instance Attribute Details

#activeObject

Whether or not AfterShip will continue tracking the shipments. Value is ‘false` when tag (status) is `Delivered`, `Expired`, or further updates for 30 days since last update. active?: Boolean;



36
37
38
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 36

def active
  @active
end

#aftership_estimated_delivery_dateObject

The estimated delivery date of the shipment provided by AfterShip’s AI and shown to the recipients. It uses the format ‘YYYY-MM-DD` based on the shipment recipient’s timezone. aftership_estimated_delivery_date?: AftershipEstimatedDeliveryDateGetTrackingByIdResponse;



252
253
254
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 252

def aftership_estimated_delivery_date
  @aftership_estimated_delivery_date
end

#aftership_tracking_order_urlObject

The order URL directs your customers to the order tracking page, which includes all shipments. It can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. aftership_tracking_order_url?: String;



328
329
330
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 328

def aftership_tracking_order_url
  @aftership_tracking_order_url
end

#aftership_tracking_urlObject

The tracking URL directs your customers to the shipment tracking page which can display either the default or a customized page based on segmentation rules.- The universal URL is used by default, but you can opt for a custom domain if you have one. Learn how to set up a custom domain .The field is not automatically enabled in API & Webhook. Please contact support if you’d like to enable it. aftership_tracking_url?: String;



324
325
326
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 324

def aftership_tracking_url
  @aftership_tracking_url
end

#carbon_emissionsObject

The model contains the total amount of carbon emissions generated by the shipment. - AfterShip will provide this data only when it is available, and its availability is contingent upon the location and weight information that AfterShip can obtain.- The values will be accessible solely for shipments that have been successfully delivered. However, in the event of a shipping update after the delivery status has been achieved, the value may change.- It’s a paid service and only for Tracking Enterprise users, please contact your customer success manager if you want to know more. carbon_emissions?: CarbonEmissionsGetTrackingByIdResponse;



300
301
302
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 300

def carbon_emissions
  @carbon_emissions
end

#checkpointsObject

Array of checkpoint object describes the checkpoint information. checkpoints?: Checkpoint[];



184
185
186
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 184

def checkpoints
  @checkpoints
end

#courier_connection_idObject

If you have multiple accounts connected for a single carrier on AfterShip, we have introduced the courier_connection_id field to allow you to specify the carrier account associated with each shipment. By providing this information, you enable us to accurately track and monitor your shipments based on the correct carrier account.(</br>In the event that you do not specify the courier_connection_id, we will handle your shipment using the connection that was created earliest among your connected accounts. courier_connection_id?: String;



276
277
278
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 276

def courier_connection_id
  @courier_connection_id
end

#courier_destination_country_iso3Object

Destination country/region of the tracking detected from the courier. ISO Alpha-3 (three letters). Value will be ‘null` if the courier doesn’t provide the destination country. courier_destination_country_iso3?: String;



92
93
94
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 92

def courier_destination_country_iso3
  @courier_destination_country_iso3
end

#courier_estimated_delivery_dateObject

The field contains the estimated delivery date provided by the carrier. courier_estimated_delivery_date?: CourierEstimatedDeliveryDateGetTrackingByIdResponse;



100
101
102
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 100

def courier_estimated_delivery_date
  @courier_estimated_delivery_date
end

Delivery instructions (delivery date or address) can be modified by visiting the link if supported by a carrier. The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to “US” by default. courier_redirect_link?: String;



224
225
226
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 224

def courier_redirect_link
  @courier_redirect_link
end

Official tracking URL of the courier (if any). The language parameter of this link relies on the destination country/region and the language associated with the shipment, if the data regarding the destination country/region and language of the shipment is not available, AfterShip will set the language parameter of the link to “US” by default. courier_tracking_link?: String;



216
217
218
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 216

def courier_tracking_link
  @courier_tracking_link
end

#created_atObject

The date and time the shipment was imported or added to AfterShip. It uses the format ‘YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. created_at?: String;



16
17
18
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 16

def created_at
  @created_at
end

#custom_estimated_delivery_dateObject

Estimated delivery time of the shipment based on your . It uses the format ‘YYYY-MM-DD` based on the shipment recipient’s timezone. custom_estimated_delivery_date?: CustomEstimatedDeliveryDateGetTrackingByIdResponse;



256
257
258
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 256

def custom_estimated_delivery_date
  @custom_estimated_delivery_date
end

#custom_fieldsObject

Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any in custom fields. custom_fields?: Object;



40
41
42
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 40

def custom_fields
  @custom_fields
end

#customer_nameObject

Customer name of the tracking. customer_name?: String;



44
45
46
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 44

def customer_name
  @customer_name
end

#delivery_location_typeObject

The delivery location type represents the secure area where the carrier leaves the package, such as a safe place, locker, mailbox, front porch, etc. This information helps ensure the shipment reaches the intended recipient efficiently, minimizing the risk of theft or damage. delivery_location_type?: String;



320
321
322
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 320

def delivery_location_type
  @delivery_location_type
end

#delivery_typeObject

Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door delivery_type?: String;



204
205
206
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 204

def delivery_type
  @delivery_type
end

#destination_cityObject

The city of the recipient’s address. destination_city?: String;



80
81
82
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 80

def destination_city
  @destination_city
end

#destination_country_iso3Object

The for the destination country/region. E.g. USA for the United States. destination_country_iso3?: String;



72
73
74
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 72

def destination_country_iso3
  @destination_country_iso3
end

#destination_postal_codeObject

The postal code of the recipient’s address. destination_postal_code?: String;



84
85
86
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 84

def destination_postal_code
  @destination_postal_code
end

#destination_raw_locationObject

The shipping address that the shipment is shipping to. destination_raw_location?: String;



88
89
90
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 88

def destination_raw_location
  @destination_raw_location
end

#destination_stateObject

The state of the recipient’s address. destination_state?: String;



76
77
78
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 76

def destination_state
  @destination_state
end

#emailsObject

Email address(es) to receive email notifications. emails?: String[];



96
97
98
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 96

def emails
  @emails
end

#failed_delivery_attemptsObject

By dynamically tracking failed delivery attempts during shipment, this field allows you to pinpoint carriers accountable for the most failures. Analyzing the root cause of these failures enables you to improve carriers’ delivery standard operating procedures (SOP), leading to an overall enhancement in delivery service quality. failed_delivery_attempts?: Integer;



312
313
314
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 312

def failed_delivery_attempts
  @failed_delivery_attempts
end

#first_attempted_atObject

The date and time of the carrier’s first attempt to deliver the package to the recipient. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ first_attempted_at?: String;



220
221
222
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 220

def first_attempted_at
  @first_attempted_at
end

#first_estimated_deliveryObject

The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format ‘YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. first_estimated_delivery?: FirstEstimatedDeliveryGetTrackingByIdResponse;



264
265
266
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 264

def first_estimated_delivery
  @first_estimated_delivery
end

#idObject

Tracking ID. id?: String;



8
9
10
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 8

def id
  @id
end

#languageObject

The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. language?: String;



176
177
178
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 176

def language
  @language
end

#last_mile_tracking_supportedObject

Indicates if the shipment is trackable till the final destination.Three possible values:- true- false- null last_mile_tracking_supported?: Boolean;



172
173
174
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 172

def last_mile_tracking_supported
  @last_mile_tracking_supported
end

#last_updated_atObject

(Legacy) The date and time the shipment was updated. It uses the format ‘YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. last_updated_at?: String;



24
25
26
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 24

def last_updated_at
  @last_updated_at
end

#latest_estimated_deliveryObject

The most recently calculated estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings. The format of carrier EDDs may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ AfterShip AI and custom EDDs always use the format ‘YYYY-MM-DD`. All EDDs use the shipment recipient’s timezone. latest_estimated_delivery?: LatestEstimatedDeliveryGetTrackingByIdResponse;



268
269
270
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 268

def latest_estimated_delivery
  @latest_estimated_delivery
end

#legacy_idObject

The length of the tracking ID has been increased from 24 characters to 32 characters. We will use the legacy_id field to store the original 24-character tracking ID to maintain compatibility with existing data. Therefore, all tracking endpoints will continue to work with the legacy_id field as before. legacy_id?: String;



12
13
14
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 12

def legacy_id
  @legacy_id
end

#location_idObject

The location_id refers to the place where you fulfilled the items. - If you provide a location_id, the system will automatically use it as the tracking’s origin address. However, passing both location_id and any origin address information simultaneously is not allowed.- Please make sure you add your locations . location_id?: String;



304
305
306
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 304

def location_id
  @location_id
end

#next_couriersObject

The next couriers get the second carrier information from user or AfterShip. next_couriers?: NextCouriersGetTrackingByIdResponse[];



280
281
282
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 280

def next_couriers
  @next_couriers
end

#noteObject

Text field for the note. note?: String;



104
105
106
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 104

def note
  @note
end

#on_time_differenceObject

The difference days of the on time. on_time_difference?: Float;



244
245
246
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 244

def on_time_difference
  @on_time_difference
end

#on_time_statusObject

Whether the tracking is delivered on time or not. on_time_status?: String;



240
241
242
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 240

def on_time_status
  @on_time_status
end

#order_dateObject

The date and time the order was created in your system or store. It uses the format: ‘YYYY-MM-DDTHH:mm:ssZ` based on whichever timezone you provide. order_date?: String;



116
117
118
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 116

def order_date
  @order_date
end

#order_idObject

A globally-unique identifier for the order. order_id?: String;



108
109
110
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 108

def order_id
  @order_id
end

#order_id_pathObject

The URL for the order in your system or store. order_id_path?: String;



112
113
114
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 112

def order_id_path
  @order_id_path
end

#order_numberObject

A unique, human-readable identifier for the order. order_number?: String;



260
261
262
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 260

def order_number
  @order_number
end

#order_promised_delivery_dateObject

The promised delivery date of the order. It uses the formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ order_promised_delivery_date?: String;



200
201
202
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 200

def order_promised_delivery_date
  @order_promised_delivery_date
end

#order_tagsObject

The tags of the order. order_tags?: String[];



248
249
250
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 248

def order_tags
  @order_tags
end

#origin_cityObject

The city of the sender’s address. origin_city?: String;



60
61
62
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 60

def origin_city
  @origin_city
end

#origin_country_iso3Object

The for the origin country/region. E.g. USA for the United States. origin_country_iso3?: String;



52
53
54
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 52

def origin_country_iso3
  @origin_country_iso3
end

#origin_postal_codeObject

The postal code of the sender’s address. origin_postal_code?: String;



64
65
66
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 64

def origin_postal_code
  @origin_postal_code
end

#origin_raw_locationObject

The sender address that the shipment is shipping from. origin_raw_location?: String;



68
69
70
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 68

def origin_raw_location
  @origin_raw_location
end

#origin_stateObject

The state of the sender’s address. origin_state?: String;



56
57
58
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 56

def origin_state
  @origin_state
end

#pickup_locationObject

Shipment pickup location for receiver pickup_location?: String;



208
209
210
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 208

def pickup_location
  @pickup_location
end

#pickup_noteObject

Shipment pickup note for receiver pickup_note?: String;



212
213
214
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 212

def pickup_note
  @pickup_note
end

#return_to_senderObject

Whether or not the shipment is returned to sender. Value is ‘true` when any of its checkpoints has subtag `Exception_010` (returning to sender) or `Exception_011` (returned to sender). Otherwise value is `false`. return_to_sender?: Boolean;



196
197
198
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 196

def return_to_sender
  @return_to_sender
end

#shipment_delivery_dateObject

The date and time the shipment was delivered. It uses the shipment recipient’s timezone. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ shipment_delivery_date?: String;



128
129
130
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 128

def shipment_delivery_date
  @shipment_delivery_date
end

#shipment_package_countObject

Number of packages under the tracking. shipment_package_count?: Float;



120
121
122
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 120

def shipment_package_count
  @shipment_package_count
end

#shipment_pickup_dateObject

The date and time the shipment was picked up by the carrier. It uses the timezone where the pickup occured. The format may differ depending on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ shipment_pickup_date?: String;



124
125
126
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 124

def shipment_pickup_date
  @shipment_pickup_date
end

#shipment_tagsObject

Used to add tags to your shipments to help categorize and filter them easily. shipment_tags?: String[];



272
273
274
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 272

def shipment_tags
  @shipment_tags
end

#shipment_typeObject

The carrier service type for the shipment. shipment_type?: String;



132
133
134
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 132

def shipment_type
  @shipment_type
end

#shipment_weightObject

The shipment_weight field represents the total weight of the shipment. In scenarios where the carrier does not provide this information, you can provide the weight to AfterShip. We will prioritize the data provided by the carrier, if available. The shipment weight will be included in the Response and accessed through the GET API, Webhook, and CSV export. It will also be displayed on the AfterShip Tracking admin. Additionally, it plays a significant role in error-free shipment handling and carbon emission calculations, ensuring accurate and informed decision-making shipment_weight?: ShipmentWeightGetTrackingByIdResponse;



136
137
138
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 136

def shipment_weight
  @shipment_weight
end

#shipping_methodObject

The shipping_method string refers to the chosen method for delivering the package. Merchants typically offer various shipping methods to consumers during the checkout process, such as, Local Delivery, Free Express Worldwide Shipping, etc. shipping_method?: String;



308
309
310
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 308

def shipping_method
  @shipping_method
end

#signature_requirementObject

The signature_requirement field serves the purpose of validating the service option type, specifically proof of delivery. By collecting the recipient’s signature upon delivery, it ensures the package reaches the intended recipient and prevents disputes related to non-delivery or lost packages.</br> signature_requirement?: String;



316
317
318
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 316

def signature_requirement
  @signature_requirement
end

#signed_byObject

Signed by information for delivered shipment. signed_by?: String;



140
141
142
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 140

def signed_by
  @signed_by
end

#slugObject

Unique courier code. When importing a shipment with no courier slug and the tracking number can’t be recognized, the courier will be marked as ‘unrecognized`. Get courier codes . slug?: String;



32
33
34
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 32

def slug
  @slug
end

#smsesObject

The phone number(s) to receive sms notifications. Phone number should begin with ‘+` and `Area Code` before phone number. smses?: String[];



144
145
146
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 144

def smses
  @smses
end

#sourceObject

Source of how this tracking is added. source?: String;



148
149
150
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 148

def source
  @source
end

#subscribed_emailsObject

Email address(es) subscribed to receive email notifications. subscribed_emails?: String[];



192
193
194
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 192

def subscribed_emails
  @subscribed_emails
end

#subscribed_smsesObject

Phone number(s) subscribed to receive sms notifications. subscribed_smses?: String[];



188
189
190
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 188

def subscribed_smses
  @subscribed_smses
end

#subtagObject

Current subtag of tracking. ( subtag?: String;



156
157
158
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 156

def subtag
  @subtag
end

#subtag_messageObject

Normalized tracking message. ( subtag_message?: String;



160
161
162
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 160

def subtag_message
  @subtag_message
end

#tagObject

Current status of tracking. ( tag?: TagV1;



152
153
154
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 152

def tag
  @tag
end

#titleObject

By default this field shows the ‘tracking_number`, but you can customize it as you wish with any info (e.g. the order number). title?: String;



164
165
166
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 164

def title
  @title
end

#tracked_countObject

Number of attempts AfterShip tracks at courier’s system. tracked_count?: Float;



168
169
170
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 168

def tracked_count
  @tracked_count
end

#tracking_account_numberObject

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. tracking_account_number?: String;



228
229
230
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 228

def 
  @tracking_account_number
end

#tracking_destination_countryObject

(Legacy) Replaced by ‘destination_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details. tracking_destination_country?: String;



288
289
290
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 288

def tracking_destination_country
  @tracking_destination_country
end

#tracking_keyObject

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. tracking_key?: String;



232
233
234
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 232

def tracking_key
  @tracking_key
end

#tracking_numberObject

Tracking number. tracking_number?: String;



28
29
30
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 28

def tracking_number
  @tracking_number
end

#tracking_origin_countryObject

(Legacy) Replaced by ‘origin_country_iso3`. Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details. tracking_origin_country?: String;



284
285
286
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 284

def tracking_origin_country
  @tracking_origin_country
end

#tracking_postal_codeObject

(Legacy) Replaced by ‘destination_postal_code`. Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details. tracking_postal_code?: String;



292
293
294
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 292

def tracking_postal_code
  @tracking_postal_code
end

#tracking_ship_dateObject

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. tracking_ship_date?: String;



236
237
238
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 236

def tracking_ship_date
  @tracking_ship_date
end

#tracking_stateObject

(Legacy) Replaced by ‘destination_state`. Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details. tracking_state?: String;



296
297
298
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 296

def tracking_state
  @tracking_state
end

#transit_timeObject

Total transit time in days.- For delivered shipments: Transit time (in days) = Delivered date - Pick-up date- For undelivered shipments: Transit time (in days) = Current date - Pick-up dateValue as ‘null` for the shipment without pick-up date. transit_time?: Integer;



48
49
50
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 48

def transit_time
  @transit_time
end

#unique_tokenObject

Deprecated unique_token?: String;



180
181
182
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 180

def unique_token
  @unique_token
end

#updated_atObject

The date and time the shipment was updated. It uses the format ‘YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0. updated_at?: String;



20
21
22
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 20

def updated_at
  @updated_at
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • type (String)

    Data type

  • value (String)

    Value to be deserialized

Returns:

  • (Object)

    Deserialized data



867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 867

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    klass = AftershipAPI::Model.const_get(type)
    klass.build_from_hash(value)
  end
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 754

def self.attribute_map
  {
    :'id' => :'id',
    :'legacy_id' => :'legacy_id',
    :'created_at' => :'created_at',
    :'updated_at' => :'updated_at',
    :'last_updated_at' => :'last_updated_at',
    :'tracking_number' => :'tracking_number',
    :'slug' => :'slug',
    :'active' => :'active',
    :'custom_fields' => :'custom_fields',
    :'customer_name' => :'customer_name',
    :'transit_time' => :'transit_time',
    :'origin_country_iso3' => :'origin_country_iso3',
    :'origin_state' => :'origin_state',
    :'origin_city' => :'origin_city',
    :'origin_postal_code' => :'origin_postal_code',
    :'origin_raw_location' => :'origin_raw_location',
    :'destination_country_iso3' => :'destination_country_iso3',
    :'destination_state' => :'destination_state',
    :'destination_city' => :'destination_city',
    :'destination_postal_code' => :'destination_postal_code',
    :'destination_raw_location' => :'destination_raw_location',
    :'courier_destination_country_iso3' => :'courier_destination_country_iso3',
    :'emails' => :'emails',
    :'courier_estimated_delivery_date' => :'courier_estimated_delivery_date',
    :'note' => :'note',
    :'order_id' => :'order_id',
    :'order_id_path' => :'order_id_path',
    :'order_date' => :'order_date',
    :'shipment_package_count' => :'shipment_package_count',
    :'shipment_pickup_date' => :'shipment_pickup_date',
    :'shipment_delivery_date' => :'shipment_delivery_date',
    :'shipment_type' => :'shipment_type',
    :'shipment_weight' => :'shipment_weight',
    :'signed_by' => :'signed_by',
    :'smses' => :'smses',
    :'source' => :'source',
    :'tag' => :'tag',
    :'subtag' => :'subtag',
    :'subtag_message' => :'subtag_message',
    :'title' => :'title',
    :'tracked_count' => :'tracked_count',
    :'last_mile_tracking_supported' => :'last_mile_tracking_supported',
    :'language' => :'language',
    :'unique_token' => :'unique_token',
    :'checkpoints' => :'checkpoints',
    :'subscribed_smses' => :'subscribed_smses',
    :'subscribed_emails' => :'subscribed_emails',
    :'return_to_sender' => :'return_to_sender',
    :'order_promised_delivery_date' => :'order_promised_delivery_date',
    :'delivery_type' => :'delivery_type',
    :'pickup_location' => :'pickup_location',
    :'pickup_note' => :'pickup_note',
    :'courier_tracking_link' => :'courier_tracking_link',
    :'first_attempted_at' => :'first_attempted_at',
    :'courier_redirect_link' => :'courier_redirect_link',
    :'tracking_account_number' => :'tracking_account_number',
    :'tracking_key' => :'tracking_key',
    :'tracking_ship_date' => :'tracking_ship_date',
    :'on_time_status' => :'on_time_status',
    :'on_time_difference' => :'on_time_difference',
    :'order_tags' => :'order_tags',
    :'aftership_estimated_delivery_date' => :'aftership_estimated_delivery_date',
    :'custom_estimated_delivery_date' => :'custom_estimated_delivery_date',
    :'order_number' => :'order_number',
    :'first_estimated_delivery' => :'first_estimated_delivery',
    :'latest_estimated_delivery' => :'latest_estimated_delivery',
    :'shipment_tags' => :'shipment_tags',
    :'courier_connection_id' => :'courier_connection_id',
    :'next_couriers' => :'next_couriers',
    :'tracking_origin_country' => :'tracking_origin_country',
    :'tracking_destination_country' => :'tracking_destination_country',
    :'tracking_postal_code' => :'tracking_postal_code',
    :'tracking_state' => :'tracking_state',
    :'carbon_emissions' => :'carbon_emissions',
    :'location_id' => :'location_id',
    :'shipping_method' => :'shipping_method',
    :'failed_delivery_attempts' => :'failed_delivery_attempts',
    :'signature_requirement' => :'signature_requirement',
    :'delivery_location_type' => :'delivery_location_type',
    :'aftership_tracking_url' => :'aftership_tracking_url',
    :'aftership_tracking_order_url' => :'aftership_tracking_order_url',
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 843

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(key) && attributes[key].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[key].is_a?(Array)
        transformed_hash["#{key}"] = attributes[key].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[key].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[key])
    end
  end
  new(transformed_hash)
end

.openapi_typesObject

Attribute type mapping.



667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 667

def self.openapi_types
  {
    :'id' => :'String',
    :'legacy_id' => :'String',
    :'created_at' => :'String',
    :'updated_at' => :'String',
    :'last_updated_at' => :'String',
    :'tracking_number' => :'String',
    :'slug' => :'String',
    :'active' => :'Boolean',
    :'custom_fields' => :'Object',
    :'customer_name' => :'String',
    :'transit_time' => :'Integer',
    :'origin_country_iso3' => :'String',
    :'origin_state' => :'String',
    :'origin_city' => :'String',
    :'origin_postal_code' => :'String',
    :'origin_raw_location' => :'String',
    :'destination_country_iso3' => :'String',
    :'destination_state' => :'String',
    :'destination_city' => :'String',
    :'destination_postal_code' => :'String',
    :'destination_raw_location' => :'String',
    :'courier_destination_country_iso3' => :'String',
    :'emails' => :'Array<String>',
    :'courier_estimated_delivery_date' => :'CourierEstimatedDeliveryDateGetTrackingByIdResponse',
    :'note' => :'String',
    :'order_id' => :'String',
    :'order_id_path' => :'String',
    :'order_date' => :'String',
    :'shipment_package_count' => :'Float',
    :'shipment_pickup_date' => :'String',
    :'shipment_delivery_date' => :'String',
    :'shipment_type' => :'String',
    :'shipment_weight' => :'ShipmentWeightGetTrackingByIdResponse',
    :'signed_by' => :'String',
    :'smses' => :'Array<String>',
    :'source' => :'String',
    :'tag' => :'TagV1',
    :'subtag' => :'String',
    :'subtag_message' => :'String',
    :'title' => :'String',
    :'tracked_count' => :'Float',
    :'last_mile_tracking_supported' => :'Boolean',
    :'language' => :'String',
    :'unique_token' => :'String',
    :'checkpoints' => :'Array<Checkpoint>',
    :'subscribed_smses' => :'Array<String>',
    :'subscribed_emails' => :'Array<String>',
    :'return_to_sender' => :'Boolean',
    :'order_promised_delivery_date' => :'String',
    :'delivery_type' => :'String',
    :'pickup_location' => :'String',
    :'pickup_note' => :'String',
    :'courier_tracking_link' => :'String',
    :'first_attempted_at' => :'String',
    :'courier_redirect_link' => :'String',
    :'tracking_account_number' => :'String',
    :'tracking_key' => :'String',
    :'tracking_ship_date' => :'String',
    :'on_time_status' => :'String',
    :'on_time_difference' => :'Float',
    :'order_tags' => :'Array<String>',
    :'aftership_estimated_delivery_date' => :'AftershipEstimatedDeliveryDateGetTrackingByIdResponse',
    :'custom_estimated_delivery_date' => :'CustomEstimatedDeliveryDateGetTrackingByIdResponse',
    :'order_number' => :'String',
    :'first_estimated_delivery' => :'FirstEstimatedDeliveryGetTrackingByIdResponse',
    :'latest_estimated_delivery' => :'LatestEstimatedDeliveryGetTrackingByIdResponse',
    :'shipment_tags' => :'Array<String>',
    :'courier_connection_id' => :'String',
    :'next_couriers' => :'Array<NextCouriersGetTrackingByIdResponse>',
    :'tracking_origin_country' => :'String',
    :'tracking_destination_country' => :'String',
    :'tracking_postal_code' => :'String',
    :'tracking_state' => :'String',
    :'carbon_emissions' => :'CarbonEmissionsGetTrackingByIdResponse',
    :'location_id' => :'String',
    :'shipping_method' => :'String',
    :'failed_delivery_attempts' => :'Integer',
    :'signature_requirement' => :'String',
    :'delivery_location_type' => :'String',
    :'aftership_tracking_url' => :'String',
    :'aftership_tracking_order_url' => :'String',
  }
end

Instance Method Details

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



934
935
936
937
938
939
940
941
942
943
944
945
946
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 934

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



913
914
915
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 913

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



919
920
921
922
923
924
925
926
927
928
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 919

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?

    hash[param] = _to_hash(value)
  end
  hash
end

#to_json(*a) ⇒ Object



948
949
950
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 948

def to_json(*a)
  to_hash.to_json(*a)
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



907
908
909
# File 'lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb', line 907

def to_s
  to_hash.to_s
end