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.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/README.md +4 -3
  4. data/lib/aftership-tracking-sdk/api/courier.rb +6 -6
  5. data/lib/aftership-tracking-sdk/api/estimated_delivery_date.rb +4 -4
  6. data/lib/aftership-tracking-sdk/api/tracking.rb +23 -389
  7. data/lib/aftership-tracking-sdk/api_client.rb +2 -2
  8. data/lib/aftership-tracking-sdk/configuration.rb +108 -108
  9. data/lib/aftership-tracking-sdk/models/additional_fields_v1.rb +1 -1
  10. data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_create_tracking_response.rb +2 -0
  11. data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_delete_tracking_by_id_response.rb +2 -0
  12. data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_get_tracking_by_id_response.rb +2 -0
  13. data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_mark_tracking_completed_by_id_response.rb +2 -0
  14. data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_retrack_tracking_by_id_response.rb +2 -0
  15. data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_tracking.rb +2 -0
  16. data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_update_tracking_by_id_response.rb +2 -0
  17. data/lib/aftership-tracking-sdk/models/carbon_emissions_create_tracking_response.rb +2 -0
  18. data/lib/aftership-tracking-sdk/models/carbon_emissions_delete_tracking_by_id_response.rb +2 -0
  19. data/lib/aftership-tracking-sdk/models/carbon_emissions_get_tracking_by_id_response.rb +2 -0
  20. data/lib/aftership-tracking-sdk/models/carbon_emissions_mark_tracking_completed_by_id_response.rb +2 -0
  21. data/lib/aftership-tracking-sdk/models/carbon_emissions_retrack_tracking_by_id_response.rb +2 -0
  22. data/lib/aftership-tracking-sdk/models/carbon_emissions_tracking.rb +2 -0
  23. data/lib/aftership-tracking-sdk/models/carbon_emissions_update_tracking_by_id_response.rb +2 -0
  24. data/lib/aftership-tracking-sdk/models/checkpoint.rb +2 -0
  25. data/lib/aftership-tracking-sdk/models/coordinate_checkpoint.rb +2 -0
  26. data/lib/aftership-tracking-sdk/models/courier.rb +2 -0
  27. 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
  28. 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
  29. 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
  30. data/lib/aftership-tracking-sdk/models/courier_estimated_delivery_date_mark_tracking_completed_by_id_response.rb +173 -0
  31. data/lib/aftership-tracking-sdk/models/courier_estimated_delivery_date_retrack_tracking_by_id_response.rb +173 -0
  32. 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
  33. data/lib/aftership-tracking-sdk/models/courier_estimated_delivery_date_update_tracking_by_id_response.rb +173 -0
  34. data/lib/aftership-tracking-sdk/models/courier_response_v1.rb +2 -0
  35. data/lib/aftership-tracking-sdk/models/create_tracking_request.rb +2 -0
  36. data/lib/aftership-tracking-sdk/models/create_tracking_response.rb +29 -7
  37. data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_create_tracking_response.rb +2 -0
  38. data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_delete_tracking_by_id_response.rb +2 -0
  39. data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_get_tracking_by_id_response.rb +2 -0
  40. data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_mark_tracking_completed_by_id_response.rb +2 -0
  41. data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_retrack_tracking_by_id_response.rb +2 -0
  42. data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_tracking.rb +2 -0
  43. data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_update_tracking_by_id_response.rb +2 -0
  44. data/lib/aftership-tracking-sdk/models/data_courier_response_v1.rb +2 -0
  45. data/lib/aftership-tracking-sdk/models/data_tracking_response_get_multiple_v1.rb +8 -126
  46. data/lib/aftership-tracking-sdk/models/delete_tracking_by_id_response.rb +29 -7
  47. data/lib/aftership-tracking-sdk/models/destination_address_estimated_delivery_date_request.rb +2 -0
  48. data/lib/aftership-tracking-sdk/models/destination_address_estimated_delivery_date_response.rb +2 -0
  49. data/lib/aftership-tracking-sdk/models/detect_courier_request.rb +2 -0
  50. data/lib/aftership-tracking-sdk/models/detect_courier_response.rb +2 -0
  51. data/lib/aftership-tracking-sdk/models/estimated_delivery_date_request.rb +2 -0
  52. data/lib/aftership-tracking-sdk/models/estimated_delivery_date_response.rb +2 -0
  53. data/lib/aftership-tracking-sdk/models/estimated_pickup_estimated_delivery_date_request.rb +2 -0
  54. data/lib/aftership-tracking-sdk/models/estimated_pickup_estimated_delivery_date_response.rb +2 -0
  55. data/lib/aftership-tracking-sdk/models/events_checkpoint.rb +2 -0
  56. data/lib/aftership-tracking-sdk/models/first_estimated_delivery_create_tracking_response.rb +2 -0
  57. data/lib/aftership-tracking-sdk/models/first_estimated_delivery_delete_tracking_by_id_response.rb +2 -0
  58. data/lib/aftership-tracking-sdk/models/first_estimated_delivery_get_tracking_by_id_response.rb +2 -0
  59. data/lib/aftership-tracking-sdk/models/first_estimated_delivery_mark_tracking_completed_by_id_response.rb +2 -0
  60. data/lib/aftership-tracking-sdk/models/first_estimated_delivery_retrack_tracking_by_id_response.rb +2 -0
  61. data/lib/aftership-tracking-sdk/models/first_estimated_delivery_tracking.rb +2 -0
  62. data/lib/aftership-tracking-sdk/models/first_estimated_delivery_update_tracking_by_id_response.rb +2 -0
  63. data/lib/aftership-tracking-sdk/models/get_all_couriers_response.rb +2 -0
  64. data/lib/aftership-tracking-sdk/models/get_tracking_by_id_response.rb +29 -7
  65. data/lib/aftership-tracking-sdk/models/get_trackings_response.rb +5 -3
  66. data/lib/aftership-tracking-sdk/models/get_user_couriers_response.rb +2 -0
  67. data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_create_tracking_response.rb +2 -0
  68. data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_delete_tracking_by_id_response.rb +2 -0
  69. data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_get_tracking_by_id_response.rb +2 -0
  70. data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_mark_tracking_completed_by_id_response.rb +2 -0
  71. data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_retrack_tracking_by_id_response.rb +2 -0
  72. data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_tracking.rb +2 -0
  73. data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_update_tracking_by_id_response.rb +2 -0
  74. data/lib/aftership-tracking-sdk/models/mark_tracking_completed_by_id_request.rb +2 -0
  75. data/lib/aftership-tracking-sdk/models/mark_tracking_completed_by_id_response.rb +29 -7
  76. data/lib/aftership-tracking-sdk/models/meta_v1.rb +2 -0
  77. data/lib/aftership-tracking-sdk/models/next_couriers_create_tracking_request.rb +2 -0
  78. data/lib/aftership-tracking-sdk/models/next_couriers_create_tracking_response.rb +22 -0
  79. data/lib/aftership-tracking-sdk/models/next_couriers_delete_tracking_by_id_response.rb +22 -0
  80. data/lib/aftership-tracking-sdk/models/next_couriers_get_tracking_by_id_response.rb +22 -0
  81. data/lib/aftership-tracking-sdk/models/next_couriers_mark_tracking_completed_by_id_response.rb +22 -0
  82. data/lib/aftership-tracking-sdk/models/next_couriers_retrack_tracking_by_id_response.rb +22 -0
  83. data/lib/aftership-tracking-sdk/models/next_couriers_tracking.rb +22 -0
  84. data/lib/aftership-tracking-sdk/models/next_couriers_update_tracking_by_id_response.rb +22 -0
  85. data/lib/aftership-tracking-sdk/models/order_processing_time_estimated_pickup_estimated_delivery_date_request.rb +2 -0
  86. data/lib/aftership-tracking-sdk/models/order_processing_time_estimated_pickup_estimated_delivery_date_response.rb +2 -0
  87. data/lib/aftership-tracking-sdk/models/origin_address_estimated_delivery_date_request.rb +2 -0
  88. data/lib/aftership-tracking-sdk/models/origin_address_estimated_delivery_date_response.rb +2 -0
  89. data/lib/aftership-tracking-sdk/models/pagination.rb +14 -6
  90. 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
  91. data/lib/aftership-tracking-sdk/models/{next_couriers_delete_tracking_by_slug_tracking_number_response.rb → pagination_get_trackings_response.rb} +25 -23
  92. data/lib/aftership-tracking-sdk/models/predict_batch_request.rb +2 -0
  93. data/lib/aftership-tracking-sdk/models/predict_batch_response.rb +2 -0
  94. data/lib/aftership-tracking-sdk/models/reason_events_checkpoint.rb +2 -0
  95. data/lib/aftership-tracking-sdk/models/retrack_tracking_by_id_response.rb +29 -7
  96. data/lib/aftership-tracking-sdk/models/shipment_weight_create_tracking_response.rb +2 -0
  97. data/lib/aftership-tracking-sdk/models/shipment_weight_delete_tracking_by_id_response.rb +2 -0
  98. data/lib/aftership-tracking-sdk/models/shipment_weight_get_tracking_by_id_response.rb +2 -0
  99. data/lib/aftership-tracking-sdk/models/shipment_weight_mark_tracking_completed_by_id_response.rb +2 -0
  100. data/lib/aftership-tracking-sdk/models/shipment_weight_retrack_tracking_by_id_response.rb +2 -0
  101. data/lib/aftership-tracking-sdk/models/shipment_weight_tracking.rb +2 -0
  102. data/lib/aftership-tracking-sdk/models/shipment_weight_update_tracking_by_id_response.rb +2 -0
  103. data/lib/aftership-tracking-sdk/models/slug_group_v1.rb +1 -1
  104. data/lib/aftership-tracking-sdk/models/tag_v1.rb +1 -1
  105. data/lib/aftership-tracking-sdk/models/tracking.rb +29 -7
  106. data/lib/aftership-tracking-sdk/models/tracking_response_get_multiple_v1.rb +2 -0
  107. data/lib/aftership-tracking-sdk/models/tracking_response_v1.rb +2 -0
  108. data/lib/aftership-tracking-sdk/models/update_tracking_by_id_request.rb +2 -0
  109. data/lib/aftership-tracking-sdk/models/update_tracking_by_id_response.rb +29 -7
  110. data/lib/aftership-tracking-sdk/models/weight_estimated_delivery_date_request.rb +2 -0
  111. data/lib/aftership-tracking-sdk/models/weight_estimated_delivery_date_response.rb +2 -0
  112. data/lib/aftership-tracking-sdk/version.rb +1 -1
  113. metadata +11 -45
  114. data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_update_tracking_by_slug_tracking_number_response.rb +0 -181
  115. data/lib/aftership-tracking-sdk/models/carbon_emissions_delete_tracking_by_slug_tracking_number_response.rb +0 -161
  116. data/lib/aftership-tracking-sdk/models/carbon_emissions_get_tracking_by_slug_tracking_number_response.rb +0 -161
  117. data/lib/aftership-tracking-sdk/models/carbon_emissions_mark_tracking_completed_by_slug_tracking_number_response.rb +0 -161
  118. data/lib/aftership-tracking-sdk/models/carbon_emissions_retrack_tracking_by_slug_tracking_number_response.rb +0 -161
  119. data/lib/aftership-tracking-sdk/models/carbon_emissions_update_tracking_by_slug_tracking_number_response.rb +0 -161
  120. data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_delete_tracking_by_slug_tracking_number_response.rb +0 -181
  121. data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_get_tracking_by_slug_tracking_number_response.rb +0 -181
  122. data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_mark_tracking_completed_by_slug_tracking_number_response.rb +0 -181
  123. data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_retrack_tracking_by_slug_tracking_number_response.rb +0 -181
  124. data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_update_tracking_by_slug_tracking_number_response.rb +0 -181
  125. data/lib/aftership-tracking-sdk/models/custom_fields_update_tracking_by_slug_tracking_number_request.rb +0 -139
  126. data/lib/aftership-tracking-sdk/models/delete_tracking_by_slug_tracking_number_response.rb +0 -931
  127. data/lib/aftership-tracking-sdk/models/first_estimated_delivery_delete_tracking_by_slug_tracking_number_response.rb +0 -191
  128. data/lib/aftership-tracking-sdk/models/first_estimated_delivery_get_tracking_by_slug_tracking_number_response.rb +0 -191
  129. data/lib/aftership-tracking-sdk/models/first_estimated_delivery_mark_tracking_completed_by_slug_tracking_number_response.rb +0 -191
  130. data/lib/aftership-tracking-sdk/models/first_estimated_delivery_retrack_tracking_by_slug_tracking_number_response.rb +0 -191
  131. data/lib/aftership-tracking-sdk/models/first_estimated_delivery_update_tracking_by_slug_tracking_number_response.rb +0 -191
  132. data/lib/aftership-tracking-sdk/models/get_tracking_by_slug_tracking_number_response.rb +0 -931
  133. data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_delete_tracking_by_slug_tracking_number_response.rb +0 -191
  134. data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_get_tracking_by_slug_tracking_number_response.rb +0 -191
  135. data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_mark_tracking_completed_by_slug_tracking_number_response.rb +0 -191
  136. data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_retrack_tracking_by_slug_tracking_number_response.rb +0 -191
  137. data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_update_tracking_by_slug_tracking_number_response.rb +0 -191
  138. data/lib/aftership-tracking-sdk/models/mark_tracking_completed_by_slug_tracking_number_request.rb +0 -151
  139. data/lib/aftership-tracking-sdk/models/mark_tracking_completed_by_slug_tracking_number_response.rb +0 -931
  140. data/lib/aftership-tracking-sdk/models/next_couriers_mark_tracking_completed_by_slug_tracking_number_response.rb +0 -171
  141. data/lib/aftership-tracking-sdk/models/next_couriers_retrack_tracking_by_slug_tracking_number_response.rb +0 -171
  142. data/lib/aftership-tracking-sdk/models/next_couriers_update_tracking_by_slug_tracking_number_response.rb +0 -171
  143. data/lib/aftership-tracking-sdk/models/retrack_tracking_by_slug_tracking_number_response.rb +0 -931
  144. data/lib/aftership-tracking-sdk/models/shipment_weight_delete_tracking_by_slug_tracking_number_response.rb +0 -161
  145. data/lib/aftership-tracking-sdk/models/shipment_weight_get_tracking_by_slug_tracking_number_response.rb +0 -161
  146. data/lib/aftership-tracking-sdk/models/shipment_weight_mark_tracking_completed_by_slug_tracking_number_response.rb +0 -161
  147. data/lib/aftership-tracking-sdk/models/shipment_weight_retrack_tracking_by_slug_tracking_number_response.rb +0 -161
  148. data/lib/aftership-tracking-sdk/models/shipment_weight_update_tracking_by_slug_tracking_number_response.rb +0 -161
  149. data/lib/aftership-tracking-sdk/models/update_tracking_by_slug_tracking_number_request.rb +0 -391
  150. 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
- 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
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
- attr_accessor :aftership_client
67
+ attr_accessor :aftership_client
68
68
 
69
- attr_accessor :headers
69
+ attr_accessor :headers
70
70
 
71
71
 
72
- def initialize
73
- default_user_agent = "aftership-sdk-ruby/#{AftershipAPI::VERSION} (https://www.aftership.com) typhoeus/#{Typhoeus::VERSION}"
72
+ def initialize
73
+ default_user_agent = "aftership-sdk-ruby/#{AftershipAPI::VERSION} (https://www.aftership.com) typhoeus/#{Typhoeus::VERSION}"
74
74
 
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 = {}
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
- 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
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, TRACKING_POSTAL_CODE, TRACKING_SHIP_DATE, TRACKING_KEY, TRACKING_ORIGIN_COUNTRY, TRACKING_DESTINATION_COUNTRY, TRACKING_STATE,].freeze
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
@@ -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
+
@@ -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
+
@@ -2,6 +2,7 @@
2
2
  # Do not edit the class manually.
3
3
  module AftershipAPI::Model
4
4
  class CoordinateCheckpoint
5
+
5
6
  # Represents the latitude.
6
7
  # latitude?: Float;
7
8
  attr_accessor :latitude
@@ -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 Courier
5
+
5
6
  # Unique code of courier. Get the slugs from .
6
7
  # slug?: String;
7
8
  attr_accessor :slug
@@ -239,3 +240,4 @@ module AftershipAPI::Model
239
240
  end
240
241
  end
241
242
  end
243
+
@@ -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 AftershipEstimatedDeliveryDateGetTrackingBySlugTrackingNumberResponse
5
- # The estimated arrival date of the shipment.
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
- # 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.
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::AftershipEstimatedDeliveryDateGetTrackingBySlugTrackingNumberResponse` initialize method"
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 AftershipEstimatedDeliveryDateRetrackTrackingBySlugTrackingNumberResponse
5
- # The estimated arrival date of the shipment.
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
- # 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.
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::AftershipEstimatedDeliveryDateRetrackTrackingBySlugTrackingNumberResponse` initialize method"
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
+