aftership-tracking-sdk 8.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 +4 -3
- data/lib/aftership-tracking-sdk/api/courier.rb +6 -6
- data/lib/aftership-tracking-sdk/api/estimated_delivery_date.rb +4 -4
- data/lib/aftership-tracking-sdk/api/tracking.rb +23 -389
- 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 +2 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_delete_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_get_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_mark_tracking_completed_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_retrack_tracking_by_id_response.rb +2 -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 +2 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_create_tracking_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_delete_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_get_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_mark_tracking_completed_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/carbon_emissions_retrack_tracking_by_id_response.rb +2 -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 +2 -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/{aftership_estimated_delivery_date_get_tracking_by_slug_tracking_number_response.rb → courier_estimated_delivery_date_create_tracking_response.rb} +7 -15
- data/lib/aftership-tracking-sdk/models/{aftership_estimated_delivery_date_retrack_tracking_by_slug_tracking_number_response.rb → courier_estimated_delivery_date_delete_tracking_by_id_response.rb} +7 -15
- data/lib/aftership-tracking-sdk/models/{aftership_estimated_delivery_date_mark_tracking_completed_by_slug_tracking_number_response.rb → courier_estimated_delivery_date_get_tracking_by_id_response.rb} +7 -15
- 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/{aftership_estimated_delivery_date_delete_tracking_by_slug_tracking_number_response.rb → courier_estimated_delivery_date_tracking.rb} +7 -15
- 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/create_tracking_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/create_tracking_response.rb +29 -7
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_create_tracking_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_delete_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_get_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_mark_tracking_completed_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_retrack_tracking_by_id_response.rb +2 -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 +2 -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 +29 -7
- 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/detect_courier_request.rb +2 -0
- 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 +2 -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 +2 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_delete_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_get_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_mark_tracking_completed_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_retrack_tracking_by_id_response.rb +2 -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 +2 -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 +29 -7
- 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 +2 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_delete_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_get_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_mark_tracking_completed_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_retrack_tracking_by_id_response.rb +2 -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 +2 -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 +29 -7
- data/lib/aftership-tracking-sdk/models/meta_v1.rb +2 -0
- data/lib/aftership-tracking-sdk/models/next_couriers_create_tracking_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/next_couriers_create_tracking_response.rb +22 -0
- data/lib/aftership-tracking-sdk/models/next_couriers_delete_tracking_by_id_response.rb +22 -0
- data/lib/aftership-tracking-sdk/models/next_couriers_get_tracking_by_id_response.rb +22 -0
- data/lib/aftership-tracking-sdk/models/next_couriers_mark_tracking_completed_by_id_response.rb +22 -0
- data/lib/aftership-tracking-sdk/models/next_couriers_retrack_tracking_by_id_response.rb +22 -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 +22 -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/{next_couriers_get_tracking_by_slug_tracking_number_response.rb → pagination_data_tracking_response_get_multiple_v1.rb} +25 -23
- data/lib/aftership-tracking-sdk/models/{next_couriers_delete_tracking_by_slug_tracking_number_response.rb → pagination_get_trackings_response.rb} +25 -23
- 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 +29 -7
- data/lib/aftership-tracking-sdk/models/shipment_weight_create_tracking_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/shipment_weight_delete_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/shipment_weight_get_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/shipment_weight_mark_tracking_completed_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/shipment_weight_retrack_tracking_by_id_response.rb +2 -0
- data/lib/aftership-tracking-sdk/models/shipment_weight_tracking.rb +2 -0
- data/lib/aftership-tracking-sdk/models/shipment_weight_update_tracking_by_id_response.rb +2 -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 +29 -7
- data/lib/aftership-tracking-sdk/models/tracking_response_get_multiple_v1.rb +2 -0
- data/lib/aftership-tracking-sdk/models/tracking_response_v1.rb +2 -0
- data/lib/aftership-tracking-sdk/models/update_tracking_by_id_request.rb +2 -0
- data/lib/aftership-tracking-sdk/models/update_tracking_by_id_response.rb +29 -7
- 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 +11 -45
- data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_update_tracking_by_slug_tracking_number_response.rb +0 -181
- data/lib/aftership-tracking-sdk/models/carbon_emissions_delete_tracking_by_slug_tracking_number_response.rb +0 -161
- data/lib/aftership-tracking-sdk/models/carbon_emissions_get_tracking_by_slug_tracking_number_response.rb +0 -161
- data/lib/aftership-tracking-sdk/models/carbon_emissions_mark_tracking_completed_by_slug_tracking_number_response.rb +0 -161
- data/lib/aftership-tracking-sdk/models/carbon_emissions_retrack_tracking_by_slug_tracking_number_response.rb +0 -161
- data/lib/aftership-tracking-sdk/models/carbon_emissions_update_tracking_by_slug_tracking_number_response.rb +0 -161
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_delete_tracking_by_slug_tracking_number_response.rb +0 -181
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_get_tracking_by_slug_tracking_number_response.rb +0 -181
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_mark_tracking_completed_by_slug_tracking_number_response.rb +0 -181
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_retrack_tracking_by_slug_tracking_number_response.rb +0 -181
- data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_update_tracking_by_slug_tracking_number_response.rb +0 -181
- data/lib/aftership-tracking-sdk/models/custom_fields_update_tracking_by_slug_tracking_number_request.rb +0 -139
- data/lib/aftership-tracking-sdk/models/delete_tracking_by_slug_tracking_number_response.rb +0 -931
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_delete_tracking_by_slug_tracking_number_response.rb +0 -191
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_get_tracking_by_slug_tracking_number_response.rb +0 -191
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_mark_tracking_completed_by_slug_tracking_number_response.rb +0 -191
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_retrack_tracking_by_slug_tracking_number_response.rb +0 -191
- data/lib/aftership-tracking-sdk/models/first_estimated_delivery_update_tracking_by_slug_tracking_number_response.rb +0 -191
- data/lib/aftership-tracking-sdk/models/get_tracking_by_slug_tracking_number_response.rb +0 -931
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_delete_tracking_by_slug_tracking_number_response.rb +0 -191
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_get_tracking_by_slug_tracking_number_response.rb +0 -191
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_mark_tracking_completed_by_slug_tracking_number_response.rb +0 -191
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_retrack_tracking_by_slug_tracking_number_response.rb +0 -191
- data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_update_tracking_by_slug_tracking_number_response.rb +0 -191
- data/lib/aftership-tracking-sdk/models/mark_tracking_completed_by_slug_tracking_number_request.rb +0 -151
- data/lib/aftership-tracking-sdk/models/mark_tracking_completed_by_slug_tracking_number_response.rb +0 -931
- data/lib/aftership-tracking-sdk/models/next_couriers_mark_tracking_completed_by_slug_tracking_number_response.rb +0 -171
- data/lib/aftership-tracking-sdk/models/next_couriers_retrack_tracking_by_slug_tracking_number_response.rb +0 -171
- data/lib/aftership-tracking-sdk/models/next_couriers_update_tracking_by_slug_tracking_number_response.rb +0 -171
- data/lib/aftership-tracking-sdk/models/retrack_tracking_by_slug_tracking_number_response.rb +0 -931
- data/lib/aftership-tracking-sdk/models/shipment_weight_delete_tracking_by_slug_tracking_number_response.rb +0 -161
- data/lib/aftership-tracking-sdk/models/shipment_weight_get_tracking_by_slug_tracking_number_response.rb +0 -161
- data/lib/aftership-tracking-sdk/models/shipment_weight_mark_tracking_completed_by_slug_tracking_number_response.rb +0 -161
- data/lib/aftership-tracking-sdk/models/shipment_weight_retrack_tracking_by_slug_tracking_number_response.rb +0 -161
- data/lib/aftership-tracking-sdk/models/shipment_weight_update_tracking_by_slug_tracking_number_response.rb +0 -161
- data/lib/aftership-tracking-sdk/models/update_tracking_by_slug_tracking_number_request.rb +0 -391
- data/lib/aftership-tracking-sdk/models/update_tracking_by_slug_tracking_number_response.rb +0 -931
@@ -1,191 +0,0 @@
|
|
1
|
-
# This code was auto generated by AfterShip SDK Generator.
|
2
|
-
# Do not edit the class manually.
|
3
|
-
module AftershipAPI::Model
|
4
|
-
class LatestEstimatedDeliveryDeleteTrackingBySlugTrackingNumberResponse
|
5
|
-
# The format of the EDD. Either a single date or a date range.
|
6
|
-
# type?: String;
|
7
|
-
attr_accessor :type
|
8
|
-
|
9
|
-
# The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings.
|
10
|
-
# source?: String;
|
11
|
-
attr_accessor :source
|
12
|
-
|
13
|
-
# The latest EDD time.
|
14
|
-
# datetime?: String;
|
15
|
-
attr_accessor :datetime
|
16
|
-
|
17
|
-
# For a date range EDD format, the date and time for the lower end of the range.
|
18
|
-
# datetime_min?: String;
|
19
|
-
attr_accessor :datetime_min
|
20
|
-
|
21
|
-
# For a date range EDD format, the date and time for the upper end of the range.
|
22
|
-
# datetime_max?: String;
|
23
|
-
attr_accessor :datetime_max
|
24
|
-
|
25
|
-
# Initializes the object
|
26
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
27
|
-
def initialize(attributes = {})
|
28
|
-
if (!attributes.is_a?(Hash))
|
29
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `AftershipAPI::LatestEstimatedDeliveryDeleteTrackingBySlugTrackingNumberResponse` initialize method"
|
30
|
-
end
|
31
|
-
|
32
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
33
|
-
h[k.to_sym] = v
|
34
|
-
}
|
35
|
-
|
36
|
-
if attributes.key?(:'type')
|
37
|
-
self.type = attributes[:'type']
|
38
|
-
end
|
39
|
-
|
40
|
-
if attributes.key?(:'source')
|
41
|
-
self.source = attributes[:'source']
|
42
|
-
end
|
43
|
-
|
44
|
-
if attributes.key?(:'datetime')
|
45
|
-
self.datetime = attributes[:'datetime']
|
46
|
-
end
|
47
|
-
|
48
|
-
if attributes.key?(:'datetime_min')
|
49
|
-
self.datetime_min = attributes[:'datetime_min']
|
50
|
-
end
|
51
|
-
|
52
|
-
if attributes.key?(:'datetime_max')
|
53
|
-
self.datetime_max = attributes[:'datetime_max']
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
# Attribute type mapping.
|
58
|
-
def self.openapi_types
|
59
|
-
{
|
60
|
-
:'type' => :'String',
|
61
|
-
:'source' => :'String',
|
62
|
-
:'datetime' => :'String',
|
63
|
-
:'datetime_min' => :'String',
|
64
|
-
:'datetime_max' => :'String',
|
65
|
-
}
|
66
|
-
end
|
67
|
-
|
68
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
69
|
-
def self.attribute_map
|
70
|
-
{
|
71
|
-
:'type' => :'type',
|
72
|
-
:'source' => :'source',
|
73
|
-
:'datetime' => :'datetime',
|
74
|
-
:'datetime_min' => :'datetime_min',
|
75
|
-
:'datetime_max' => :'datetime_max',
|
76
|
-
}
|
77
|
-
end
|
78
|
-
|
79
|
-
# Builds the object from hash
|
80
|
-
# @param attributes [Hash] Model attributes in the form of hash
|
81
|
-
# @return [Object] Returns the model itself
|
82
|
-
def self.build_from_hash(attributes)
|
83
|
-
return nil unless attributes.is_a?(Hash)
|
84
|
-
attributes = attributes.transform_keys(&:to_sym)
|
85
|
-
transformed_hash = {}
|
86
|
-
openapi_types.each_pair do |key, type|
|
87
|
-
if attributes.key?(key) && attributes[key].nil?
|
88
|
-
transformed_hash["#{key}"] = nil
|
89
|
-
elsif type =~ /\AArray<(.*)>/i
|
90
|
-
# check to ensure the input is an array given that the attribute
|
91
|
-
# is documented as an array but the input is not
|
92
|
-
if attributes[key].is_a?(Array)
|
93
|
-
transformed_hash["#{key}"] = attributes[key].map { |v| _deserialize($1, v) }
|
94
|
-
end
|
95
|
-
elsif !attributes[key].nil?
|
96
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[key])
|
97
|
-
end
|
98
|
-
end
|
99
|
-
new(transformed_hash)
|
100
|
-
end
|
101
|
-
|
102
|
-
# Deserializes the data based on type
|
103
|
-
# @param type [String] Data type
|
104
|
-
# @param value [String] Value to be deserialized
|
105
|
-
# @return [Object] Deserialized data
|
106
|
-
def self._deserialize(type, value)
|
107
|
-
case type.to_sym
|
108
|
-
when :Time
|
109
|
-
Time.parse(value)
|
110
|
-
when :Date
|
111
|
-
Date.parse(value)
|
112
|
-
when :String
|
113
|
-
value.to_s
|
114
|
-
when :Integer
|
115
|
-
value.to_i
|
116
|
-
when :Float
|
117
|
-
value.to_f
|
118
|
-
when :Boolean
|
119
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
120
|
-
true
|
121
|
-
else
|
122
|
-
false
|
123
|
-
end
|
124
|
-
when :Object
|
125
|
-
# generic object (usually a Hash), return directly
|
126
|
-
value
|
127
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
128
|
-
inner_type = Regexp.last_match[:inner_type]
|
129
|
-
value.map { |v| _deserialize(inner_type, v) }
|
130
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
131
|
-
k_type = Regexp.last_match[:k_type]
|
132
|
-
v_type = Regexp.last_match[:v_type]
|
133
|
-
{}.tap do |hash|
|
134
|
-
value.each do |k, v|
|
135
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
136
|
-
end
|
137
|
-
end
|
138
|
-
else # model
|
139
|
-
klass = AftershipAPI::Model.const_get(type)
|
140
|
-
klass.build_from_hash(value)
|
141
|
-
end
|
142
|
-
end
|
143
|
-
|
144
|
-
# Returns the string representation of the object
|
145
|
-
# @return [String] String presentation of the object
|
146
|
-
def to_s
|
147
|
-
to_hash.to_s
|
148
|
-
end
|
149
|
-
|
150
|
-
# to_body is an alias to to_hash (backward compatibility)
|
151
|
-
# @return [Hash] Returns the object in the form of hash
|
152
|
-
def to_body
|
153
|
-
to_hash
|
154
|
-
end
|
155
|
-
|
156
|
-
# Returns the object in the form of hash
|
157
|
-
# @return [Hash] Returns the object in the form of hash
|
158
|
-
def to_hash
|
159
|
-
hash = {}
|
160
|
-
self.class.attribute_map.each_pair do |attr, param|
|
161
|
-
value = self.send(attr)
|
162
|
-
next if value.nil?
|
163
|
-
|
164
|
-
hash[param] = _to_hash(value)
|
165
|
-
end
|
166
|
-
hash
|
167
|
-
end
|
168
|
-
|
169
|
-
# Outputs non-array value in the form of hash
|
170
|
-
# For object, use to_hash. Otherwise, just return the value
|
171
|
-
# @param value [Object] Any valid value
|
172
|
-
# @return [Hash] Returns the value in the form of hash
|
173
|
-
def _to_hash(value)
|
174
|
-
if value.is_a?(Array)
|
175
|
-
value.compact.map { |v| _to_hash(v) }
|
176
|
-
elsif value.is_a?(Hash)
|
177
|
-
{}.tap do |hash|
|
178
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
179
|
-
end
|
180
|
-
elsif value.respond_to? :to_hash
|
181
|
-
value.to_hash
|
182
|
-
else
|
183
|
-
value
|
184
|
-
end
|
185
|
-
end
|
186
|
-
|
187
|
-
def to_json(*a)
|
188
|
-
to_hash.to_json(*a)
|
189
|
-
end
|
190
|
-
end
|
191
|
-
end
|
@@ -1,191 +0,0 @@
|
|
1
|
-
# This code was auto generated by AfterShip SDK Generator.
|
2
|
-
# Do not edit the class manually.
|
3
|
-
module AftershipAPI::Model
|
4
|
-
class LatestEstimatedDeliveryGetTrackingBySlugTrackingNumberResponse
|
5
|
-
# The format of the EDD. Either a single date or a date range.
|
6
|
-
# type?: String;
|
7
|
-
attr_accessor :type
|
8
|
-
|
9
|
-
# The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings.
|
10
|
-
# source?: String;
|
11
|
-
attr_accessor :source
|
12
|
-
|
13
|
-
# The latest EDD time.
|
14
|
-
# datetime?: String;
|
15
|
-
attr_accessor :datetime
|
16
|
-
|
17
|
-
# For a date range EDD format, the date and time for the lower end of the range.
|
18
|
-
# datetime_min?: String;
|
19
|
-
attr_accessor :datetime_min
|
20
|
-
|
21
|
-
# For a date range EDD format, the date and time for the upper end of the range.
|
22
|
-
# datetime_max?: String;
|
23
|
-
attr_accessor :datetime_max
|
24
|
-
|
25
|
-
# Initializes the object
|
26
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
27
|
-
def initialize(attributes = {})
|
28
|
-
if (!attributes.is_a?(Hash))
|
29
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `AftershipAPI::LatestEstimatedDeliveryGetTrackingBySlugTrackingNumberResponse` initialize method"
|
30
|
-
end
|
31
|
-
|
32
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
33
|
-
h[k.to_sym] = v
|
34
|
-
}
|
35
|
-
|
36
|
-
if attributes.key?(:'type')
|
37
|
-
self.type = attributes[:'type']
|
38
|
-
end
|
39
|
-
|
40
|
-
if attributes.key?(:'source')
|
41
|
-
self.source = attributes[:'source']
|
42
|
-
end
|
43
|
-
|
44
|
-
if attributes.key?(:'datetime')
|
45
|
-
self.datetime = attributes[:'datetime']
|
46
|
-
end
|
47
|
-
|
48
|
-
if attributes.key?(:'datetime_min')
|
49
|
-
self.datetime_min = attributes[:'datetime_min']
|
50
|
-
end
|
51
|
-
|
52
|
-
if attributes.key?(:'datetime_max')
|
53
|
-
self.datetime_max = attributes[:'datetime_max']
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
# Attribute type mapping.
|
58
|
-
def self.openapi_types
|
59
|
-
{
|
60
|
-
:'type' => :'String',
|
61
|
-
:'source' => :'String',
|
62
|
-
:'datetime' => :'String',
|
63
|
-
:'datetime_min' => :'String',
|
64
|
-
:'datetime_max' => :'String',
|
65
|
-
}
|
66
|
-
end
|
67
|
-
|
68
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
69
|
-
def self.attribute_map
|
70
|
-
{
|
71
|
-
:'type' => :'type',
|
72
|
-
:'source' => :'source',
|
73
|
-
:'datetime' => :'datetime',
|
74
|
-
:'datetime_min' => :'datetime_min',
|
75
|
-
:'datetime_max' => :'datetime_max',
|
76
|
-
}
|
77
|
-
end
|
78
|
-
|
79
|
-
# Builds the object from hash
|
80
|
-
# @param attributes [Hash] Model attributes in the form of hash
|
81
|
-
# @return [Object] Returns the model itself
|
82
|
-
def self.build_from_hash(attributes)
|
83
|
-
return nil unless attributes.is_a?(Hash)
|
84
|
-
attributes = attributes.transform_keys(&:to_sym)
|
85
|
-
transformed_hash = {}
|
86
|
-
openapi_types.each_pair do |key, type|
|
87
|
-
if attributes.key?(key) && attributes[key].nil?
|
88
|
-
transformed_hash["#{key}"] = nil
|
89
|
-
elsif type =~ /\AArray<(.*)>/i
|
90
|
-
# check to ensure the input is an array given that the attribute
|
91
|
-
# is documented as an array but the input is not
|
92
|
-
if attributes[key].is_a?(Array)
|
93
|
-
transformed_hash["#{key}"] = attributes[key].map { |v| _deserialize($1, v) }
|
94
|
-
end
|
95
|
-
elsif !attributes[key].nil?
|
96
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[key])
|
97
|
-
end
|
98
|
-
end
|
99
|
-
new(transformed_hash)
|
100
|
-
end
|
101
|
-
|
102
|
-
# Deserializes the data based on type
|
103
|
-
# @param type [String] Data type
|
104
|
-
# @param value [String] Value to be deserialized
|
105
|
-
# @return [Object] Deserialized data
|
106
|
-
def self._deserialize(type, value)
|
107
|
-
case type.to_sym
|
108
|
-
when :Time
|
109
|
-
Time.parse(value)
|
110
|
-
when :Date
|
111
|
-
Date.parse(value)
|
112
|
-
when :String
|
113
|
-
value.to_s
|
114
|
-
when :Integer
|
115
|
-
value.to_i
|
116
|
-
when :Float
|
117
|
-
value.to_f
|
118
|
-
when :Boolean
|
119
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
120
|
-
true
|
121
|
-
else
|
122
|
-
false
|
123
|
-
end
|
124
|
-
when :Object
|
125
|
-
# generic object (usually a Hash), return directly
|
126
|
-
value
|
127
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
128
|
-
inner_type = Regexp.last_match[:inner_type]
|
129
|
-
value.map { |v| _deserialize(inner_type, v) }
|
130
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
131
|
-
k_type = Regexp.last_match[:k_type]
|
132
|
-
v_type = Regexp.last_match[:v_type]
|
133
|
-
{}.tap do |hash|
|
134
|
-
value.each do |k, v|
|
135
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
136
|
-
end
|
137
|
-
end
|
138
|
-
else # model
|
139
|
-
klass = AftershipAPI::Model.const_get(type)
|
140
|
-
klass.build_from_hash(value)
|
141
|
-
end
|
142
|
-
end
|
143
|
-
|
144
|
-
# Returns the string representation of the object
|
145
|
-
# @return [String] String presentation of the object
|
146
|
-
def to_s
|
147
|
-
to_hash.to_s
|
148
|
-
end
|
149
|
-
|
150
|
-
# to_body is an alias to to_hash (backward compatibility)
|
151
|
-
# @return [Hash] Returns the object in the form of hash
|
152
|
-
def to_body
|
153
|
-
to_hash
|
154
|
-
end
|
155
|
-
|
156
|
-
# Returns the object in the form of hash
|
157
|
-
# @return [Hash] Returns the object in the form of hash
|
158
|
-
def to_hash
|
159
|
-
hash = {}
|
160
|
-
self.class.attribute_map.each_pair do |attr, param|
|
161
|
-
value = self.send(attr)
|
162
|
-
next if value.nil?
|
163
|
-
|
164
|
-
hash[param] = _to_hash(value)
|
165
|
-
end
|
166
|
-
hash
|
167
|
-
end
|
168
|
-
|
169
|
-
# Outputs non-array value in the form of hash
|
170
|
-
# For object, use to_hash. Otherwise, just return the value
|
171
|
-
# @param value [Object] Any valid value
|
172
|
-
# @return [Hash] Returns the value in the form of hash
|
173
|
-
def _to_hash(value)
|
174
|
-
if value.is_a?(Array)
|
175
|
-
value.compact.map { |v| _to_hash(v) }
|
176
|
-
elsif value.is_a?(Hash)
|
177
|
-
{}.tap do |hash|
|
178
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
179
|
-
end
|
180
|
-
elsif value.respond_to? :to_hash
|
181
|
-
value.to_hash
|
182
|
-
else
|
183
|
-
value
|
184
|
-
end
|
185
|
-
end
|
186
|
-
|
187
|
-
def to_json(*a)
|
188
|
-
to_hash.to_json(*a)
|
189
|
-
end
|
190
|
-
end
|
191
|
-
end
|
@@ -1,191 +0,0 @@
|
|
1
|
-
# This code was auto generated by AfterShip SDK Generator.
|
2
|
-
# Do not edit the class manually.
|
3
|
-
module AftershipAPI::Model
|
4
|
-
class LatestEstimatedDeliveryMarkTrackingCompletedBySlugTrackingNumberResponse
|
5
|
-
# The format of the EDD. Either a single date or a date range.
|
6
|
-
# type?: String;
|
7
|
-
attr_accessor :type
|
8
|
-
|
9
|
-
# The source of the EDD. Either the carrier, AfterShip AI, or based on your custom EDD settings.
|
10
|
-
# source?: String;
|
11
|
-
attr_accessor :source
|
12
|
-
|
13
|
-
# The latest EDD time.
|
14
|
-
# datetime?: String;
|
15
|
-
attr_accessor :datetime
|
16
|
-
|
17
|
-
# For a date range EDD format, the date and time for the lower end of the range.
|
18
|
-
# datetime_min?: String;
|
19
|
-
attr_accessor :datetime_min
|
20
|
-
|
21
|
-
# For a date range EDD format, the date and time for the upper end of the range.
|
22
|
-
# datetime_max?: String;
|
23
|
-
attr_accessor :datetime_max
|
24
|
-
|
25
|
-
# Initializes the object
|
26
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
27
|
-
def initialize(attributes = {})
|
28
|
-
if (!attributes.is_a?(Hash))
|
29
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `AftershipAPI::LatestEstimatedDeliveryMarkTrackingCompletedBySlugTrackingNumberResponse` initialize method"
|
30
|
-
end
|
31
|
-
|
32
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
33
|
-
h[k.to_sym] = v
|
34
|
-
}
|
35
|
-
|
36
|
-
if attributes.key?(:'type')
|
37
|
-
self.type = attributes[:'type']
|
38
|
-
end
|
39
|
-
|
40
|
-
if attributes.key?(:'source')
|
41
|
-
self.source = attributes[:'source']
|
42
|
-
end
|
43
|
-
|
44
|
-
if attributes.key?(:'datetime')
|
45
|
-
self.datetime = attributes[:'datetime']
|
46
|
-
end
|
47
|
-
|
48
|
-
if attributes.key?(:'datetime_min')
|
49
|
-
self.datetime_min = attributes[:'datetime_min']
|
50
|
-
end
|
51
|
-
|
52
|
-
if attributes.key?(:'datetime_max')
|
53
|
-
self.datetime_max = attributes[:'datetime_max']
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
# Attribute type mapping.
|
58
|
-
def self.openapi_types
|
59
|
-
{
|
60
|
-
:'type' => :'String',
|
61
|
-
:'source' => :'String',
|
62
|
-
:'datetime' => :'String',
|
63
|
-
:'datetime_min' => :'String',
|
64
|
-
:'datetime_max' => :'String',
|
65
|
-
}
|
66
|
-
end
|
67
|
-
|
68
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
69
|
-
def self.attribute_map
|
70
|
-
{
|
71
|
-
:'type' => :'type',
|
72
|
-
:'source' => :'source',
|
73
|
-
:'datetime' => :'datetime',
|
74
|
-
:'datetime_min' => :'datetime_min',
|
75
|
-
:'datetime_max' => :'datetime_max',
|
76
|
-
}
|
77
|
-
end
|
78
|
-
|
79
|
-
# Builds the object from hash
|
80
|
-
# @param attributes [Hash] Model attributes in the form of hash
|
81
|
-
# @return [Object] Returns the model itself
|
82
|
-
def self.build_from_hash(attributes)
|
83
|
-
return nil unless attributes.is_a?(Hash)
|
84
|
-
attributes = attributes.transform_keys(&:to_sym)
|
85
|
-
transformed_hash = {}
|
86
|
-
openapi_types.each_pair do |key, type|
|
87
|
-
if attributes.key?(key) && attributes[key].nil?
|
88
|
-
transformed_hash["#{key}"] = nil
|
89
|
-
elsif type =~ /\AArray<(.*)>/i
|
90
|
-
# check to ensure the input is an array given that the attribute
|
91
|
-
# is documented as an array but the input is not
|
92
|
-
if attributes[key].is_a?(Array)
|
93
|
-
transformed_hash["#{key}"] = attributes[key].map { |v| _deserialize($1, v) }
|
94
|
-
end
|
95
|
-
elsif !attributes[key].nil?
|
96
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[key])
|
97
|
-
end
|
98
|
-
end
|
99
|
-
new(transformed_hash)
|
100
|
-
end
|
101
|
-
|
102
|
-
# Deserializes the data based on type
|
103
|
-
# @param type [String] Data type
|
104
|
-
# @param value [String] Value to be deserialized
|
105
|
-
# @return [Object] Deserialized data
|
106
|
-
def self._deserialize(type, value)
|
107
|
-
case type.to_sym
|
108
|
-
when :Time
|
109
|
-
Time.parse(value)
|
110
|
-
when :Date
|
111
|
-
Date.parse(value)
|
112
|
-
when :String
|
113
|
-
value.to_s
|
114
|
-
when :Integer
|
115
|
-
value.to_i
|
116
|
-
when :Float
|
117
|
-
value.to_f
|
118
|
-
when :Boolean
|
119
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
120
|
-
true
|
121
|
-
else
|
122
|
-
false
|
123
|
-
end
|
124
|
-
when :Object
|
125
|
-
# generic object (usually a Hash), return directly
|
126
|
-
value
|
127
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
128
|
-
inner_type = Regexp.last_match[:inner_type]
|
129
|
-
value.map { |v| _deserialize(inner_type, v) }
|
130
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
131
|
-
k_type = Regexp.last_match[:k_type]
|
132
|
-
v_type = Regexp.last_match[:v_type]
|
133
|
-
{}.tap do |hash|
|
134
|
-
value.each do |k, v|
|
135
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
136
|
-
end
|
137
|
-
end
|
138
|
-
else # model
|
139
|
-
klass = AftershipAPI::Model.const_get(type)
|
140
|
-
klass.build_from_hash(value)
|
141
|
-
end
|
142
|
-
end
|
143
|
-
|
144
|
-
# Returns the string representation of the object
|
145
|
-
# @return [String] String presentation of the object
|
146
|
-
def to_s
|
147
|
-
to_hash.to_s
|
148
|
-
end
|
149
|
-
|
150
|
-
# to_body is an alias to to_hash (backward compatibility)
|
151
|
-
# @return [Hash] Returns the object in the form of hash
|
152
|
-
def to_body
|
153
|
-
to_hash
|
154
|
-
end
|
155
|
-
|
156
|
-
# Returns the object in the form of hash
|
157
|
-
# @return [Hash] Returns the object in the form of hash
|
158
|
-
def to_hash
|
159
|
-
hash = {}
|
160
|
-
self.class.attribute_map.each_pair do |attr, param|
|
161
|
-
value = self.send(attr)
|
162
|
-
next if value.nil?
|
163
|
-
|
164
|
-
hash[param] = _to_hash(value)
|
165
|
-
end
|
166
|
-
hash
|
167
|
-
end
|
168
|
-
|
169
|
-
# Outputs non-array value in the form of hash
|
170
|
-
# For object, use to_hash. Otherwise, just return the value
|
171
|
-
# @param value [Object] Any valid value
|
172
|
-
# @return [Hash] Returns the value in the form of hash
|
173
|
-
def _to_hash(value)
|
174
|
-
if value.is_a?(Array)
|
175
|
-
value.compact.map { |v| _to_hash(v) }
|
176
|
-
elsif value.is_a?(Hash)
|
177
|
-
{}.tap do |hash|
|
178
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
179
|
-
end
|
180
|
-
elsif value.respond_to? :to_hash
|
181
|
-
value.to_hash
|
182
|
-
else
|
183
|
-
value
|
184
|
-
end
|
185
|
-
end
|
186
|
-
|
187
|
-
def to_json(*a)
|
188
|
-
to_hash.to_json(*a)
|
189
|
-
end
|
190
|
-
end
|
191
|
-
end
|