aftership-tracking-sdk 7.0.0 → 9.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/README.md +68 -83
- data/lib/aftership-tracking-sdk/api/courier.rb +8 -8
- data/lib/aftership-tracking-sdk/api/estimated_delivery_date.rb +4 -4
- data/lib/aftership-tracking-sdk/api/tracking.rb +50 -416
- data/lib/aftership-tracking-sdk/api_client.rb +2 -2
- data/lib/aftership-tracking-sdk/configuration.rb +108 -108
- data/lib/aftership-tracking-sdk/models/additional_fields_v1.rb +1 -1
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_create_tracking_response.rb +183 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_delete_tracking_by_id_response.rb +183 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_get_tracking_by_id_response.rb +183 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_mark_tracking_completed_by_id_response.rb +183 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_retrack_tracking_by_id_response.rb +183 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_tracking.rb +2 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_update_tracking_by_id_response.rb +183 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_create_tracking_response.rb +163 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_delete_tracking_by_id_response.rb +163 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_get_tracking_by_id_response.rb +163 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_mark_tracking_completed_by_id_response.rb +163 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_retrack_tracking_by_id_response.rb +163 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_tracking.rb +2 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_update_tracking_by_id_response.rb +163 -0
- data/lib/aftership-tracking-sdk/models/checkpoint.rb +2 -0
- data/lib/aftership-tracking-sdk/models/coordinate_checkpoint.rb +2 -0
- data/lib/aftership-tracking-sdk/models/courier.rb +2 -0
- data/lib/aftership-tracking-sdk/models/courier_estimated_delivery_date_create_tracking_response.rb +173 -0
- data/lib/aftership-tracking-sdk/models/courier_estimated_delivery_date_delete_tracking_by_id_response.rb +173 -0
- data/lib/aftership-tracking-sdk/models/courier_estimated_delivery_date_get_tracking_by_id_response.rb +173 -0
- data/lib/aftership-tracking-sdk/models/courier_estimated_delivery_date_mark_tracking_completed_by_id_response.rb +173 -0
- data/lib/aftership-tracking-sdk/models/courier_estimated_delivery_date_retrack_tracking_by_id_response.rb +173 -0
- data/lib/aftership-tracking-sdk/models/courier_estimated_delivery_date_tracking.rb +173 -0
- data/lib/aftership-tracking-sdk/models/courier_estimated_delivery_date_update_tracking_by_id_response.rb +173 -0
- data/lib/aftership-tracking-sdk/models/courier_response_v1.rb +2 -0
- data/lib/aftership-tracking-sdk/models/{tracking_create_tracking_request.rb → create_tracking_request.rb} +9 -7
- data/lib/aftership-tracking-sdk/models/create_tracking_response.rb +953 -0
- data/lib/aftership-tracking-sdk/models/{mark_tracking_completed_by_slug_tracking_number_request.rb → custom_estimated_delivery_date_create_tracking_response.rb} +41 -9
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_delete_tracking_by_id_response.rb +183 -0
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_get_tracking_by_id_response.rb +183 -0
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_mark_tracking_completed_by_id_response.rb +183 -0
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_retrack_tracking_by_id_response.rb +183 -0
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_tracking.rb +2 -0
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_update_tracking_by_id_response.rb +183 -0
- data/lib/aftership-tracking-sdk/models/data_courier_response_v1.rb +2 -0
- data/lib/aftership-tracking-sdk/models/data_tracking_response_get_multiple_v1.rb +8 -126
- data/lib/aftership-tracking-sdk/models/delete_tracking_by_id_response.rb +953 -0
- data/lib/aftership-tracking-sdk/models/destination_address_estimated_delivery_date_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/destination_address_estimated_delivery_date_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/{tracking_detect_courier_request.rb → detect_courier_request.rb} +5 -3
- data/lib/aftership-tracking-sdk/models/detect_courier_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/estimated_delivery_date_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/estimated_delivery_date_response.rb +12 -0
- data/lib/aftership-tracking-sdk/models/estimated_pickup_estimated_delivery_date_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/estimated_pickup_estimated_delivery_date_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/events_checkpoint.rb +2 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_create_tracking_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_delete_tracking_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_get_tracking_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_mark_tracking_completed_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_retrack_tracking_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_tracking.rb +2 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_update_tracking_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/get_all_couriers_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb +953 -0
- data/lib/aftership-tracking-sdk/models/get_trackings_response.rb +5 -3
- data/lib/aftership-tracking-sdk/models/get_user_couriers_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_create_tracking_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_delete_tracking_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_get_tracking_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_mark_tracking_completed_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_retrack_tracking_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_tracking.rb +2 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_update_tracking_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/mark_tracking_completed_by_id_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/mark_tracking_completed_by_id_response.rb +953 -0
- data/lib/aftership-tracking-sdk/models/meta_v1.rb +2 -0
- data/lib/aftership-tracking-sdk/models/{next_couriers_tracking_create_tracking_request.rb → next_couriers_create_tracking_request.rb} +4 -2
- data/lib/aftership-tracking-sdk/models/{get_checkpoint_by_tracking_id_response.rb → next_couriers_create_tracking_response.rb} +33 -51
- data/lib/aftership-tracking-sdk/models/next_couriers_delete_tracking_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/{get_checkpoint_by_slug_tracking_number_response.rb → next_couriers_get_tracking_by_id_response.rb} +33 -51
- data/lib/aftership-tracking-sdk/models/next_couriers_mark_tracking_completed_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/next_couriers_retrack_tracking_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/next_couriers_tracking.rb +22 -0
- data/lib/aftership-tracking-sdk/models/next_couriers_update_tracking_by_id_response.rb +193 -0
- data/lib/aftership-tracking-sdk/models/order_processing_time_estimated_pickup_estimated_delivery_date_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/order_processing_time_estimated_pickup_estimated_delivery_date_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/origin_address_estimated_delivery_date_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/origin_address_estimated_delivery_date_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/pagination.rb +14 -6
- data/lib/aftership-tracking-sdk/models/pagination_data_tracking_response_get_multiple_v1.rb +173 -0
- data/lib/aftership-tracking-sdk/models/{notification_request_v1.rb → pagination_get_trackings_response.rb} +28 -16
- data/lib/aftership-tracking-sdk/models/predict_batch_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/predict_batch_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/reason_events_checkpoint.rb +2 -0
- data/lib/aftership-tracking-sdk/models/retrack_tracking_by_id_response.rb +953 -0
- data/lib/aftership-tracking-sdk/models/{tracking_delete_response_v1.rb → shipment_weight_create_tracking_response.rb} +18 -16
- data/lib/aftership-tracking-sdk/models/{data_notification_response_v1.rb → shipment_weight_delete_tracking_by_id_response.rb} +21 -9
- data/lib/aftership-tracking-sdk/models/{notification.rb → shipment_weight_get_tracking_by_id_response.rb} +18 -16
- data/lib/aftership-tracking-sdk/models/shipment_weight_mark_tracking_completed_by_id_response.rb +163 -0
- data/lib/aftership-tracking-sdk/models/shipment_weight_retrack_tracking_by_id_response.rb +163 -0
- data/lib/aftership-tracking-sdk/models/{notification_response_v1.rb → shipment_weight_tracking.rb} +18 -16
- data/lib/aftership-tracking-sdk/models/shipment_weight_update_tracking_by_id_response.rb +163 -0
- data/lib/aftership-tracking-sdk/models/slug_group_v1.rb +1 -1
- data/lib/aftership-tracking-sdk/models/tag_v1.rb +1 -1
- data/lib/aftership-tracking-sdk/models/tracking.rb +56 -24
- data/lib/aftership-tracking-sdk/models/tracking_response_get_multiple_v1.rb +2 -0
- data/lib/aftership-tracking-sdk/models/tracking_response_v1.rb +5 -3
- data/lib/aftership-tracking-sdk/models/{tracking_update_tracking_by_id_request.rb → update_tracking_by_id_request.rb} +5 -3
- data/lib/aftership-tracking-sdk/models/update_tracking_by_id_response.rb +953 -0
- data/lib/aftership-tracking-sdk/models/weight_estimated_delivery_date_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/weight_estimated_delivery_date_response.rb +2 -0
- data/lib/aftership-tracking-sdk/version.rb +1 -1
- metadata +64 -22
- data/lib/aftership-tracking-sdk/api/last_checkpoint.rb +0 -143
- data/lib/aftership-tracking-sdk/api/notification.rb +0 -403
- data/lib/aftership-tracking-sdk/models/custom_fields_tracking_update_tracking_by_slug_tracking_number_request.rb +0 -139
- data/lib/aftership-tracking-sdk/models/data_tracking_delete_response_v1.rb +0 -151
- data/lib/aftership-tracking-sdk/models/data_tracking_response_v1.rb +0 -151
- data/lib/aftership-tracking-sdk/models/partial_delete_tracking.rb +0 -241
- data/lib/aftership-tracking-sdk/models/partial_update_tracking.rb +0 -251
- data/lib/aftership-tracking-sdk/models/tracking_update_tracking_by_slug_tracking_number_request.rb +0 -391
data/lib/aftership-tracking-sdk/models/first_estimated_delivery_get_tracking_by_id_response.rb
ADDED
@@ -0,0 +1,193 @@
|
|
1
|
+
# This code was auto generated by AfterShip SDK Generator.
|
2
|
+
# Do not edit the class manually.
|
3
|
+
module AftershipAPI::Model
|
4
|
+
class FirstEstimatedDeliveryGetTrackingByIdResponse
|
5
|
+
|
6
|
+
# The format of the EDD. Either a single date or a date range.
|
7
|
+
# type?: String;
|
8
|
+
attr_accessor :type
|
9
|
+
|
10
|
+
# The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings.
|
11
|
+
# source?: String;
|
12
|
+
attr_accessor :source
|
13
|
+
|
14
|
+
# The latest EDD time.
|
15
|
+
# datetime?: String;
|
16
|
+
attr_accessor :datetime
|
17
|
+
|
18
|
+
# For a date range EDD format, the date and time for the lower end of the range.
|
19
|
+
# datetime_min?: String;
|
20
|
+
attr_accessor :datetime_min
|
21
|
+
|
22
|
+
# For a date range EDD format, the date and time for the upper end of the range.
|
23
|
+
# datetime_max?: String;
|
24
|
+
attr_accessor :datetime_max
|
25
|
+
|
26
|
+
# Initializes the object
|
27
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
28
|
+
def initialize(attributes = {})
|
29
|
+
if (!attributes.is_a?(Hash))
|
30
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `AftershipAPI::FirstEstimatedDeliveryGetTrackingByIdResponse` initialize method"
|
31
|
+
end
|
32
|
+
|
33
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
34
|
+
h[k.to_sym] = v
|
35
|
+
}
|
36
|
+
|
37
|
+
if attributes.key?(:'type')
|
38
|
+
self.type = attributes[:'type']
|
39
|
+
end
|
40
|
+
|
41
|
+
if attributes.key?(:'source')
|
42
|
+
self.source = attributes[:'source']
|
43
|
+
end
|
44
|
+
|
45
|
+
if attributes.key?(:'datetime')
|
46
|
+
self.datetime = attributes[:'datetime']
|
47
|
+
end
|
48
|
+
|
49
|
+
if attributes.key?(:'datetime_min')
|
50
|
+
self.datetime_min = attributes[:'datetime_min']
|
51
|
+
end
|
52
|
+
|
53
|
+
if attributes.key?(:'datetime_max')
|
54
|
+
self.datetime_max = attributes[:'datetime_max']
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# Attribute type mapping.
|
59
|
+
def self.openapi_types
|
60
|
+
{
|
61
|
+
:'type' => :'String',
|
62
|
+
:'source' => :'String',
|
63
|
+
:'datetime' => :'String',
|
64
|
+
:'datetime_min' => :'String',
|
65
|
+
:'datetime_max' => :'String',
|
66
|
+
}
|
67
|
+
end
|
68
|
+
|
69
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
70
|
+
def self.attribute_map
|
71
|
+
{
|
72
|
+
:'type' => :'type',
|
73
|
+
:'source' => :'source',
|
74
|
+
:'datetime' => :'datetime',
|
75
|
+
:'datetime_min' => :'datetime_min',
|
76
|
+
:'datetime_max' => :'datetime_max',
|
77
|
+
}
|
78
|
+
end
|
79
|
+
|
80
|
+
# Builds the object from hash
|
81
|
+
# @param attributes [Hash] Model attributes in the form of hash
|
82
|
+
# @return [Object] Returns the model itself
|
83
|
+
def self.build_from_hash(attributes)
|
84
|
+
return nil unless attributes.is_a?(Hash)
|
85
|
+
attributes = attributes.transform_keys(&:to_sym)
|
86
|
+
transformed_hash = {}
|
87
|
+
openapi_types.each_pair do |key, type|
|
88
|
+
if attributes.key?(key) && attributes[key].nil?
|
89
|
+
transformed_hash["#{key}"] = nil
|
90
|
+
elsif type =~ /\AArray<(.*)>/i
|
91
|
+
# check to ensure the input is an array given that the attribute
|
92
|
+
# is documented as an array but the input is not
|
93
|
+
if attributes[key].is_a?(Array)
|
94
|
+
transformed_hash["#{key}"] = attributes[key].map { |v| _deserialize($1, v) }
|
95
|
+
end
|
96
|
+
elsif !attributes[key].nil?
|
97
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[key])
|
98
|
+
end
|
99
|
+
end
|
100
|
+
new(transformed_hash)
|
101
|
+
end
|
102
|
+
|
103
|
+
# Deserializes the data based on type
|
104
|
+
# @param type [String] Data type
|
105
|
+
# @param value [String] Value to be deserialized
|
106
|
+
# @return [Object] Deserialized data
|
107
|
+
def self._deserialize(type, value)
|
108
|
+
case type.to_sym
|
109
|
+
when :Time
|
110
|
+
Time.parse(value)
|
111
|
+
when :Date
|
112
|
+
Date.parse(value)
|
113
|
+
when :String
|
114
|
+
value.to_s
|
115
|
+
when :Integer
|
116
|
+
value.to_i
|
117
|
+
when :Float
|
118
|
+
value.to_f
|
119
|
+
when :Boolean
|
120
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
121
|
+
true
|
122
|
+
else
|
123
|
+
false
|
124
|
+
end
|
125
|
+
when :Object
|
126
|
+
# generic object (usually a Hash), return directly
|
127
|
+
value
|
128
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
129
|
+
inner_type = Regexp.last_match[:inner_type]
|
130
|
+
value.map { |v| _deserialize(inner_type, v) }
|
131
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
132
|
+
k_type = Regexp.last_match[:k_type]
|
133
|
+
v_type = Regexp.last_match[:v_type]
|
134
|
+
{}.tap do |hash|
|
135
|
+
value.each do |k, v|
|
136
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
137
|
+
end
|
138
|
+
end
|
139
|
+
else # model
|
140
|
+
klass = AftershipAPI::Model.const_get(type)
|
141
|
+
klass.build_from_hash(value)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
# Returns the string representation of the object
|
146
|
+
# @return [String] String presentation of the object
|
147
|
+
def to_s
|
148
|
+
to_hash.to_s
|
149
|
+
end
|
150
|
+
|
151
|
+
# to_body is an alias to to_hash (backward compatibility)
|
152
|
+
# @return [Hash] Returns the object in the form of hash
|
153
|
+
def to_body
|
154
|
+
to_hash
|
155
|
+
end
|
156
|
+
|
157
|
+
# Returns the object in the form of hash
|
158
|
+
# @return [Hash] Returns the object in the form of hash
|
159
|
+
def to_hash
|
160
|
+
hash = {}
|
161
|
+
self.class.attribute_map.each_pair do |attr, param|
|
162
|
+
value = self.send(attr)
|
163
|
+
next if value.nil?
|
164
|
+
|
165
|
+
hash[param] = _to_hash(value)
|
166
|
+
end
|
167
|
+
hash
|
168
|
+
end
|
169
|
+
|
170
|
+
# Outputs non-array value in the form of hash
|
171
|
+
# For object, use to_hash. Otherwise, just return the value
|
172
|
+
# @param value [Object] Any valid value
|
173
|
+
# @return [Hash] Returns the value in the form of hash
|
174
|
+
def _to_hash(value)
|
175
|
+
if value.is_a?(Array)
|
176
|
+
value.compact.map { |v| _to_hash(v) }
|
177
|
+
elsif value.is_a?(Hash)
|
178
|
+
{}.tap do |hash|
|
179
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
180
|
+
end
|
181
|
+
elsif value.respond_to? :to_hash
|
182
|
+
value.to_hash
|
183
|
+
else
|
184
|
+
value
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
def to_json(*a)
|
189
|
+
to_hash.to_json(*a)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
@@ -0,0 +1,193 @@
|
|
1
|
+
# This code was auto generated by AfterShip SDK Generator.
|
2
|
+
# Do not edit the class manually.
|
3
|
+
module AftershipAPI::Model
|
4
|
+
class FirstEstimatedDeliveryMarkTrackingCompletedByIdResponse
|
5
|
+
|
6
|
+
# The format of the EDD. Either a single date or a date range.
|
7
|
+
# type?: String;
|
8
|
+
attr_accessor :type
|
9
|
+
|
10
|
+
# The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings.
|
11
|
+
# source?: String;
|
12
|
+
attr_accessor :source
|
13
|
+
|
14
|
+
# The latest EDD time.
|
15
|
+
# datetime?: String;
|
16
|
+
attr_accessor :datetime
|
17
|
+
|
18
|
+
# For a date range EDD format, the date and time for the lower end of the range.
|
19
|
+
# datetime_min?: String;
|
20
|
+
attr_accessor :datetime_min
|
21
|
+
|
22
|
+
# For a date range EDD format, the date and time for the upper end of the range.
|
23
|
+
# datetime_max?: String;
|
24
|
+
attr_accessor :datetime_max
|
25
|
+
|
26
|
+
# Initializes the object
|
27
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
28
|
+
def initialize(attributes = {})
|
29
|
+
if (!attributes.is_a?(Hash))
|
30
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `AftershipAPI::FirstEstimatedDeliveryMarkTrackingCompletedByIdResponse` initialize method"
|
31
|
+
end
|
32
|
+
|
33
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
34
|
+
h[k.to_sym] = v
|
35
|
+
}
|
36
|
+
|
37
|
+
if attributes.key?(:'type')
|
38
|
+
self.type = attributes[:'type']
|
39
|
+
end
|
40
|
+
|
41
|
+
if attributes.key?(:'source')
|
42
|
+
self.source = attributes[:'source']
|
43
|
+
end
|
44
|
+
|
45
|
+
if attributes.key?(:'datetime')
|
46
|
+
self.datetime = attributes[:'datetime']
|
47
|
+
end
|
48
|
+
|
49
|
+
if attributes.key?(:'datetime_min')
|
50
|
+
self.datetime_min = attributes[:'datetime_min']
|
51
|
+
end
|
52
|
+
|
53
|
+
if attributes.key?(:'datetime_max')
|
54
|
+
self.datetime_max = attributes[:'datetime_max']
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# Attribute type mapping.
|
59
|
+
def self.openapi_types
|
60
|
+
{
|
61
|
+
:'type' => :'String',
|
62
|
+
:'source' => :'String',
|
63
|
+
:'datetime' => :'String',
|
64
|
+
:'datetime_min' => :'String',
|
65
|
+
:'datetime_max' => :'String',
|
66
|
+
}
|
67
|
+
end
|
68
|
+
|
69
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
70
|
+
def self.attribute_map
|
71
|
+
{
|
72
|
+
:'type' => :'type',
|
73
|
+
:'source' => :'source',
|
74
|
+
:'datetime' => :'datetime',
|
75
|
+
:'datetime_min' => :'datetime_min',
|
76
|
+
:'datetime_max' => :'datetime_max',
|
77
|
+
}
|
78
|
+
end
|
79
|
+
|
80
|
+
# Builds the object from hash
|
81
|
+
# @param attributes [Hash] Model attributes in the form of hash
|
82
|
+
# @return [Object] Returns the model itself
|
83
|
+
def self.build_from_hash(attributes)
|
84
|
+
return nil unless attributes.is_a?(Hash)
|
85
|
+
attributes = attributes.transform_keys(&:to_sym)
|
86
|
+
transformed_hash = {}
|
87
|
+
openapi_types.each_pair do |key, type|
|
88
|
+
if attributes.key?(key) && attributes[key].nil?
|
89
|
+
transformed_hash["#{key}"] = nil
|
90
|
+
elsif type =~ /\AArray<(.*)>/i
|
91
|
+
# check to ensure the input is an array given that the attribute
|
92
|
+
# is documented as an array but the input is not
|
93
|
+
if attributes[key].is_a?(Array)
|
94
|
+
transformed_hash["#{key}"] = attributes[key].map { |v| _deserialize($1, v) }
|
95
|
+
end
|
96
|
+
elsif !attributes[key].nil?
|
97
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[key])
|
98
|
+
end
|
99
|
+
end
|
100
|
+
new(transformed_hash)
|
101
|
+
end
|
102
|
+
|
103
|
+
# Deserializes the data based on type
|
104
|
+
# @param type [String] Data type
|
105
|
+
# @param value [String] Value to be deserialized
|
106
|
+
# @return [Object] Deserialized data
|
107
|
+
def self._deserialize(type, value)
|
108
|
+
case type.to_sym
|
109
|
+
when :Time
|
110
|
+
Time.parse(value)
|
111
|
+
when :Date
|
112
|
+
Date.parse(value)
|
113
|
+
when :String
|
114
|
+
value.to_s
|
115
|
+
when :Integer
|
116
|
+
value.to_i
|
117
|
+
when :Float
|
118
|
+
value.to_f
|
119
|
+
when :Boolean
|
120
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
121
|
+
true
|
122
|
+
else
|
123
|
+
false
|
124
|
+
end
|
125
|
+
when :Object
|
126
|
+
# generic object (usually a Hash), return directly
|
127
|
+
value
|
128
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
129
|
+
inner_type = Regexp.last_match[:inner_type]
|
130
|
+
value.map { |v| _deserialize(inner_type, v) }
|
131
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
132
|
+
k_type = Regexp.last_match[:k_type]
|
133
|
+
v_type = Regexp.last_match[:v_type]
|
134
|
+
{}.tap do |hash|
|
135
|
+
value.each do |k, v|
|
136
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
137
|
+
end
|
138
|
+
end
|
139
|
+
else # model
|
140
|
+
klass = AftershipAPI::Model.const_get(type)
|
141
|
+
klass.build_from_hash(value)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
# Returns the string representation of the object
|
146
|
+
# @return [String] String presentation of the object
|
147
|
+
def to_s
|
148
|
+
to_hash.to_s
|
149
|
+
end
|
150
|
+
|
151
|
+
# to_body is an alias to to_hash (backward compatibility)
|
152
|
+
# @return [Hash] Returns the object in the form of hash
|
153
|
+
def to_body
|
154
|
+
to_hash
|
155
|
+
end
|
156
|
+
|
157
|
+
# Returns the object in the form of hash
|
158
|
+
# @return [Hash] Returns the object in the form of hash
|
159
|
+
def to_hash
|
160
|
+
hash = {}
|
161
|
+
self.class.attribute_map.each_pair do |attr, param|
|
162
|
+
value = self.send(attr)
|
163
|
+
next if value.nil?
|
164
|
+
|
165
|
+
hash[param] = _to_hash(value)
|
166
|
+
end
|
167
|
+
hash
|
168
|
+
end
|
169
|
+
|
170
|
+
# Outputs non-array value in the form of hash
|
171
|
+
# For object, use to_hash. Otherwise, just return the value
|
172
|
+
# @param value [Object] Any valid value
|
173
|
+
# @return [Hash] Returns the value in the form of hash
|
174
|
+
def _to_hash(value)
|
175
|
+
if value.is_a?(Array)
|
176
|
+
value.compact.map { |v| _to_hash(v) }
|
177
|
+
elsif value.is_a?(Hash)
|
178
|
+
{}.tap do |hash|
|
179
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
180
|
+
end
|
181
|
+
elsif value.respond_to? :to_hash
|
182
|
+
value.to_hash
|
183
|
+
else
|
184
|
+
value
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
def to_json(*a)
|
189
|
+
to_hash.to_json(*a)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
data/lib/aftership-tracking-sdk/models/first_estimated_delivery_retrack_tracking_by_id_response.rb
ADDED
@@ -0,0 +1,193 @@
|
|
1
|
+
# This code was auto generated by AfterShip SDK Generator.
|
2
|
+
# Do not edit the class manually.
|
3
|
+
module AftershipAPI::Model
|
4
|
+
class FirstEstimatedDeliveryRetrackTrackingByIdResponse
|
5
|
+
|
6
|
+
# The format of the EDD. Either a single date or a date range.
|
7
|
+
# type?: String;
|
8
|
+
attr_accessor :type
|
9
|
+
|
10
|
+
# The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings.
|
11
|
+
# source?: String;
|
12
|
+
attr_accessor :source
|
13
|
+
|
14
|
+
# The latest EDD time.
|
15
|
+
# datetime?: String;
|
16
|
+
attr_accessor :datetime
|
17
|
+
|
18
|
+
# For a date range EDD format, the date and time for the lower end of the range.
|
19
|
+
# datetime_min?: String;
|
20
|
+
attr_accessor :datetime_min
|
21
|
+
|
22
|
+
# For a date range EDD format, the date and time for the upper end of the range.
|
23
|
+
# datetime_max?: String;
|
24
|
+
attr_accessor :datetime_max
|
25
|
+
|
26
|
+
# Initializes the object
|
27
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
28
|
+
def initialize(attributes = {})
|
29
|
+
if (!attributes.is_a?(Hash))
|
30
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `AftershipAPI::FirstEstimatedDeliveryRetrackTrackingByIdResponse` initialize method"
|
31
|
+
end
|
32
|
+
|
33
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
34
|
+
h[k.to_sym] = v
|
35
|
+
}
|
36
|
+
|
37
|
+
if attributes.key?(:'type')
|
38
|
+
self.type = attributes[:'type']
|
39
|
+
end
|
40
|
+
|
41
|
+
if attributes.key?(:'source')
|
42
|
+
self.source = attributes[:'source']
|
43
|
+
end
|
44
|
+
|
45
|
+
if attributes.key?(:'datetime')
|
46
|
+
self.datetime = attributes[:'datetime']
|
47
|
+
end
|
48
|
+
|
49
|
+
if attributes.key?(:'datetime_min')
|
50
|
+
self.datetime_min = attributes[:'datetime_min']
|
51
|
+
end
|
52
|
+
|
53
|
+
if attributes.key?(:'datetime_max')
|
54
|
+
self.datetime_max = attributes[:'datetime_max']
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# Attribute type mapping.
|
59
|
+
def self.openapi_types
|
60
|
+
{
|
61
|
+
:'type' => :'String',
|
62
|
+
:'source' => :'String',
|
63
|
+
:'datetime' => :'String',
|
64
|
+
:'datetime_min' => :'String',
|
65
|
+
:'datetime_max' => :'String',
|
66
|
+
}
|
67
|
+
end
|
68
|
+
|
69
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
70
|
+
def self.attribute_map
|
71
|
+
{
|
72
|
+
:'type' => :'type',
|
73
|
+
:'source' => :'source',
|
74
|
+
:'datetime' => :'datetime',
|
75
|
+
:'datetime_min' => :'datetime_min',
|
76
|
+
:'datetime_max' => :'datetime_max',
|
77
|
+
}
|
78
|
+
end
|
79
|
+
|
80
|
+
# Builds the object from hash
|
81
|
+
# @param attributes [Hash] Model attributes in the form of hash
|
82
|
+
# @return [Object] Returns the model itself
|
83
|
+
def self.build_from_hash(attributes)
|
84
|
+
return nil unless attributes.is_a?(Hash)
|
85
|
+
attributes = attributes.transform_keys(&:to_sym)
|
86
|
+
transformed_hash = {}
|
87
|
+
openapi_types.each_pair do |key, type|
|
88
|
+
if attributes.key?(key) && attributes[key].nil?
|
89
|
+
transformed_hash["#{key}"] = nil
|
90
|
+
elsif type =~ /\AArray<(.*)>/i
|
91
|
+
# check to ensure the input is an array given that the attribute
|
92
|
+
# is documented as an array but the input is not
|
93
|
+
if attributes[key].is_a?(Array)
|
94
|
+
transformed_hash["#{key}"] = attributes[key].map { |v| _deserialize($1, v) }
|
95
|
+
end
|
96
|
+
elsif !attributes[key].nil?
|
97
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[key])
|
98
|
+
end
|
99
|
+
end
|
100
|
+
new(transformed_hash)
|
101
|
+
end
|
102
|
+
|
103
|
+
# Deserializes the data based on type
|
104
|
+
# @param type [String] Data type
|
105
|
+
# @param value [String] Value to be deserialized
|
106
|
+
# @return [Object] Deserialized data
|
107
|
+
def self._deserialize(type, value)
|
108
|
+
case type.to_sym
|
109
|
+
when :Time
|
110
|
+
Time.parse(value)
|
111
|
+
when :Date
|
112
|
+
Date.parse(value)
|
113
|
+
when :String
|
114
|
+
value.to_s
|
115
|
+
when :Integer
|
116
|
+
value.to_i
|
117
|
+
when :Float
|
118
|
+
value.to_f
|
119
|
+
when :Boolean
|
120
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
121
|
+
true
|
122
|
+
else
|
123
|
+
false
|
124
|
+
end
|
125
|
+
when :Object
|
126
|
+
# generic object (usually a Hash), return directly
|
127
|
+
value
|
128
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
129
|
+
inner_type = Regexp.last_match[:inner_type]
|
130
|
+
value.map { |v| _deserialize(inner_type, v) }
|
131
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
132
|
+
k_type = Regexp.last_match[:k_type]
|
133
|
+
v_type = Regexp.last_match[:v_type]
|
134
|
+
{}.tap do |hash|
|
135
|
+
value.each do |k, v|
|
136
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
137
|
+
end
|
138
|
+
end
|
139
|
+
else # model
|
140
|
+
klass = AftershipAPI::Model.const_get(type)
|
141
|
+
klass.build_from_hash(value)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
# Returns the string representation of the object
|
146
|
+
# @return [String] String presentation of the object
|
147
|
+
def to_s
|
148
|
+
to_hash.to_s
|
149
|
+
end
|
150
|
+
|
151
|
+
# to_body is an alias to to_hash (backward compatibility)
|
152
|
+
# @return [Hash] Returns the object in the form of hash
|
153
|
+
def to_body
|
154
|
+
to_hash
|
155
|
+
end
|
156
|
+
|
157
|
+
# Returns the object in the form of hash
|
158
|
+
# @return [Hash] Returns the object in the form of hash
|
159
|
+
def to_hash
|
160
|
+
hash = {}
|
161
|
+
self.class.attribute_map.each_pair do |attr, param|
|
162
|
+
value = self.send(attr)
|
163
|
+
next if value.nil?
|
164
|
+
|
165
|
+
hash[param] = _to_hash(value)
|
166
|
+
end
|
167
|
+
hash
|
168
|
+
end
|
169
|
+
|
170
|
+
# Outputs non-array value in the form of hash
|
171
|
+
# For object, use to_hash. Otherwise, just return the value
|
172
|
+
# @param value [Object] Any valid value
|
173
|
+
# @return [Hash] Returns the value in the form of hash
|
174
|
+
def _to_hash(value)
|
175
|
+
if value.is_a?(Array)
|
176
|
+
value.compact.map { |v| _to_hash(v) }
|
177
|
+
elsif value.is_a?(Hash)
|
178
|
+
{}.tap do |hash|
|
179
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
180
|
+
end
|
181
|
+
elsif value.respond_to? :to_hash
|
182
|
+
value.to_hash
|
183
|
+
else
|
184
|
+
value
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
def to_json(*a)
|
189
|
+
to_hash.to_json(*a)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# Do not edit the class manually.
|
3
3
|
module AftershipAPI::Model
|
4
4
|
class FirstEstimatedDeliveryTracking
|
5
|
+
|
5
6
|
# The format of the EDD. Either a single date or a date range.
|
6
7
|
# type?: String;
|
7
8
|
attr_accessor :type
|
@@ -189,3 +190,4 @@ module AftershipAPI::Model
|
|
189
190
|
end
|
190
191
|
end
|
191
192
|
end
|
193
|
+
|