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
@@ -4,119 +4,119 @@ require 'uri'
|
|
4
4
|
require 'typhoeus'
|
5
5
|
|
6
6
|
module AftershipAPI
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
7
|
+
AUTHENTICATION_TYPE_API_KEY = 'API_KEY'
|
8
|
+
AUTHENTICATION_TYPE_AES = 'AES'
|
9
|
+
AUTHENTICATION_TYPE_RSA = 'RSA'
|
10
|
+
|
11
|
+
SDK_PREFIX = 'AFTERSHIP_TRACKING_SDK'
|
12
|
+
|
13
|
+
|
14
|
+
class Configuration
|
15
|
+
def get_env(key)
|
16
|
+
ENV[SDK_PREFIX + '_' + key]
|
17
|
+
end
|
18
|
+
|
19
|
+
# Defines domain
|
20
|
+
attr_accessor :domain
|
21
|
+
|
22
|
+
# Defines the authentication type used in the API.
|
23
|
+
#
|
24
|
+
# @return ["API_KEY", "AES", "RSA"]
|
25
|
+
attr_accessor :authentication_type
|
26
|
+
|
27
|
+
# Defines API keys used with API Key authentications.
|
28
|
+
#
|
29
|
+
# @return [string]
|
30
|
+
attr_accessor :as_api_key
|
31
|
+
|
32
|
+
# Defines AES secret or RSA private key used with AES or RSA authentications.
|
33
|
+
#
|
34
|
+
# @return [string]
|
35
|
+
attr_accessor :as_api_secret
|
36
|
+
|
37
|
+
# Defines the user agent used in the API requests.
|
38
|
+
# Default to 'aftership-sdk-ruby/$VERSION'
|
39
|
+
#
|
40
|
+
# @return [string]
|
41
|
+
attr_accessor :user_agent
|
42
|
+
|
43
|
+
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
44
|
+
# details will be logged with `logger.debug` (see the `logger` attribute).
|
45
|
+
# Default to false.
|
46
|
+
#
|
47
|
+
# @return [true, false]
|
48
|
+
attr_accessor :debugging
|
49
|
+
|
50
|
+
# Defines the logger used for debugging.
|
51
|
+
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
52
|
+
#
|
53
|
+
# @return [#debug]
|
54
|
+
attr_accessor :logger
|
55
|
+
|
56
|
+
# The time limit for HTTP request in seconds.
|
57
|
+
# Default to 30
|
58
|
+
attr_accessor :timeout
|
59
|
+
|
60
|
+
# When response is a retryable error, retry current request
|
61
|
+
# Default to 2
|
62
|
+
attr_accessor :max_retry
|
63
|
+
|
64
|
+
# HTTP proxy
|
65
|
+
attr_accessor :proxy
|
66
66
|
|
67
|
-
|
67
|
+
attr_accessor :aftership_client
|
68
68
|
|
69
|
-
|
69
|
+
attr_accessor :headers
|
70
70
|
|
71
71
|
|
72
|
-
|
73
|
-
|
72
|
+
def initialize
|
73
|
+
default_user_agent = "aftership-sdk-ruby/#{AftershipAPI::VERSION} (https://www.aftership.com) typhoeus/#{Typhoeus::VERSION}"
|
74
74
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
75
|
+
@domain = get_env('DOMAIN') || 'https://api.aftership.com'
|
76
|
+
@authentication_type = get_env('AUTHENTICATION_TYPE') || AUTHENTICATION_TYPE_API_KEY
|
77
|
+
@as_api_key = get_env('API_KEY') || ''
|
78
|
+
@as_api_secret = get_env('API_SECRET') || ''
|
79
|
+
@user_agent = get_env('USER_AGENT') || default_user_agent
|
80
|
+
@aftership_client = default_user_agent
|
81
|
+
@timeout = (get_env('TIMEOUT') || 30).to_i
|
82
|
+
@max_retry = (get_env('MAX_RETRY') || 2).to_i
|
83
|
+
@proxy = get_env('PROXY')
|
84
|
+
@debugging = get_env('DEBUGGING') || false
|
85
|
+
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
86
|
+
@headers = {}
|
87
87
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
88
|
+
yield(self) if block_given?
|
89
|
+
end
|
90
|
+
|
91
|
+
# The default Configuration object.
|
92
|
+
def self.default
|
93
|
+
@@default ||= Configuration.new
|
94
|
+
end
|
95
|
+
|
96
|
+
def configure
|
97
|
+
yield(self) if block_given?
|
98
|
+
end
|
99
|
+
|
100
|
+
def domain=(domain)
|
101
|
+
@domain = domain.sub(/\/+\z/, '')
|
102
|
+
end
|
103
|
+
|
104
|
+
def check
|
105
|
+
fail InvalidOptionError.new("Invalid authentication type: #{authentication_type}") unless [AUTHENTICATION_TYPE_API_KEY, AUTHENTICATION_TYPE_AES, AUTHENTICATION_TYPE_RSA].include?(authentication_type)
|
106
|
+
fail InvalidOptionError.new("as_api_key cannot be empty") unless as_api_key.to_s.size > 0
|
107
|
+
fail InvalidOptionError.new("Invalid base URL: #{domain}") unless valid_url?(domain)
|
108
|
+
fail InvalidOptionError.new("authentication type must not be API_KEY if as_api_secret is set") if as_api_secret.to_s.size > 0 && authentication_type == AUTHENTICATION_TYPE_API_KEY
|
109
|
+
fail InvalidOptionError.new("timeout cannot be negative, value #{timeout}") unless timeout.to_i >= 0
|
110
|
+
fail InvalidOptionError.new("max_retry must be in range 0..10, value #{max_retry}") unless max_retry.to_i >= 0 and max_retry.to_i <=10
|
111
|
+
fail InvalidOptionError.new("max_retry cannot be negative, value #{max_retry}") unless max_retry.to_i >= 0
|
112
|
+
end
|
113
|
+
|
114
|
+
def valid_url?(url)
|
115
|
+
uri = URI.parse(url)
|
116
|
+
uri.is_a?(URI::HTTP) || uri.is_a?(URI::HTTPS)
|
117
|
+
rescue URI::InvalidURIError
|
118
|
+
false
|
119
|
+
end
|
120
|
+
end
|
120
121
|
end
|
121
|
-
end
|
122
122
|
|
@@ -11,7 +11,7 @@ module AftershipAPI::Model
|
|
11
11
|
TRACKING_DESTINATION_COUNTRY = "tracking_destination_country".freeze
|
12
12
|
TRACKING_STATE = "tracking_state".freeze
|
13
13
|
def self.all_vars
|
14
|
-
@all_vars ||= [TRACKING_ACCOUNT_NUMBER,
|
14
|
+
@all_vars ||= [TRACKING_ACCOUNT_NUMBER,TRACKING_POSTAL_CODE,TRACKING_SHIP_DATE,TRACKING_KEY,TRACKING_ORIGIN_COUNTRY,TRACKING_DESTINATION_COUNTRY,TRACKING_STATE,].freeze
|
15
15
|
end
|
16
16
|
|
17
17
|
# Builds the enum from string
|
data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_create_tracking_response.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
# Do not edit the class manually.
|
3
3
|
module AftershipAPI::Model
|
4
4
|
class AftershipEstimatedDeliveryDateCreateTrackingResponse
|
5
|
+
|
5
6
|
# The estimated arrival date of the shipment.
|
6
7
|
# estimated_delivery_date?: String;
|
7
8
|
attr_accessor :estimated_delivery_date
|
@@ -179,3 +180,4 @@ module AftershipAPI::Model
|
|
179
180
|
end
|
180
181
|
end
|
181
182
|
end
|
183
|
+
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# Do not edit the class manually.
|
3
3
|
module AftershipAPI::Model
|
4
4
|
class AftershipEstimatedDeliveryDateDeleteTrackingByIdResponse
|
5
|
+
|
5
6
|
# The estimated arrival date of the shipment.
|
6
7
|
# estimated_delivery_date?: String;
|
7
8
|
attr_accessor :estimated_delivery_date
|
@@ -179,3 +180,4 @@ module AftershipAPI::Model
|
|
179
180
|
end
|
180
181
|
end
|
181
182
|
end
|
183
|
+
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# Do not edit the class manually.
|
3
3
|
module AftershipAPI::Model
|
4
4
|
class AftershipEstimatedDeliveryDateGetTrackingByIdResponse
|
5
|
+
|
5
6
|
# The estimated arrival date of the shipment.
|
6
7
|
# estimated_delivery_date?: String;
|
7
8
|
attr_accessor :estimated_delivery_date
|
@@ -179,3 +180,4 @@ module AftershipAPI::Model
|
|
179
180
|
end
|
180
181
|
end
|
181
182
|
end
|
183
|
+
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# Do not edit the class manually.
|
3
3
|
module AftershipAPI::Model
|
4
4
|
class AftershipEstimatedDeliveryDateMarkTrackingCompletedByIdResponse
|
5
|
+
|
5
6
|
# The estimated arrival date of the shipment.
|
6
7
|
# estimated_delivery_date?: String;
|
7
8
|
attr_accessor :estimated_delivery_date
|
@@ -179,3 +180,4 @@ module AftershipAPI::Model
|
|
179
180
|
end
|
180
181
|
end
|
181
182
|
end
|
183
|
+
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# Do not edit the class manually.
|
3
3
|
module AftershipAPI::Model
|
4
4
|
class AftershipEstimatedDeliveryDateRetrackTrackingByIdResponse
|
5
|
+
|
5
6
|
# The estimated arrival date of the shipment.
|
6
7
|
# estimated_delivery_date?: String;
|
7
8
|
attr_accessor :estimated_delivery_date
|
@@ -179,3 +180,4 @@ module AftershipAPI::Model
|
|
179
180
|
end
|
180
181
|
end
|
181
182
|
end
|
183
|
+
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# Do not edit the class manually.
|
3
3
|
module AftershipAPI::Model
|
4
4
|
class AftershipEstimatedDeliveryDateTracking
|
5
|
+
|
5
6
|
# The estimated arrival date of the shipment.
|
6
7
|
# estimated_delivery_date?: String;
|
7
8
|
attr_accessor :estimated_delivery_date
|
@@ -179,3 +180,4 @@ module AftershipAPI::Model
|
|
179
180
|
end
|
180
181
|
end
|
181
182
|
end
|
183
|
+
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# Do not edit the class manually.
|
3
3
|
module AftershipAPI::Model
|
4
4
|
class AftershipEstimatedDeliveryDateUpdateTrackingByIdResponse
|
5
|
+
|
5
6
|
# The estimated arrival date of the shipment.
|
6
7
|
# estimated_delivery_date?: String;
|
7
8
|
attr_accessor :estimated_delivery_date
|
@@ -179,3 +180,4 @@ module AftershipAPI::Model
|
|
179
180
|
end
|
180
181
|
end
|
181
182
|
end
|
183
|
+
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# Do not edit the class manually.
|
3
3
|
module AftershipAPI::Model
|
4
4
|
class CarbonEmissionsCreateTrackingResponse
|
5
|
+
|
5
6
|
# The unit in which the value field is expressed. Allowed values: kg
|
6
7
|
# unit?: String;
|
7
8
|
attr_accessor :unit
|
@@ -159,3 +160,4 @@ module AftershipAPI::Model
|
|
159
160
|
end
|
160
161
|
end
|
161
162
|
end
|
163
|
+
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# Do not edit the class manually.
|
3
3
|
module AftershipAPI::Model
|
4
4
|
class CarbonEmissionsDeleteTrackingByIdResponse
|
5
|
+
|
5
6
|
# The unit in which the value field is expressed. Allowed values: kg
|
6
7
|
# unit?: String;
|
7
8
|
attr_accessor :unit
|
@@ -159,3 +160,4 @@ module AftershipAPI::Model
|
|
159
160
|
end
|
160
161
|
end
|
161
162
|
end
|
163
|
+
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# Do not edit the class manually.
|
3
3
|
module AftershipAPI::Model
|
4
4
|
class CarbonEmissionsGetTrackingByIdResponse
|
5
|
+
|
5
6
|
# The unit in which the value field is expressed. Allowed values: kg
|
6
7
|
# unit?: String;
|
7
8
|
attr_accessor :unit
|
@@ -159,3 +160,4 @@ module AftershipAPI::Model
|
|
159
160
|
end
|
160
161
|
end
|
161
162
|
end
|
163
|
+
|
data/lib/aftership-tracking-sdk/models/carbon_emissions_mark_tracking_completed_by_id_response.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
# Do not edit the class manually.
|
3
3
|
module AftershipAPI::Model
|
4
4
|
class CarbonEmissionsMarkTrackingCompletedByIdResponse
|
5
|
+
|
5
6
|
# The unit in which the value field is expressed. Allowed values: kg
|
6
7
|
# unit?: String;
|
7
8
|
attr_accessor :unit
|
@@ -159,3 +160,4 @@ module AftershipAPI::Model
|
|
159
160
|
end
|
160
161
|
end
|
161
162
|
end
|
163
|
+
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# Do not edit the class manually.
|
3
3
|
module AftershipAPI::Model
|
4
4
|
class CarbonEmissionsRetrackTrackingByIdResponse
|
5
|
+
|
5
6
|
# The unit in which the value field is expressed. Allowed values: kg
|
6
7
|
# unit?: String;
|
7
8
|
attr_accessor :unit
|
@@ -159,3 +160,4 @@ module AftershipAPI::Model
|
|
159
160
|
end
|
160
161
|
end
|
161
162
|
end
|
163
|
+
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# Do not edit the class manually.
|
3
3
|
module AftershipAPI::Model
|
4
4
|
class CarbonEmissionsTracking
|
5
|
+
|
5
6
|
# The unit in which the value field is expressed. Allowed values: kg
|
6
7
|
# unit?: String;
|
7
8
|
attr_accessor :unit
|
@@ -159,3 +160,4 @@ module AftershipAPI::Model
|
|
159
160
|
end
|
160
161
|
end
|
161
162
|
end
|
163
|
+
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# Do not edit the class manually.
|
3
3
|
module AftershipAPI::Model
|
4
4
|
class CarbonEmissionsUpdateTrackingByIdResponse
|
5
|
+
|
5
6
|
# The unit in which the value field is expressed. Allowed values: kg
|
6
7
|
# unit?: String;
|
7
8
|
attr_accessor :unit
|
@@ -159,3 +160,4 @@ module AftershipAPI::Model
|
|
159
160
|
end
|
160
161
|
end
|
161
162
|
end
|
163
|
+
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# Do not edit the class manually.
|
3
3
|
module AftershipAPI::Model
|
4
4
|
class Checkpoint
|
5
|
+
|
5
6
|
# The date and time of the checkpoint event was added to AfterShip. It uses the format `YYYY-MM-DDTHH:mm:ssZ` for the timezone GMT +0.
|
6
7
|
# created_at?: String;
|
7
8
|
attr_accessor :created_at
|
@@ -299,3 +300,4 @@ module AftershipAPI::Model
|
|
299
300
|
end
|
300
301
|
end
|
301
302
|
end
|
303
|
+
|
@@ -1,20 +1,17 @@
|
|
1
1
|
# This code was auto generated by AfterShip SDK Generator.
|
2
2
|
# Do not edit the class manually.
|
3
3
|
module AftershipAPI::Model
|
4
|
-
class
|
5
|
-
|
4
|
+
class CourierEstimatedDeliveryDateCreateTrackingResponse
|
5
|
+
|
6
|
+
# The estimated arrival date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
|
6
7
|
# estimated_delivery_date?: String;
|
7
8
|
attr_accessor :estimated_delivery_date
|
8
9
|
|
9
|
-
#
|
10
|
-
# confidence_code?: Float;
|
11
|
-
attr_accessor :confidence_code
|
12
|
-
|
13
|
-
# Earliest estimated delivery date of the shipment.
|
10
|
+
# The earliest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
|
14
11
|
# estimated_delivery_date_min?: String;
|
15
12
|
attr_accessor :estimated_delivery_date_min
|
16
13
|
|
17
|
-
# Latest estimated delivery date of the shipment.
|
14
|
+
# The Latest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
|
18
15
|
# estimated_delivery_date_max?: String;
|
19
16
|
attr_accessor :estimated_delivery_date_max
|
20
17
|
|
@@ -22,7 +19,7 @@ module AftershipAPI::Model
|
|
22
19
|
# @param [Hash] attributes Model attributes in the form of hash
|
23
20
|
def initialize(attributes = {})
|
24
21
|
if (!attributes.is_a?(Hash))
|
25
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `AftershipAPI::
|
22
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `AftershipAPI::CourierEstimatedDeliveryDateCreateTrackingResponse` initialize method"
|
26
23
|
end
|
27
24
|
|
28
25
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
@@ -33,10 +30,6 @@ module AftershipAPI::Model
|
|
33
30
|
self.estimated_delivery_date = attributes[:'estimated_delivery_date']
|
34
31
|
end
|
35
32
|
|
36
|
-
if attributes.key?(:'confidence_code')
|
37
|
-
self.confidence_code = attributes[:'confidence_code']
|
38
|
-
end
|
39
|
-
|
40
33
|
if attributes.key?(:'estimated_delivery_date_min')
|
41
34
|
self.estimated_delivery_date_min = attributes[:'estimated_delivery_date_min']
|
42
35
|
end
|
@@ -50,7 +43,6 @@ module AftershipAPI::Model
|
|
50
43
|
def self.openapi_types
|
51
44
|
{
|
52
45
|
:'estimated_delivery_date' => :'String',
|
53
|
-
:'confidence_code' => :'Float',
|
54
46
|
:'estimated_delivery_date_min' => :'String',
|
55
47
|
:'estimated_delivery_date_max' => :'String',
|
56
48
|
}
|
@@ -60,7 +52,6 @@ module AftershipAPI::Model
|
|
60
52
|
def self.attribute_map
|
61
53
|
{
|
62
54
|
:'estimated_delivery_date' => :'estimated_delivery_date',
|
63
|
-
:'confidence_code' => :'confidence_code',
|
64
55
|
:'estimated_delivery_date_min' => :'estimated_delivery_date_min',
|
65
56
|
:'estimated_delivery_date_max' => :'estimated_delivery_date_max',
|
66
57
|
}
|
@@ -179,3 +170,4 @@ module AftershipAPI::Model
|
|
179
170
|
end
|
180
171
|
end
|
181
172
|
end
|
173
|
+
|
@@ -1,20 +1,17 @@
|
|
1
1
|
# This code was auto generated by AfterShip SDK Generator.
|
2
2
|
# Do not edit the class manually.
|
3
3
|
module AftershipAPI::Model
|
4
|
-
class
|
5
|
-
|
4
|
+
class CourierEstimatedDeliveryDateDeleteTrackingByIdResponse
|
5
|
+
|
6
|
+
# The estimated arrival date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
|
6
7
|
# estimated_delivery_date?: String;
|
7
8
|
attr_accessor :estimated_delivery_date
|
8
9
|
|
9
|
-
#
|
10
|
-
# confidence_code?: Float;
|
11
|
-
attr_accessor :confidence_code
|
12
|
-
|
13
|
-
# Earliest estimated delivery date of the shipment.
|
10
|
+
# The earliest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
|
14
11
|
# estimated_delivery_date_min?: String;
|
15
12
|
attr_accessor :estimated_delivery_date_min
|
16
13
|
|
17
|
-
# Latest estimated delivery date of the shipment.
|
14
|
+
# The Latest estimated delivery date of the shipment. It reflects the shipment recipient’s timezone and the format may vary based on how the carrier provides it:- YYYY-MM-DD- YYYY-MM-DDTHH:mm:ss- YYYY-MM-DDTHH:mm:ssZ
|
18
15
|
# estimated_delivery_date_max?: String;
|
19
16
|
attr_accessor :estimated_delivery_date_max
|
20
17
|
|
@@ -22,7 +19,7 @@ module AftershipAPI::Model
|
|
22
19
|
# @param [Hash] attributes Model attributes in the form of hash
|
23
20
|
def initialize(attributes = {})
|
24
21
|
if (!attributes.is_a?(Hash))
|
25
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `AftershipAPI::
|
22
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `AftershipAPI::CourierEstimatedDeliveryDateDeleteTrackingByIdResponse` initialize method"
|
26
23
|
end
|
27
24
|
|
28
25
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
@@ -33,10 +30,6 @@ module AftershipAPI::Model
|
|
33
30
|
self.estimated_delivery_date = attributes[:'estimated_delivery_date']
|
34
31
|
end
|
35
32
|
|
36
|
-
if attributes.key?(:'confidence_code')
|
37
|
-
self.confidence_code = attributes[:'confidence_code']
|
38
|
-
end
|
39
|
-
|
40
33
|
if attributes.key?(:'estimated_delivery_date_min')
|
41
34
|
self.estimated_delivery_date_min = attributes[:'estimated_delivery_date_min']
|
42
35
|
end
|
@@ -50,7 +43,6 @@ module AftershipAPI::Model
|
|
50
43
|
def self.openapi_types
|
51
44
|
{
|
52
45
|
:'estimated_delivery_date' => :'String',
|
53
|
-
:'confidence_code' => :'Float',
|
54
46
|
:'estimated_delivery_date_min' => :'String',
|
55
47
|
:'estimated_delivery_date_max' => :'String',
|
56
48
|
}
|
@@ -60,7 +52,6 @@ module AftershipAPI::Model
|
|
60
52
|
def self.attribute_map
|
61
53
|
{
|
62
54
|
:'estimated_delivery_date' => :'estimated_delivery_date',
|
63
|
-
:'confidence_code' => :'confidence_code',
|
64
55
|
:'estimated_delivery_date_min' => :'estimated_delivery_date_min',
|
65
56
|
:'estimated_delivery_date_max' => :'estimated_delivery_date_max',
|
66
57
|
}
|
@@ -179,3 +170,4 @@ module AftershipAPI::Model
|
|
179
170
|
end
|
180
171
|
end
|
181
172
|
end
|
173
|
+
|