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