Class: AftershipAPI::Model::CreateTrackingRequest
- Inherits:
-
Object
- Object
- AftershipAPI::Model::CreateTrackingRequest
- Defined in:
- lib/aftership-tracking-sdk/models/create_tracking_request.rb
Instance Attribute Summary collapse
-
#courier_connection_id ⇒ Object
If you’ve connected multiple accounts for a single carrier on AfterShip, you can now use the courier_connection_id field to tell AfterShip which carrier account you’ve used to handle a shipment so we can track it.
-
#custom_fields ⇒ Object
Custom fields that accept an object with string field.
-
#customers ⇒ Object
The field contains the customer information associated with the tracking.
-
#delivery_type ⇒ Object
Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door delivery_type?: String;.
-
#destination_city ⇒ Object
The city of the recipient’s address.
-
#destination_country_region ⇒ Object
The for more details.
-
#destination_postal_code ⇒ Object
The postal of the recipient’s address.
-
#destination_raw_location ⇒ Object
The shipping address that the shipment is shipping to.
-
#destination_state ⇒ Object
The state of the recipient’s address.
-
#language ⇒ Object
The recipient’s language.
-
#last_mile ⇒ Object
This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery.
-
#location_id ⇒ Object
The location_id refers to the place where you fulfilled the items.
-
#note ⇒ Object
Text field for the note note?: String;.
-
#order_date ⇒ Object
Order date in YYYY-MM-DDTHH:mm:ssZ format.
-
#order_id ⇒ Object
A globally-unique identifier for the order.
-
#order_id_path ⇒ Object
The URL for the order in your system or store.
-
#order_number ⇒ Object
A unique, human-readable identifier for the order.
-
#order_promised_delivery_date ⇒ Object
The promised delivery date of the order.
-
#origin_city ⇒ Object
The city of the sender’s address.
-
#origin_country_region ⇒ Object
The for more details.
-
#origin_postal_code ⇒ Object
The postal of the sender’s address.
-
#origin_raw_location ⇒ Object
The sender address that the shipment is shipping from.
-
#origin_state ⇒ Object
The state of the sender’s address.
-
#pickup_location ⇒ Object
Shipment pickup location for receiver pickup_location?: String;.
-
#pickup_note ⇒ Object
Shipment pickup note for receiver pickup_note?: String;.
-
#shipment_tags ⇒ Object
Used to add tags to your shipments to help categorize and filter them easily.
-
#shipment_type ⇒ Object
The carrier service type for the shipment.
-
#shipping_method ⇒ Object
The shipping_method string refers to the chosen method for delivering the package.
-
#slug ⇒ Object
Unique courier code.
-
#slug_group ⇒ Object
Slug group is a group of slugs which belong to same courier.
-
#title ⇒ Object
By default this field shows the
tracking_number, but you can customize it as you wish with any info (e.g. the order number). -
#tracking_account_number ⇒ Object
Additional field required by some carriers to retrieve the tracking info.
-
#tracking_destination_country_region ⇒ Object
(Legacy) Replaced by
destination_country_region. -
#tracking_key ⇒ Object
Additional field required by some carriers to retrieve the tracking info.
-
#tracking_number ⇒ Object
Tracking number of a shipment.Duplicated tracking numbers, tracking numbers with invalid tracking number format will not be accepted.We only accept tracking numbers with length from 4 to 100We currently support the following characters in a tracking number:- A - Z- 0 - 9-
-(Hyphen)- . -
#tracking_origin_country_region ⇒ Object
(Legacy) Replaced by
origin_country_region. -
#tracking_postal_code ⇒ Object
(Legacy) Replaced by
destination_postal_code. -
#tracking_ship_date ⇒ Object
The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier.
-
#tracking_state ⇒ Object
(Legacy) Replaced by
destination_state.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#initialize(attributes = {}) ⇒ CreateTrackingRequest
constructor
Initializes the object.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
- #to_json(*a) ⇒ Object
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ CreateTrackingRequest
Initializes the object
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 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 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 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 316 317 318 319 320 321 322 323 324 325 326 327 328 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 164 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `AftershipAPI::CreateTrackingRequest` initialize method" end attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.key?(:'tracking_number') self.tracking_number = attributes[:'tracking_number'] end if attributes.key?(:'slug') self.slug = attributes[:'slug'] end if attributes.key?(:'title') self.title = attributes[:'title'] 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?(:'custom_fields') self.custom_fields = attributes[:'custom_fields'] end if attributes.key?(:'language') self.language = attributes[:'language'] 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?(:'tracking_account_number') self.tracking_account_number = 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?(:'origin_country_region') self.origin_country_region = attributes[:'origin_country_region'] 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_region') self.destination_country_region = attributes[:'destination_country_region'] 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?(:'note') self.note = attributes[:'note'] end if attributes.key?(:'slug_group') self.slug_group = attributes[:'slug_group'] end if attributes.key?(:'order_date') self.order_date = attributes[:'order_date'] end if attributes.key?(:'order_number') self.order_number = attributes[:'order_number'] end if attributes.key?(:'shipment_type') self.shipment_type = attributes[:'shipment_type'] end if attributes.key?(:'shipment_tags') self. = attributes[:'shipment_tags'] end if attributes.key?(:'courier_connection_id') self.courier_connection_id = attributes[:'courier_connection_id'] end if attributes.key?(:'tracking_origin_country_region') self.tracking_origin_country_region = attributes[:'tracking_origin_country_region'] end if attributes.key?(:'tracking_destination_country_region') self.tracking_destination_country_region = attributes[:'tracking_destination_country_region'] 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?(:'location_id') self.location_id = attributes[:'location_id'] end if attributes.key?(:'shipping_method') self.shipping_method = attributes[:'shipping_method'] end if attributes.key?(:'last_mile') self.last_mile = attributes[:'last_mile'] end if attributes.key?(:'customers') self.customers = attributes[:'customers'] end end |
Instance Attribute Details
#courier_connection_id ⇒ Object
If you’ve connected multiple accounts for a single carrier on AfterShip, you can now use the courier_connection_id field to tell AfterShip which carrier account you’ve used to handle a shipment so we can track it. ( courier_connection_id?: String;
128 129 130 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 128 def courier_connection_id @courier_connection_id end |
#custom_fields ⇒ Object
Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any custom_fields?: Object;
28 29 30 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 28 def custom_fields @custom_fields end |
#customers ⇒ Object
The field contains the customer information associated with the tracking. A maximum of three customer objects are allowed. customers?: CustomersCreateTrackingRequest[];
160 161 162 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 160 def customers @customers end |
#delivery_type ⇒ Object
Shipment delivery type- pickup_at_store- pickup_at_courier- door_to_door delivery_type?: String;
40 41 42 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 40 def delivery_type @delivery_type end |
#destination_city ⇒ Object
The city of the recipient’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. destination_city?: String;
92 93 94 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 92 def destination_city @destination_city end |
#destination_country_region ⇒ Object
The for more details. destination_country_region?: String;
84 85 86 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 84 def destination_country_region @destination_country_region end |
#destination_postal_code ⇒ Object
The postal of the recipient’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. Also the 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. destination_postal_code?: String;
96 97 98 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 96 def destination_postal_code @destination_postal_code end |
#destination_raw_location ⇒ Object
The shipping address that the shipment is shipping to. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. destination_raw_location?: String;
100 101 102 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 100 def destination_raw_location @destination_raw_location end |
#destination_state ⇒ Object
The state of the recipient’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. Also the 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. destination_state?: String;
88 89 90 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 88 def destination_state @destination_state end |
#language ⇒ Object
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. Use an to specify the language. language?: String;
32 33 34 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 32 def language @language end |
#last_mile ⇒ Object
This field contains information about the last leg of the shipment, starting from the carrier who hands it over to the last-mile carrier, all the way to delivery. Once AfterShip detects that the shipment involves multiple legs and identifies the last-mile carrier, we will populate the last-mile carrier information in this object. Alternatively, the user can provide this information in this field to specify the last-mile carrier, which is helpful if AfterShip is unable to detect it automatically. last_mile?: LastMileCreateTrackingRequest;
156 157 158 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 156 def last_mile @last_mile end |
#location_id ⇒ Object
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;
148 149 150 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 148 def location_id @location_id end |
#note ⇒ Object
Text field for the note note?: String;
104 105 106 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 104 def note @note end |
#order_date ⇒ Object
Order date in YYYY-MM-DDTHH:mm:ssZ format. e.g. 2021-07-26T11:23:51-05:00 order_date?: String;
112 113 114 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 112 def order_date @order_date end |
#order_id ⇒ Object
A globally-unique identifier for the order. order_id?: String;
20 21 22 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 20 def order_id @order_id end |
#order_id_path ⇒ Object
The URL for the order in your system or store. order_id_path?: String;
24 25 26 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 24 def order_id_path @order_id_path end |
#order_number ⇒ Object
A unique, human-readable identifier for the order. order_number?: String;
116 117 118 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 116 def order_number @order_number end |
#order_promised_delivery_date ⇒ Object
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;
36 37 38 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 36 def order_promised_delivery_date @order_promised_delivery_date end |
#origin_city ⇒ Object
The city of the sender’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. origin_city?: String;
72 73 74 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 72 def origin_city @origin_city end |
#origin_country_region ⇒ Object
The for more details. origin_country_region?: String;
64 65 66 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 64 def origin_country_region @origin_country_region end |
#origin_postal_code ⇒ Object
The postal of the sender’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. origin_postal_code?: String;
76 77 78 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 76 def origin_postal_code @origin_postal_code end |
#origin_raw_location ⇒ Object
The sender address that the shipment is shipping from. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. origin_raw_location?: String;
80 81 82 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 80 def origin_raw_location @origin_raw_location end |
#origin_state ⇒ Object
The state of the sender’s address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. origin_state?: String;
68 69 70 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 68 def origin_state @origin_state end |
#pickup_location ⇒ Object
Shipment pickup location for receiver pickup_location?: String;
44 45 46 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 44 def pickup_location @pickup_location end |
#pickup_note ⇒ Object
Shipment pickup note for receiver pickup_note?: String;
48 49 50 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 48 def pickup_note @pickup_note end |
#shipment_tags ⇒ Object
Used to add tags to your shipments to help categorize and filter them easily. shipment_tags?: String[];
124 125 126 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 124 def end |
#shipment_type ⇒ Object
The carrier service type for the shipment. If you provide info for this field, AfterShip will not update it with info from the carrier. shipment_type?: String;
120 121 122 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 120 def shipment_type @shipment_type end |
#shipping_method ⇒ Object
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;
152 153 154 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 152 def shipping_method @shipping_method end |
#slug ⇒ Object
Unique courier code. Get courier codes . slug?: String;
12 13 14 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 12 def slug @slug end |
#slug_group ⇒ Object
Slug group is a group of slugs which belong to same courier. For example, when you inpit “fedex-group” as slug_group, AfterShip will detect the tracking with “fedex-uk”, “fedex-fims”, and other slugs which belong to “fedex”. It cannot be used with slug at the same time. ( slug_group?: SlugGroupV1;
108 109 110 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 108 def slug_group @slug_group end |
#title ⇒ Object
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;
16 17 18 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 16 def title @title end |
#tracking_account_number ⇒ Object
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;
52 53 54 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 52 def tracking_account_number @tracking_account_number end |
#tracking_destination_country_region ⇒ Object
(Legacy) Replaced by destination_country_region. 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_region?: String;
136 137 138 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 136 def tracking_destination_country_region @tracking_destination_country_region end |
#tracking_key ⇒ Object
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;
56 57 58 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 56 def tracking_key @tracking_key end |
#tracking_number ⇒ Object
Tracking number of a shipment.Duplicated tracking numbers, tracking numbers with invalid tracking number format will not be accepted.We only accept tracking numbers with length from 4 to 100We currently support the following characters in a tracking number:- A - Z- 0 - 9- - (Hyphen)- . (Period)- _ (Underscore)- / (Slash) tracking_number: String;
8 9 10 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 8 def tracking_number @tracking_number end |
#tracking_origin_country_region ⇒ Object
(Legacy) Replaced by origin_country_region. 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_region?: String;
132 133 134 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 132 def tracking_origin_country_region @tracking_origin_country_region end |
#tracking_postal_code ⇒ Object
(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;
140 141 142 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 140 def tracking_postal_code @tracking_postal_code end |
#tracking_ship_date ⇒ Object
The date and time when the shipment is shipped by the merchant and ready for pickup by the carrier. The field supports the following formats:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZThe field serves two key purposes:- Calculate processing time metrics in the Order-to-delivery Analytics dashboard. To ensure accurate analytics, it’s recommended to include timezone information when configuring this value- Required by certain carriers to retrieve tracking information as an additional tracking field. tracking_ship_date?: String;
60 61 62 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 60 def tracking_ship_date @tracking_ship_date end |
#tracking_state ⇒ Object
(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;
144 145 146 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 144 def tracking_state @tracking_state end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 447 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_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 376 def self.attribute_map { :'tracking_number' => :'tracking_number', :'slug' => :'slug', :'title' => :'title', :'order_id' => :'order_id', :'order_id_path' => :'order_id_path', :'custom_fields' => :'custom_fields', :'language' => :'language', :'order_promised_delivery_date' => :'order_promised_delivery_date', :'delivery_type' => :'delivery_type', :'pickup_location' => :'pickup_location', :'pickup_note' => :'pickup_note', :'tracking_account_number' => :'tracking_account_number', :'tracking_key' => :'tracking_key', :'tracking_ship_date' => :'tracking_ship_date', :'origin_country_region' => :'origin_country_region', :'origin_state' => :'origin_state', :'origin_city' => :'origin_city', :'origin_postal_code' => :'origin_postal_code', :'origin_raw_location' => :'origin_raw_location', :'destination_country_region' => :'destination_country_region', :'destination_state' => :'destination_state', :'destination_city' => :'destination_city', :'destination_postal_code' => :'destination_postal_code', :'destination_raw_location' => :'destination_raw_location', :'note' => :'note', :'slug_group' => :'slug_group', :'order_date' => :'order_date', :'order_number' => :'order_number', :'shipment_type' => :'shipment_type', :'shipment_tags' => :'shipment_tags', :'courier_connection_id' => :'courier_connection_id', :'tracking_origin_country_region' => :'tracking_origin_country_region', :'tracking_destination_country_region' => :'tracking_destination_country_region', :'tracking_postal_code' => :'tracking_postal_code', :'tracking_state' => :'tracking_state', :'location_id' => :'location_id', :'shipping_method' => :'shipping_method', :'last_mile' => :'last_mile', :'customers' => :'customers', } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 423 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_types ⇒ Object
Attribute type mapping.
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 368 369 370 371 372 373 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 331 def self.openapi_types { :'tracking_number' => :'String', :'slug' => :'String', :'title' => :'String', :'order_id' => :'String', :'order_id_path' => :'String', :'custom_fields' => :'Object', :'language' => :'String', :'order_promised_delivery_date' => :'String', :'delivery_type' => :'String', :'pickup_location' => :'String', :'pickup_note' => :'String', :'tracking_account_number' => :'String', :'tracking_key' => :'String', :'tracking_ship_date' => :'String', :'origin_country_region' => :'String', :'origin_state' => :'String', :'origin_city' => :'String', :'origin_postal_code' => :'String', :'origin_raw_location' => :'String', :'destination_country_region' => :'String', :'destination_state' => :'String', :'destination_city' => :'String', :'destination_postal_code' => :'String', :'destination_raw_location' => :'String', :'note' => :'String', :'slug_group' => :'SlugGroupV1', :'order_date' => :'String', :'order_number' => :'String', :'shipment_type' => :'String', :'shipment_tags' => :'Array<String>', :'courier_connection_id' => :'String', :'tracking_origin_country_region' => :'String', :'tracking_destination_country_region' => :'String', :'tracking_postal_code' => :'String', :'tracking_state' => :'String', :'location_id' => :'String', :'shipping_method' => :'String', :'last_mile' => :'LastMileCreateTrackingRequest', :'customers' => :'Array<CustomersCreateTrackingRequest>', } 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
514 515 516 517 518 519 520 521 522 523 524 525 526 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 514 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_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
493 494 495 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 493 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
499 500 501 502 503 504 505 506 507 508 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 499 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
528 529 530 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 528 def to_json(*a) to_hash.to_json(*a) end |
#to_s ⇒ String
Returns the string representation of the object
487 488 489 |
# File 'lib/aftership-tracking-sdk/models/create_tracking_request.rb', line 487 def to_s to_hash.to_s end |