Skip to content

Commit 89a64ec

Browse files
authored
Merge pull request #10 from 1415003719/2025-04
support 2025-04 version
2 parents b72e913 + d645f7b commit 89a64ec

65 files changed

Lines changed: 2844 additions & 610 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ If you need support using AfterShip products, please contact support@aftership.c
2222
- [Endpoints](#endpoints)
2323
- [/trackings](#trackings)
2424
- [/couriers](#couriers)
25+
- [/courier-connections](#courier-connections)
2526
- [/estimated-delivery-date](#estimated-delivery-date)
2627
- [Help](#help)
2728
- [License](#license)
@@ -42,6 +43,7 @@ Each SDK version is designed to work with a specific API version. Please refer t
4243

4344
| SDK Version | Supported API Version | Branch |
4445
| ----------- | --------------------- | ----------------------------------------------------------- |
46+
| 11.x.x | 2025-04 | https://github.com/AfterShip/tracking-sdk-ruby/tree/2025-04 |
4547
| 10.x.x | 2025-01 | https://github.com/AfterShip/tracking-sdk-ruby/tree/2025-01 |
4648
| 9.x.x | 2024-10 | https://github.com/AfterShip/tracking-sdk-ruby/tree/2024-10 |
4749
| 8.x.x | 2024-07 | https://github.com/AfterShip/tracking-sdk-ruby/tree/2024-07 |
@@ -58,7 +60,7 @@ gem install aftership-tracking-sdk
5860
Or add a line to your Gemfile
5961

6062
```bash
61-
gem 'aftership-tracking-sdk', '~> 10.0.0'
63+
gem 'aftership-tracking-sdk', '~> 11.0.0'
6264
```
6365

6466
## Constructor
@@ -95,7 +97,7 @@ end
9597

9698
## Rate Limiter
9799

98-
See the [Rate Limit](https://www.aftership.com/docs/tracking/2025-01/quickstart/rate-limit) to understand the AfterShip rate limit policy.
100+
See the [Rate Limit](https://www.aftership.com/docs/tracking/2025-04/quickstart/rate-limit) to understand the AfterShip rate limit policy.
99101

100102
## Error Handling
101103

@@ -143,6 +145,7 @@ The AfterShip instance has the following properties which are exactly the same a
143145

144146
- courier - Get a list of our supported couriers.
145147
- tracking - Create trackings, update trackings, and get tracking results.
148+
- courier-connection - Create courier connections, update courier connections, and get courier connections results.
146149
- estimated-delivery-date - Get estimated delivery date for your order.
147150

148151

@@ -213,14 +216,7 @@ p resp.to_json
213216
**GET** /couriers
214217

215218
```ruby
216-
resp = AftershipAPI::Courier.get_user_couriers()
217-
p resp.to_json
218-
```
219-
220-
**GET** /couriers/all
221-
222-
```ruby
223-
resp = AftershipAPI::Courier.get_all_couriers()
219+
resp = AftershipAPI::Courier.get_couriers()
224220
p resp.to_json
225221
```
226222

@@ -242,11 +238,11 @@ edd = AftershipAPI::Model::EstimatedDeliveryDateRequest.new
242238
edd.slug = "<slug>"
243239
edd.pickup_time = "2024-08-01 06:42:30"
244240
origin = AftershipAPI::Model::OriginAddressEstimatedDeliveryDateRequest.new
245-
origin.country_region = "<ISO 3166-1 country/region code>"
241+
origin.country = "<ISO 3166-1 country/region code>"
246242
origin.state = "<ISO 3166-1 country/region code>"
247243

248244
dest = AftershipAPI::Model::DestinationAddressEstimatedDeliveryDateRequest.new
249-
dest.country_region = "<ISO 3166-1 country/region code>"
245+
dest.country = "<ISO 3166-1 country/region code>"
250246
dest.state = "<ISO 3166-1 country/region code>"
251247

252248
edd.origin_address = origin

lib/aftership-tracking-sdk/api/courier.rb

Lines changed: 16 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def detect_courier_with_http_info(opts: {})
3333

3434

3535
# resource path
36-
local_var_path = "/tracking/2025-01/couriers/detect"
36+
local_var_path = "/tracking/2025-04/couriers/detect"
3737
method = :'POST'
3838

3939
# query parameters
@@ -64,39 +64,43 @@ def detect_courier_with_http_info(opts: {})
6464
return data, status_code, headers
6565
end
6666

67-
# get_all_couriers
68-
# Return a list of all couriers.
67+
# get_couriers
68+
# Return a list of couriers.
6969
# @param [Hash] opts the optional parameters
70-
# @return [Model::GetAllCouriersResponse]
71-
def get_all_couriers(opts: {})
72-
data, _status_code, _headers = get_all_couriers_with_http_info(opts: opts)
70+
# @option opts [Boolean] :active get user activated couriers
71+
# @option opts [String] :slug Unique courier code Use comma for multiple values. (Example: dhl,ups,usps)
72+
# @return [Model::GetCouriersResponse]
73+
def get_couriers(opts: {})
74+
data, _status_code, _headers = get_couriers_with_http_info(opts: opts)
7375
data
7476
end
7577

76-
def get_all_couriers_with_http_info(opts: {})
78+
def get_couriers_with_http_info(opts: {})
7779
if @api_client.config.debugging
78-
@api_client.config.logger.debug 'Calling API: CourierApi.get_all_couriers ...'
80+
@api_client.config.logger.debug 'Calling API: CourierApi.get_couriers ...'
7981
end
8082

8183

8284

8385
# resource path
84-
local_var_path = "/tracking/2025-01/couriers/all"
86+
local_var_path = "/tracking/2025-04/couriers"
8587
method = :'GET'
8688

8789
# query parameters
8890
query_params = opts[:query_params] || {}
91+
query_params[:'active'] = opts[:'active'] if !opts[:'active'].nil?
92+
query_params[:'slug'] = opts[:'slug'] if !opts[:'slug'].nil?
8993
# header parameters
9094
header_params = opts[:header_params] || {}
9195

9296
# http body (model)
9397
post_body = opts[:body]
9498

9599
# return_type
96-
return_type = 'GetAllCouriersResponse'
100+
return_type = 'GetCouriersResponse'
97101

98102
new_options = opts.merge(
99-
:operation => :"CourierApi.get_all_couriers",
103+
:operation => :"CourierApi.get_couriers",
100104
:header_params => header_params,
101105
:query_params => query_params,
102106
:body => post_body,
@@ -107,55 +111,7 @@ def get_all_couriers_with_http_info(opts: {})
107111

108112
data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
109113
if @api_client.config.debugging
110-
@api_client.config.logger.debug "API called: CourierApi#get_all_couriers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
111-
end
112-
return data, status_code, headers
113-
end
114-
115-
# get_user_couriers
116-
# Return a list of .
117-
# @param [Hash] opts the optional parameters
118-
# @return [Model::GetUserCouriersResponse]
119-
def get_user_couriers(opts: {})
120-
data, _status_code, _headers = get_user_couriers_with_http_info(opts: opts)
121-
data
122-
end
123-
124-
def get_user_couriers_with_http_info(opts: {})
125-
if @api_client.config.debugging
126-
@api_client.config.logger.debug 'Calling API: CourierApi.get_user_couriers ...'
127-
end
128-
129-
130-
131-
# resource path
132-
local_var_path = "/tracking/2025-01/couriers"
133-
method = :'GET'
134-
135-
# query parameters
136-
query_params = opts[:query_params] || {}
137-
# header parameters
138-
header_params = opts[:header_params] || {}
139-
140-
# http body (model)
141-
post_body = opts[:body]
142-
143-
# return_type
144-
return_type = 'GetUserCouriersResponse'
145-
146-
new_options = opts.merge(
147-
:operation => :"CourierApi.get_user_couriers",
148-
:header_params => header_params,
149-
:query_params => query_params,
150-
:body => post_body,
151-
:return_type => return_type,
152-
:response_legacy_tag => "",
153-
:is_paging => false
154-
)
155-
156-
data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
157-
if @api_client.config.debugging
158-
@api_client.config.logger.debug "API called: CourierApi#get_user_couriers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
114+
@api_client.config.logger.debug "API called: CourierApi#get_couriers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
159115
end
160116
return data, status_code, headers
161117
end

0 commit comments

Comments
 (0)