Class: AftershipAPI::Model::TrackingUpdateTrackingBySlugTrackingNumberRequest

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TrackingUpdateTrackingBySlugTrackingNumberRequest

Initializes the object

Parameters:

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

    Model attributes in the form of hash



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
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
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
# File 'lib/aftership-tracking-sdk/models/tracking_update_tracking_by_slug_tracking_number_request.rb', line 107

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

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

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

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

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

  if attributes.key?(:'customer_name')
    self.customer_name = attributes[:'customer_name']
  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?(:'note')
    self.note = attributes[:'note']
  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?(:'slug')
    self.slug = attributes[:'slug']
  end 

  if attributes.key?(:'tracking_account_number')
    self. = attributes[:'tracking_account_number']
  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_key')
    self.tracking_key = attributes[:'tracking_key']
  end 

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

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

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

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

  if attributes.key?(:'order_date')
    self.order_date = attributes[:'order_date']
  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 
end

Instance Attribute Details

#custom_fieldsObject

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



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

def custom_fields
  @custom_fields
end

#customer_nameObject

Customer name of the tracking. customer_name?: String;



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

def customer_name
  @customer_name
end

#delivery_typeObject

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



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

def delivery_type
  @delivery_type
end

#emailsObject

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



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

def emails
  @emails
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. Use an to specify the language. language?: String;



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

def language
  @language
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;



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

def location_id
  @location_id
end

#noteObject

Text field for the note note?: String;



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

def note
  @note
end

#order_dateObject

Order date in YYYY-MM-DDTHH:mm:ssZ format. e.g. 2021-07-26T11:23:51-05:00 order_date?: String;



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

def order_date
  @order_date
end

#order_idObject

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



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

def order_id
  @order_id
end

#order_id_pathObject

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



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

def order_id_path
  @order_id_path
end

#order_numberObject

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



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

def order_number
  @order_number
end

#order_promised_delivery_dateObject

The promised delivery date of the order. It uses the format YYYY-MM-DD. This has no timezone and uses whatever date you provide. Since other EDDs use the shipment recipient’s timezone, we suggest following the same logic here. order_promised_delivery_date?: String;



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

def order_promised_delivery_date
  @order_promised_delivery_date
end

#pickup_locationObject

Shipment pickup location for receiver pickup_location?: String;



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

def pickup_location
  @pickup_location
end

#pickup_noteObject

Shipment pickup note for receiver pickup_note?: String;



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

def pickup_note
  @pickup_note
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;



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

def shipping_method
  @shipping_method
end

#slugObject

Unique code of each courier. Provide a single courier.(admin.aftership.com/settings/couriers). Get a list of courier slug using slug?: String;



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

def slug
  @slug
end

#smsesObject

The phone number(s) to receive sms notifications. Supports up to 3 phone numbers. smses?: String[];



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

def smses
  @smses
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;



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

def title
  @title
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;



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

def 
  @tracking_account_number
end

#tracking_destination_countryObject

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;



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

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;



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

def tracking_key
  @tracking_key
end

#tracking_origin_countryObject

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;



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

def tracking_origin_country
  @tracking_origin_country
end

#tracking_postal_codeObject

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;



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

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;



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

def tracking_ship_date
  @tracking_ship_date
end

#tracking_stateObject

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;



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

def tracking_state
  @tracking_state
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



306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
# File 'lib/aftership-tracking-sdk/models/tracking_update_tracking_by_slug_tracking_number_request.rb', line 306

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.



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
# File 'lib/aftership-tracking-sdk/models/tracking_update_tracking_by_slug_tracking_number_request.rb', line 249

def self.attribute_map
  {
    :'smses' => :'smses',
    :'emails' => :'emails',
    :'title' => :'title',
    :'customer_name' => :'customer_name',
    :'order_id' => :'order_id',
    :'order_id_path' => :'order_id_path',
    :'custom_fields' => :'custom_fields',
    :'note' => :'note',
    :'language' => :'language',
    :'order_promised_delivery_date' => :'order_promised_delivery_date',
    :'delivery_type' => :'delivery_type',
    :'pickup_location' => :'pickup_location',
    :'pickup_note' => :'pickup_note',
    :'slug' => :'slug',
    :'tracking_account_number' => :'tracking_account_number',
    :'tracking_origin_country' => :'tracking_origin_country',
    :'tracking_destination_country' => :'tracking_destination_country',
    :'tracking_key' => :'tracking_key',
    :'tracking_postal_code' => :'tracking_postal_code',
    :'tracking_ship_date' => :'tracking_ship_date',
    :'tracking_state' => :'tracking_state',
    :'order_number' => :'order_number',
    :'order_date' => :'order_date',
    :'location_id' => :'location_id',
    :'shipping_method' => :'shipping_method',
  }
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



282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/aftership-tracking-sdk/models/tracking_update_tracking_by_slug_tracking_number_request.rb', line 282

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.



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
# File 'lib/aftership-tracking-sdk/models/tracking_update_tracking_by_slug_tracking_number_request.rb', line 218

def self.openapi_types
  {
    :'smses' => :'Array<String>',
    :'emails' => :'Array<String>',
    :'title' => :'String',
    :'customer_name' => :'String',
    :'order_id' => :'String',
    :'order_id_path' => :'String',
    :'custom_fields' => :'CustomFieldsTrackingUpdateTrackingBySlugTrackingNumberRequest',
    :'note' => :'String',
    :'language' => :'String',
    :'order_promised_delivery_date' => :'String',
    :'delivery_type' => :'String',
    :'pickup_location' => :'String',
    :'pickup_note' => :'String',
    :'slug' => :'String',
    :'tracking_account_number' => :'String',
    :'tracking_origin_country' => :'String',
    :'tracking_destination_country' => :'String',
    :'tracking_key' => :'String',
    :'tracking_postal_code' => :'String',
    :'tracking_ship_date' => :'String',
    :'tracking_state' => :'String',
    :'order_number' => :'String',
    :'order_date' => :'String',
    :'location_id' => :'String',
    :'shipping_method' => :'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



373
374
375
376
377
378
379
380
381
382
383
384
385
# File 'lib/aftership-tracking-sdk/models/tracking_update_tracking_by_slug_tracking_number_request.rb', line 373

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



352
353
354
# File 'lib/aftership-tracking-sdk/models/tracking_update_tracking_by_slug_tracking_number_request.rb', line 352

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



358
359
360
361
362
363
364
365
366
367
# File 'lib/aftership-tracking-sdk/models/tracking_update_tracking_by_slug_tracking_number_request.rb', line 358

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



387
388
389
# File 'lib/aftership-tracking-sdk/models/tracking_update_tracking_by_slug_tracking_number_request.rb', line 387

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



346
347
348
# File 'lib/aftership-tracking-sdk/models/tracking_update_tracking_by_slug_tracking_number_request.rb', line 346

def to_s
  to_hash.to_s
end