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,171 +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 NextCouriersMarkTrackingCompletedBySlugTrackingNumberResponse
|
5
|
-
# Unique code of courier. Get courier
|
6
|
-
# slug: String;
|
7
|
-
attr_accessor :slug
|
8
|
-
|
9
|
-
# Tracking number.
|
10
|
-
# tracking_number: String;
|
11
|
-
attr_accessor :tracking_number
|
12
|
-
|
13
|
-
# Source of next couriers.
|
14
|
-
# source?: String;
|
15
|
-
attr_accessor :source
|
16
|
-
|
17
|
-
# Initializes the object
|
18
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
19
|
-
def initialize(attributes = {})
|
20
|
-
if (!attributes.is_a?(Hash))
|
21
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `AftershipAPI::NextCouriersMarkTrackingCompletedBySlugTrackingNumberResponse` initialize method"
|
22
|
-
end
|
23
|
-
|
24
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
25
|
-
h[k.to_sym] = v
|
26
|
-
}
|
27
|
-
|
28
|
-
if attributes.key?(:'slug')
|
29
|
-
self.slug = attributes[:'slug']
|
30
|
-
end
|
31
|
-
|
32
|
-
if attributes.key?(:'tracking_number')
|
33
|
-
self.tracking_number = attributes[:'tracking_number']
|
34
|
-
end
|
35
|
-
|
36
|
-
if attributes.key?(:'source')
|
37
|
-
self.source = attributes[:'source']
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
# Attribute type mapping.
|
42
|
-
def self.openapi_types
|
43
|
-
{
|
44
|
-
:'slug' => :'String',
|
45
|
-
:'tracking_number' => :'String',
|
46
|
-
:'source' => :'String',
|
47
|
-
}
|
48
|
-
end
|
49
|
-
|
50
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
51
|
-
def self.attribute_map
|
52
|
-
{
|
53
|
-
:'slug' => :'slug',
|
54
|
-
:'tracking_number' => :'tracking_number',
|
55
|
-
:'source' => :'source',
|
56
|
-
}
|
57
|
-
end
|
58
|
-
|
59
|
-
# Builds the object from hash
|
60
|
-
# @param attributes [Hash] Model attributes in the form of hash
|
61
|
-
# @return [Object] Returns the model itself
|
62
|
-
def self.build_from_hash(attributes)
|
63
|
-
return nil unless attributes.is_a?(Hash)
|
64
|
-
attributes = attributes.transform_keys(&:to_sym)
|
65
|
-
transformed_hash = {}
|
66
|
-
openapi_types.each_pair do |key, type|
|
67
|
-
if attributes.key?(key) && attributes[key].nil?
|
68
|
-
transformed_hash["#{key}"] = nil
|
69
|
-
elsif type =~ /\AArray<(.*)>/i
|
70
|
-
# check to ensure the input is an array given that the attribute
|
71
|
-
# is documented as an array but the input is not
|
72
|
-
if attributes[key].is_a?(Array)
|
73
|
-
transformed_hash["#{key}"] = attributes[key].map { |v| _deserialize($1, v) }
|
74
|
-
end
|
75
|
-
elsif !attributes[key].nil?
|
76
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[key])
|
77
|
-
end
|
78
|
-
end
|
79
|
-
new(transformed_hash)
|
80
|
-
end
|
81
|
-
|
82
|
-
# Deserializes the data based on type
|
83
|
-
# @param type [String] Data type
|
84
|
-
# @param value [String] Value to be deserialized
|
85
|
-
# @return [Object] Deserialized data
|
86
|
-
def self._deserialize(type, value)
|
87
|
-
case type.to_sym
|
88
|
-
when :Time
|
89
|
-
Time.parse(value)
|
90
|
-
when :Date
|
91
|
-
Date.parse(value)
|
92
|
-
when :String
|
93
|
-
value.to_s
|
94
|
-
when :Integer
|
95
|
-
value.to_i
|
96
|
-
when :Float
|
97
|
-
value.to_f
|
98
|
-
when :Boolean
|
99
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
100
|
-
true
|
101
|
-
else
|
102
|
-
false
|
103
|
-
end
|
104
|
-
when :Object
|
105
|
-
# generic object (usually a Hash), return directly
|
106
|
-
value
|
107
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
108
|
-
inner_type = Regexp.last_match[:inner_type]
|
109
|
-
value.map { |v| _deserialize(inner_type, v) }
|
110
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
111
|
-
k_type = Regexp.last_match[:k_type]
|
112
|
-
v_type = Regexp.last_match[:v_type]
|
113
|
-
{}.tap do |hash|
|
114
|
-
value.each do |k, v|
|
115
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
116
|
-
end
|
117
|
-
end
|
118
|
-
else # model
|
119
|
-
klass = AftershipAPI::Model.const_get(type)
|
120
|
-
klass.build_from_hash(value)
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
|
-
# Returns the string representation of the object
|
125
|
-
# @return [String] String presentation of the object
|
126
|
-
def to_s
|
127
|
-
to_hash.to_s
|
128
|
-
end
|
129
|
-
|
130
|
-
# to_body is an alias to to_hash (backward compatibility)
|
131
|
-
# @return [Hash] Returns the object in the form of hash
|
132
|
-
def to_body
|
133
|
-
to_hash
|
134
|
-
end
|
135
|
-
|
136
|
-
# Returns the object in the form of hash
|
137
|
-
# @return [Hash] Returns the object in the form of hash
|
138
|
-
def to_hash
|
139
|
-
hash = {}
|
140
|
-
self.class.attribute_map.each_pair do |attr, param|
|
141
|
-
value = self.send(attr)
|
142
|
-
next if value.nil?
|
143
|
-
|
144
|
-
hash[param] = _to_hash(value)
|
145
|
-
end
|
146
|
-
hash
|
147
|
-
end
|
148
|
-
|
149
|
-
# Outputs non-array value in the form of hash
|
150
|
-
# For object, use to_hash. Otherwise, just return the value
|
151
|
-
# @param value [Object] Any valid value
|
152
|
-
# @return [Hash] Returns the value in the form of hash
|
153
|
-
def _to_hash(value)
|
154
|
-
if value.is_a?(Array)
|
155
|
-
value.compact.map { |v| _to_hash(v) }
|
156
|
-
elsif value.is_a?(Hash)
|
157
|
-
{}.tap do |hash|
|
158
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
159
|
-
end
|
160
|
-
elsif value.respond_to? :to_hash
|
161
|
-
value.to_hash
|
162
|
-
else
|
163
|
-
value
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
def to_json(*a)
|
168
|
-
to_hash.to_json(*a)
|
169
|
-
end
|
170
|
-
end
|
171
|
-
end
|
@@ -1,171 +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 NextCouriersRetrackTrackingBySlugTrackingNumberResponse
|
5
|
-
# Unique code of courier. Get courier
|
6
|
-
# slug: String;
|
7
|
-
attr_accessor :slug
|
8
|
-
|
9
|
-
# Tracking number.
|
10
|
-
# tracking_number: String;
|
11
|
-
attr_accessor :tracking_number
|
12
|
-
|
13
|
-
# Source of next couriers.
|
14
|
-
# source?: String;
|
15
|
-
attr_accessor :source
|
16
|
-
|
17
|
-
# Initializes the object
|
18
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
19
|
-
def initialize(attributes = {})
|
20
|
-
if (!attributes.is_a?(Hash))
|
21
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `AftershipAPI::NextCouriersRetrackTrackingBySlugTrackingNumberResponse` initialize method"
|
22
|
-
end
|
23
|
-
|
24
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
25
|
-
h[k.to_sym] = v
|
26
|
-
}
|
27
|
-
|
28
|
-
if attributes.key?(:'slug')
|
29
|
-
self.slug = attributes[:'slug']
|
30
|
-
end
|
31
|
-
|
32
|
-
if attributes.key?(:'tracking_number')
|
33
|
-
self.tracking_number = attributes[:'tracking_number']
|
34
|
-
end
|
35
|
-
|
36
|
-
if attributes.key?(:'source')
|
37
|
-
self.source = attributes[:'source']
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
# Attribute type mapping.
|
42
|
-
def self.openapi_types
|
43
|
-
{
|
44
|
-
:'slug' => :'String',
|
45
|
-
:'tracking_number' => :'String',
|
46
|
-
:'source' => :'String',
|
47
|
-
}
|
48
|
-
end
|
49
|
-
|
50
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
51
|
-
def self.attribute_map
|
52
|
-
{
|
53
|
-
:'slug' => :'slug',
|
54
|
-
:'tracking_number' => :'tracking_number',
|
55
|
-
:'source' => :'source',
|
56
|
-
}
|
57
|
-
end
|
58
|
-
|
59
|
-
# Builds the object from hash
|
60
|
-
# @param attributes [Hash] Model attributes in the form of hash
|
61
|
-
# @return [Object] Returns the model itself
|
62
|
-
def self.build_from_hash(attributes)
|
63
|
-
return nil unless attributes.is_a?(Hash)
|
64
|
-
attributes = attributes.transform_keys(&:to_sym)
|
65
|
-
transformed_hash = {}
|
66
|
-
openapi_types.each_pair do |key, type|
|
67
|
-
if attributes.key?(key) && attributes[key].nil?
|
68
|
-
transformed_hash["#{key}"] = nil
|
69
|
-
elsif type =~ /\AArray<(.*)>/i
|
70
|
-
# check to ensure the input is an array given that the attribute
|
71
|
-
# is documented as an array but the input is not
|
72
|
-
if attributes[key].is_a?(Array)
|
73
|
-
transformed_hash["#{key}"] = attributes[key].map { |v| _deserialize($1, v) }
|
74
|
-
end
|
75
|
-
elsif !attributes[key].nil?
|
76
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[key])
|
77
|
-
end
|
78
|
-
end
|
79
|
-
new(transformed_hash)
|
80
|
-
end
|
81
|
-
|
82
|
-
# Deserializes the data based on type
|
83
|
-
# @param type [String] Data type
|
84
|
-
# @param value [String] Value to be deserialized
|
85
|
-
# @return [Object] Deserialized data
|
86
|
-
def self._deserialize(type, value)
|
87
|
-
case type.to_sym
|
88
|
-
when :Time
|
89
|
-
Time.parse(value)
|
90
|
-
when :Date
|
91
|
-
Date.parse(value)
|
92
|
-
when :String
|
93
|
-
value.to_s
|
94
|
-
when :Integer
|
95
|
-
value.to_i
|
96
|
-
when :Float
|
97
|
-
value.to_f
|
98
|
-
when :Boolean
|
99
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
100
|
-
true
|
101
|
-
else
|
102
|
-
false
|
103
|
-
end
|
104
|
-
when :Object
|
105
|
-
# generic object (usually a Hash), return directly
|
106
|
-
value
|
107
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
108
|
-
inner_type = Regexp.last_match[:inner_type]
|
109
|
-
value.map { |v| _deserialize(inner_type, v) }
|
110
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
111
|
-
k_type = Regexp.last_match[:k_type]
|
112
|
-
v_type = Regexp.last_match[:v_type]
|
113
|
-
{}.tap do |hash|
|
114
|
-
value.each do |k, v|
|
115
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
116
|
-
end
|
117
|
-
end
|
118
|
-
else # model
|
119
|
-
klass = AftershipAPI::Model.const_get(type)
|
120
|
-
klass.build_from_hash(value)
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
|
-
# Returns the string representation of the object
|
125
|
-
# @return [String] String presentation of the object
|
126
|
-
def to_s
|
127
|
-
to_hash.to_s
|
128
|
-
end
|
129
|
-
|
130
|
-
# to_body is an alias to to_hash (backward compatibility)
|
131
|
-
# @return [Hash] Returns the object in the form of hash
|
132
|
-
def to_body
|
133
|
-
to_hash
|
134
|
-
end
|
135
|
-
|
136
|
-
# Returns the object in the form of hash
|
137
|
-
# @return [Hash] Returns the object in the form of hash
|
138
|
-
def to_hash
|
139
|
-
hash = {}
|
140
|
-
self.class.attribute_map.each_pair do |attr, param|
|
141
|
-
value = self.send(attr)
|
142
|
-
next if value.nil?
|
143
|
-
|
144
|
-
hash[param] = _to_hash(value)
|
145
|
-
end
|
146
|
-
hash
|
147
|
-
end
|
148
|
-
|
149
|
-
# Outputs non-array value in the form of hash
|
150
|
-
# For object, use to_hash. Otherwise, just return the value
|
151
|
-
# @param value [Object] Any valid value
|
152
|
-
# @return [Hash] Returns the value in the form of hash
|
153
|
-
def _to_hash(value)
|
154
|
-
if value.is_a?(Array)
|
155
|
-
value.compact.map { |v| _to_hash(v) }
|
156
|
-
elsif value.is_a?(Hash)
|
157
|
-
{}.tap do |hash|
|
158
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
159
|
-
end
|
160
|
-
elsif value.respond_to? :to_hash
|
161
|
-
value.to_hash
|
162
|
-
else
|
163
|
-
value
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
def to_json(*a)
|
168
|
-
to_hash.to_json(*a)
|
169
|
-
end
|
170
|
-
end
|
171
|
-
end
|
@@ -1,171 +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 NextCouriersUpdateTrackingBySlugTrackingNumberResponse
|
5
|
-
# Unique code of courier. Get courier
|
6
|
-
# slug: String;
|
7
|
-
attr_accessor :slug
|
8
|
-
|
9
|
-
# Tracking number.
|
10
|
-
# tracking_number: String;
|
11
|
-
attr_accessor :tracking_number
|
12
|
-
|
13
|
-
# Source of next couriers.
|
14
|
-
# source?: String;
|
15
|
-
attr_accessor :source
|
16
|
-
|
17
|
-
# Initializes the object
|
18
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
19
|
-
def initialize(attributes = {})
|
20
|
-
if (!attributes.is_a?(Hash))
|
21
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `AftershipAPI::NextCouriersUpdateTrackingBySlugTrackingNumberResponse` initialize method"
|
22
|
-
end
|
23
|
-
|
24
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
25
|
-
h[k.to_sym] = v
|
26
|
-
}
|
27
|
-
|
28
|
-
if attributes.key?(:'slug')
|
29
|
-
self.slug = attributes[:'slug']
|
30
|
-
end
|
31
|
-
|
32
|
-
if attributes.key?(:'tracking_number')
|
33
|
-
self.tracking_number = attributes[:'tracking_number']
|
34
|
-
end
|
35
|
-
|
36
|
-
if attributes.key?(:'source')
|
37
|
-
self.source = attributes[:'source']
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
# Attribute type mapping.
|
42
|
-
def self.openapi_types
|
43
|
-
{
|
44
|
-
:'slug' => :'String',
|
45
|
-
:'tracking_number' => :'String',
|
46
|
-
:'source' => :'String',
|
47
|
-
}
|
48
|
-
end
|
49
|
-
|
50
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
51
|
-
def self.attribute_map
|
52
|
-
{
|
53
|
-
:'slug' => :'slug',
|
54
|
-
:'tracking_number' => :'tracking_number',
|
55
|
-
:'source' => :'source',
|
56
|
-
}
|
57
|
-
end
|
58
|
-
|
59
|
-
# Builds the object from hash
|
60
|
-
# @param attributes [Hash] Model attributes in the form of hash
|
61
|
-
# @return [Object] Returns the model itself
|
62
|
-
def self.build_from_hash(attributes)
|
63
|
-
return nil unless attributes.is_a?(Hash)
|
64
|
-
attributes = attributes.transform_keys(&:to_sym)
|
65
|
-
transformed_hash = {}
|
66
|
-
openapi_types.each_pair do |key, type|
|
67
|
-
if attributes.key?(key) && attributes[key].nil?
|
68
|
-
transformed_hash["#{key}"] = nil
|
69
|
-
elsif type =~ /\AArray<(.*)>/i
|
70
|
-
# check to ensure the input is an array given that the attribute
|
71
|
-
# is documented as an array but the input is not
|
72
|
-
if attributes[key].is_a?(Array)
|
73
|
-
transformed_hash["#{key}"] = attributes[key].map { |v| _deserialize($1, v) }
|
74
|
-
end
|
75
|
-
elsif !attributes[key].nil?
|
76
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[key])
|
77
|
-
end
|
78
|
-
end
|
79
|
-
new(transformed_hash)
|
80
|
-
end
|
81
|
-
|
82
|
-
# Deserializes the data based on type
|
83
|
-
# @param type [String] Data type
|
84
|
-
# @param value [String] Value to be deserialized
|
85
|
-
# @return [Object] Deserialized data
|
86
|
-
def self._deserialize(type, value)
|
87
|
-
case type.to_sym
|
88
|
-
when :Time
|
89
|
-
Time.parse(value)
|
90
|
-
when :Date
|
91
|
-
Date.parse(value)
|
92
|
-
when :String
|
93
|
-
value.to_s
|
94
|
-
when :Integer
|
95
|
-
value.to_i
|
96
|
-
when :Float
|
97
|
-
value.to_f
|
98
|
-
when :Boolean
|
99
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
100
|
-
true
|
101
|
-
else
|
102
|
-
false
|
103
|
-
end
|
104
|
-
when :Object
|
105
|
-
# generic object (usually a Hash), return directly
|
106
|
-
value
|
107
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
108
|
-
inner_type = Regexp.last_match[:inner_type]
|
109
|
-
value.map { |v| _deserialize(inner_type, v) }
|
110
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
111
|
-
k_type = Regexp.last_match[:k_type]
|
112
|
-
v_type = Regexp.last_match[:v_type]
|
113
|
-
{}.tap do |hash|
|
114
|
-
value.each do |k, v|
|
115
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
116
|
-
end
|
117
|
-
end
|
118
|
-
else # model
|
119
|
-
klass = AftershipAPI::Model.const_get(type)
|
120
|
-
klass.build_from_hash(value)
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
|
-
# Returns the string representation of the object
|
125
|
-
# @return [String] String presentation of the object
|
126
|
-
def to_s
|
127
|
-
to_hash.to_s
|
128
|
-
end
|
129
|
-
|
130
|
-
# to_body is an alias to to_hash (backward compatibility)
|
131
|
-
# @return [Hash] Returns the object in the form of hash
|
132
|
-
def to_body
|
133
|
-
to_hash
|
134
|
-
end
|
135
|
-
|
136
|
-
# Returns the object in the form of hash
|
137
|
-
# @return [Hash] Returns the object in the form of hash
|
138
|
-
def to_hash
|
139
|
-
hash = {}
|
140
|
-
self.class.attribute_map.each_pair do |attr, param|
|
141
|
-
value = self.send(attr)
|
142
|
-
next if value.nil?
|
143
|
-
|
144
|
-
hash[param] = _to_hash(value)
|
145
|
-
end
|
146
|
-
hash
|
147
|
-
end
|
148
|
-
|
149
|
-
# Outputs non-array value in the form of hash
|
150
|
-
# For object, use to_hash. Otherwise, just return the value
|
151
|
-
# @param value [Object] Any valid value
|
152
|
-
# @return [Hash] Returns the value in the form of hash
|
153
|
-
def _to_hash(value)
|
154
|
-
if value.is_a?(Array)
|
155
|
-
value.compact.map { |v| _to_hash(v) }
|
156
|
-
elsif value.is_a?(Hash)
|
157
|
-
{}.tap do |hash|
|
158
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
159
|
-
end
|
160
|
-
elsif value.respond_to? :to_hash
|
161
|
-
value.to_hash
|
162
|
-
else
|
163
|
-
value
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
def to_json(*a)
|
168
|
-
to_hash.to_json(*a)
|
169
|
-
end
|
170
|
-
end
|
171
|
-
end
|