aftership-tracking-sdk 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +11 -0
  3. data/LICENSE +21 -0
  4. data/README.md +285 -0
  5. data/aftership-tracking-sdk.gemspec +27 -0
  6. data/lib/aftership-tracking-sdk/api/courier.rb +163 -0
  7. data/lib/aftership-tracking-sdk/api/estimated_delivery_date.rb +67 -0
  8. data/lib/aftership-tracking-sdk/api/last_checkpoint.rb +143 -0
  9. data/lib/aftership-tracking-sdk/api/notification.rb +403 -0
  10. data/lib/aftership-tracking-sdk/api/tracking.rb +793 -0
  11. data/lib/aftership-tracking-sdk/api_client.rb +426 -0
  12. data/lib/aftership-tracking-sdk/configuration.rb +122 -0
  13. data/lib/aftership-tracking-sdk/error.rb +125 -0
  14. data/lib/aftership-tracking-sdk/models/additional_fields_v1.rb +32 -0
  15. data/lib/aftership-tracking-sdk/models/aftership_estimated_delivery_date_tracking.rb +181 -0
  16. data/lib/aftership-tracking-sdk/models/carbon_emissions_tracking.rb +161 -0
  17. data/lib/aftership-tracking-sdk/models/checkpoint.rb +301 -0
  18. data/lib/aftership-tracking-sdk/models/coordinate_checkpoint.rb +161 -0
  19. data/lib/aftership-tracking-sdk/models/courier.rb +241 -0
  20. data/lib/aftership-tracking-sdk/models/courier_response_v1.rb +161 -0
  21. data/lib/aftership-tracking-sdk/models/custom_estimated_delivery_date_tracking.rb +181 -0
  22. data/lib/aftership-tracking-sdk/models/custom_fields_tracking_update_tracking_by_slug_tracking_number_request.rb +139 -0
  23. data/lib/aftership-tracking-sdk/models/data_courier_response_v1.rb +161 -0
  24. data/lib/aftership-tracking-sdk/models/data_notification_response_v1.rb +151 -0
  25. data/lib/aftership-tracking-sdk/models/data_tracking_delete_response_v1.rb +151 -0
  26. data/lib/aftership-tracking-sdk/models/data_tracking_response_get_multiple_v1.rb +281 -0
  27. data/lib/aftership-tracking-sdk/models/data_tracking_response_v1.rb +151 -0
  28. data/lib/aftership-tracking-sdk/models/destination_address_estimated_delivery_date_request.rb +191 -0
  29. data/lib/aftership-tracking-sdk/models/destination_address_estimated_delivery_date_response.rb +191 -0
  30. data/lib/aftership-tracking-sdk/models/detect_courier_response.rb +161 -0
  31. data/lib/aftership-tracking-sdk/models/estimated_delivery_date_request.rb +221 -0
  32. data/lib/aftership-tracking-sdk/models/estimated_delivery_date_response.rb +261 -0
  33. data/lib/aftership-tracking-sdk/models/estimated_pickup_estimated_delivery_date_request.rb +181 -0
  34. data/lib/aftership-tracking-sdk/models/estimated_pickup_estimated_delivery_date_response.rb +191 -0
  35. data/lib/aftership-tracking-sdk/models/events_checkpoint.rb +161 -0
  36. data/lib/aftership-tracking-sdk/models/first_estimated_delivery_tracking.rb +191 -0
  37. data/lib/aftership-tracking-sdk/models/get_all_couriers_response.rb +161 -0
  38. data/lib/aftership-tracking-sdk/models/get_checkpoint_by_slug_tracking_number_response.rb +211 -0
  39. data/lib/aftership-tracking-sdk/models/get_checkpoint_by_tracking_id_response.rb +211 -0
  40. data/lib/aftership-tracking-sdk/models/get_trackings_response.rb +161 -0
  41. data/lib/aftership-tracking-sdk/models/get_user_couriers_response.rb +161 -0
  42. data/lib/aftership-tracking-sdk/models/latest_estimated_delivery_tracking.rb +191 -0
  43. data/lib/aftership-tracking-sdk/models/mark_tracking_completed_by_id_request.rb +151 -0
  44. data/lib/aftership-tracking-sdk/models/mark_tracking_completed_by_slug_tracking_number_request.rb +151 -0
  45. data/lib/aftership-tracking-sdk/models/meta_v1.rb +171 -0
  46. data/lib/aftership-tracking-sdk/models/next_couriers_tracking.rb +171 -0
  47. data/lib/aftership-tracking-sdk/models/next_couriers_tracking_create_tracking_request.rb +161 -0
  48. data/lib/aftership-tracking-sdk/models/notification.rb +161 -0
  49. data/lib/aftership-tracking-sdk/models/notification_request_v1.rb +161 -0
  50. data/lib/aftership-tracking-sdk/models/notification_response_v1.rb +161 -0
  51. data/lib/aftership-tracking-sdk/models/order_processing_time_estimated_pickup_estimated_delivery_date_request.rb +161 -0
  52. data/lib/aftership-tracking-sdk/models/order_processing_time_estimated_pickup_estimated_delivery_date_response.rb +161 -0
  53. data/lib/aftership-tracking-sdk/models/origin_address_estimated_delivery_date_request.rb +191 -0
  54. data/lib/aftership-tracking-sdk/models/origin_address_estimated_delivery_date_response.rb +191 -0
  55. data/lib/aftership-tracking-sdk/models/pagination.rb +156 -0
  56. data/lib/aftership-tracking-sdk/models/partial_delete_tracking.rb +241 -0
  57. data/lib/aftership-tracking-sdk/models/partial_update_tracking.rb +251 -0
  58. data/lib/aftership-tracking-sdk/models/predict_batch_request.rb +151 -0
  59. data/lib/aftership-tracking-sdk/models/predict_batch_response.rb +151 -0
  60. data/lib/aftership-tracking-sdk/models/reason_events_checkpoint.rb +151 -0
  61. data/lib/aftership-tracking-sdk/models/slug_group_v1.rb +37 -0
  62. data/lib/aftership-tracking-sdk/models/tag_v1.rb +34 -0
  63. data/lib/aftership-tracking-sdk/models/tracking.rb +921 -0
  64. data/lib/aftership-tracking-sdk/models/tracking_create_tracking_request.rb +551 -0
  65. data/lib/aftership-tracking-sdk/models/tracking_delete_response_v1.rb +161 -0
  66. data/lib/aftership-tracking-sdk/models/tracking_detect_courier_request.rb +261 -0
  67. data/lib/aftership-tracking-sdk/models/tracking_response_get_multiple_v1.rb +161 -0
  68. data/lib/aftership-tracking-sdk/models/tracking_response_v1.rb +161 -0
  69. data/lib/aftership-tracking-sdk/models/tracking_update_tracking_by_id_request.rb +501 -0
  70. data/lib/aftership-tracking-sdk/models/tracking_update_tracking_by_slug_tracking_number_request.rb +391 -0
  71. data/lib/aftership-tracking-sdk/models/weight_estimated_delivery_date_request.rb +161 -0
  72. data/lib/aftership-tracking-sdk/models/weight_estimated_delivery_date_response.rb +161 -0
  73. data/lib/aftership-tracking-sdk/sign_string.rb +77 -0
  74. data/lib/aftership-tracking-sdk/version.rb +5 -0
  75. data/lib/aftership-tracking-sdk.rb +47 -0
  76. metadata +157 -0
@@ -0,0 +1,143 @@
1
+ # This code was auto generated by AfterShip SDK Generator.
2
+ # Do not edit the class manually.
3
+ require 'cgi'
4
+
5
+ module AftershipAPI
6
+ class LastCheckpointApi
7
+ attr_accessor :api_client
8
+
9
+ def initialize(api_client = ApiClient.default)
10
+ @api_client = api_client
11
+ end
12
+
13
+ # get_checkpoint_by_slug_tracking_number
14
+ # Return the tracking information of the last checkpoint of a single tracking.
15
+ # @param slug [String] Tracking slug
16
+ # @param tracking_number [String] Tracking number
17
+ # @param [Hash] opts the optional parameters
18
+ # @option opts [String] :fields List of fields to include in the response. Use comma for multiple values. Fields to include: `slug`, `created_at`, `checkpoint_time`, `city`, `coordinates`, `country_iso3`, `country_name`, `message`, `state`, `tag`, `zip`
19
+ # @option opts [String] :lang Support Chinese to English translation for `china-ems` and `china-post` only
20
+ # @option opts [String] :tracking_account_number Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
21
+ # @option opts [String] :tracking_origin_country Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details.
22
+ # @option opts [String] :tracking_destination_country Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details.
23
+ # @option opts [String] :tracking_key Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
24
+ # @option opts [String] :tracking_postal_code Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
25
+ # @option opts [String] :tracking_ship_date Additional field required by some carriers to retrieve the tracking info. The date the shipment was sent, using the format YYYYMMDD. Refer to our article on for more details.
26
+ # @option opts [String] :tracking_state Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
27
+ # @return [Model::GetCheckpointBySlugTrackingNumberResponse]
28
+ def get_checkpoint_by_slug_tracking_number(slug:, tracking_number:, opts: {})
29
+ data, _status_code, _headers = get_checkpoint_by_slug_tracking_number_with_http_info(slug: slug, tracking_number: tracking_number, opts: opts)
30
+ data
31
+ end
32
+
33
+ def get_checkpoint_by_slug_tracking_number_with_http_info(slug:, tracking_number:, opts: {})
34
+ if @api_client.config.debugging
35
+ @api_client.config.logger.debug 'Calling API: LastCheckpointApi.get_checkpoint_by_slug_tracking_number ...'
36
+ end
37
+
38
+ if slug.nil? || (slug.to_s == '')
39
+ raise InvalidParamError.new "slug cannot be nil or empty"
40
+ end
41
+ if tracking_number.nil? || (tracking_number.to_s == '')
42
+ raise InvalidParamError.new "tracking_number cannot be nil or empty"
43
+ end
44
+
45
+
46
+ # resource path
47
+ local_var_path = "/tracking/2024-04/last_checkpoint/#{slug}/#{tracking_number}"
48
+ method = :'GET'
49
+
50
+ # query parameters
51
+ query_params = opts[:query_params] || {}
52
+ query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
53
+ query_params[:'lang'] = opts[:'lang'] if !opts[:'lang'].nil?
54
+ query_params[:'tracking_account_number'] = opts[:'tracking_account_number'] if !opts[:'tracking_account_number'].nil?
55
+ query_params[:'tracking_origin_country'] = opts[:'tracking_origin_country'] if !opts[:'tracking_origin_country'].nil?
56
+ query_params[:'tracking_destination_country'] = opts[:'tracking_destination_country'] if !opts[:'tracking_destination_country'].nil?
57
+ query_params[:'tracking_key'] = opts[:'tracking_key'] if !opts[:'tracking_key'].nil?
58
+ query_params[:'tracking_postal_code'] = opts[:'tracking_postal_code'] if !opts[:'tracking_postal_code'].nil?
59
+ query_params[:'tracking_ship_date'] = opts[:'tracking_ship_date'] if !opts[:'tracking_ship_date'].nil?
60
+ query_params[:'tracking_state'] = opts[:'tracking_state'] if !opts[:'tracking_state'].nil?
61
+ # header parameters
62
+ header_params = opts[:header_params] || {}
63
+
64
+ # http body (model)
65
+ post_body = opts[:body]
66
+
67
+ # return_type
68
+ return_type = 'GetCheckpointBySlugTrackingNumberResponse'
69
+
70
+ new_options = opts.merge(
71
+ :operation => :"LastCheckpointApi.get_checkpoint_by_slug_tracking_number",
72
+ :header_params => header_params,
73
+ :query_params => query_params,
74
+ :body => post_body,
75
+ :return_type => return_type,
76
+ :response_legacy_tag => "",
77
+ :is_paging => false
78
+ )
79
+
80
+ data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
81
+ if @api_client.config.debugging
82
+ @api_client.config.logger.debug "API called: LastCheckpointApi#get_checkpoint_by_slug_tracking_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
83
+ end
84
+ return data, status_code, headers
85
+ end
86
+
87
+ # get_checkpoint_by_tracking_id
88
+ # Return the tracking information of the last checkpoint of a single tracking.
89
+ # @param tracking_id [String] tracking id
90
+ # @param [Hash] opts the optional parameters
91
+ # @option opts [String] :fields List of fields to include in the response. Use comma for multiple values. Fields to include: `slug`, `created_at`, `checkpoint_time`, `city`, `coordinates`, `country_iso3`, `country_name`, `message`, `state`, `tag`, `zip`
92
+ # @option opts [String] :lang Support Chinese to English translation for `china-ems` and `china-post` only
93
+ # @return [Model::GetCheckpointByTrackingIdResponse]
94
+ def get_checkpoint_by_tracking_id(tracking_id:, opts: {})
95
+ data, _status_code, _headers = get_checkpoint_by_tracking_id_with_http_info(tracking_id: tracking_id, opts: opts)
96
+ data
97
+ end
98
+
99
+ def get_checkpoint_by_tracking_id_with_http_info(tracking_id:, opts: {})
100
+ if @api_client.config.debugging
101
+ @api_client.config.logger.debug 'Calling API: LastCheckpointApi.get_checkpoint_by_tracking_id ...'
102
+ end
103
+
104
+ if tracking_id.nil? || (tracking_id.to_s == '')
105
+ raise InvalidParamError.new "tracking_id cannot be nil or empty"
106
+ end
107
+
108
+
109
+ # resource path
110
+ local_var_path = "/tracking/2024-04/last_checkpoint/#{tracking_id}"
111
+ method = :'GET'
112
+
113
+ # query parameters
114
+ query_params = opts[:query_params] || {}
115
+ query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
116
+ query_params[:'lang'] = opts[:'lang'] if !opts[:'lang'].nil?
117
+ # header parameters
118
+ header_params = opts[:header_params] || {}
119
+
120
+ # http body (model)
121
+ post_body = opts[:body]
122
+
123
+ # return_type
124
+ return_type = 'GetCheckpointByTrackingIdResponse'
125
+
126
+ new_options = opts.merge(
127
+ :operation => :"LastCheckpointApi.get_checkpoint_by_tracking_id",
128
+ :header_params => header_params,
129
+ :query_params => query_params,
130
+ :body => post_body,
131
+ :return_type => return_type,
132
+ :response_legacy_tag => "",
133
+ :is_paging => false
134
+ )
135
+
136
+ data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
137
+ if @api_client.config.debugging
138
+ @api_client.config.logger.debug "API called: LastCheckpointApi#get_checkpoint_by_tracking_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
139
+ end
140
+ return data, status_code, headers
141
+ end
142
+ end
143
+ end
@@ -0,0 +1,403 @@
1
+ # This code was auto generated by AfterShip SDK Generator.
2
+ # Do not edit the class manually.
3
+ require 'cgi'
4
+
5
+ module AftershipAPI
6
+ class NotificationApi
7
+ attr_accessor :api_client
8
+
9
+ def initialize(api_client = ApiClient.default)
10
+ @api_client = api_client
11
+ end
12
+
13
+ # add_notification_by_slug_tracking_number
14
+ # Add notification receivers to a tracking number.
15
+ # @param slug [String] Tracking slug
16
+ # @param tracking_number [String] Tracking number
17
+
18
+ # @param body [Model::NotificationRequestV1]
19
+ # @param [Hash] opts the optional parameters
20
+ # @option opts [String] :tracking_account_number Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
21
+ # @option opts [String] :tracking_origin_country Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details.
22
+ # @option opts [String] :tracking_destination_country Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details.
23
+ # @option opts [String] :tracking_key Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
24
+ # @option opts [String] :tracking_postal_code Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
25
+ # @option opts [String] :tracking_ship_date Additional field required by some carriers to retrieve the tracking info. The date the shipment was sent, using the format YYYYMMDD. Refer to our article on for more details.
26
+ # @option opts [String] :tracking_state Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
27
+ # @return [Model::Notification]
28
+ def add_notification_by_slug_tracking_number(slug:, tracking_number:, body:, opts: {})
29
+ if "notification" != ""
30
+ body = { :'notification' => body }
31
+ end
32
+ opts[:body] = body
33
+ data, _status_code, _headers = add_notification_by_slug_tracking_number_with_http_info(slug: slug, tracking_number: tracking_number, opts: opts)
34
+ data
35
+ end
36
+
37
+ def add_notification_by_slug_tracking_number_with_http_info(slug:, tracking_number:, opts: {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: NotificationApi.add_notification_by_slug_tracking_number ...'
40
+ end
41
+
42
+ if slug.nil? || (slug.to_s == '')
43
+ raise InvalidParamError.new "slug cannot be nil or empty"
44
+ end
45
+ if tracking_number.nil? || (tracking_number.to_s == '')
46
+ raise InvalidParamError.new "tracking_number cannot be nil or empty"
47
+ end
48
+
49
+
50
+ # resource path
51
+ local_var_path = "/tracking/2024-04/notifications/#{slug}/#{tracking_number}/add"
52
+ method = :'POST'
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+ query_params[:'tracking_account_number'] = opts[:'tracking_account_number'] if !opts[:'tracking_account_number'].nil?
57
+ query_params[:'tracking_origin_country'] = opts[:'tracking_origin_country'] if !opts[:'tracking_origin_country'].nil?
58
+ query_params[:'tracking_destination_country'] = opts[:'tracking_destination_country'] if !opts[:'tracking_destination_country'].nil?
59
+ query_params[:'tracking_key'] = opts[:'tracking_key'] if !opts[:'tracking_key'].nil?
60
+ query_params[:'tracking_postal_code'] = opts[:'tracking_postal_code'] if !opts[:'tracking_postal_code'].nil?
61
+ query_params[:'tracking_ship_date'] = opts[:'tracking_ship_date'] if !opts[:'tracking_ship_date'].nil?
62
+ query_params[:'tracking_state'] = opts[:'tracking_state'] if !opts[:'tracking_state'].nil?
63
+ # header parameters
64
+ header_params = opts[:header_params] || {}
65
+
66
+ # http body (model)
67
+ post_body = opts[:body]
68
+
69
+ # return_type
70
+ return_type = 'Notification'
71
+
72
+ new_options = opts.merge(
73
+ :operation => :"NotificationApi.add_notification_by_slug_tracking_number",
74
+ :header_params => header_params,
75
+ :query_params => query_params,
76
+ :body => post_body,
77
+ :return_type => return_type,
78
+ :response_legacy_tag => "notification",
79
+ :is_paging => false
80
+ )
81
+
82
+ data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
83
+ if @api_client.config.debugging
84
+ @api_client.config.logger.debug "API called: NotificationApi#add_notification_by_slug_tracking_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
85
+ end
86
+ return data, status_code, headers
87
+ end
88
+
89
+ # add_notification_by_tracking_id
90
+ # Add notification receivers to a tracking number.
91
+ # @param tracking_id [String] tracking id
92
+
93
+ # @param body [Model::NotificationRequestV1]
94
+ # @param [Hash] opts the optional parameters
95
+ # @return [Model::Notification]
96
+ def add_notification_by_tracking_id(tracking_id:, body:, opts: {})
97
+ if "notification" != ""
98
+ body = { :'notification' => body }
99
+ end
100
+ opts[:body] = body
101
+ data, _status_code, _headers = add_notification_by_tracking_id_with_http_info(tracking_id: tracking_id, opts: opts)
102
+ data
103
+ end
104
+
105
+ def add_notification_by_tracking_id_with_http_info(tracking_id:, opts: {})
106
+ if @api_client.config.debugging
107
+ @api_client.config.logger.debug 'Calling API: NotificationApi.add_notification_by_tracking_id ...'
108
+ end
109
+
110
+ if tracking_id.nil? || (tracking_id.to_s == '')
111
+ raise InvalidParamError.new "tracking_id cannot be nil or empty"
112
+ end
113
+
114
+
115
+ # resource path
116
+ local_var_path = "/tracking/2024-04/notifications/#{tracking_id}/add"
117
+ method = :'POST'
118
+
119
+ # query parameters
120
+ query_params = opts[:query_params] || {}
121
+ # header parameters
122
+ header_params = opts[:header_params] || {}
123
+
124
+ # http body (model)
125
+ post_body = opts[:body]
126
+
127
+ # return_type
128
+ return_type = 'Notification'
129
+
130
+ new_options = opts.merge(
131
+ :operation => :"NotificationApi.add_notification_by_tracking_id",
132
+ :header_params => header_params,
133
+ :query_params => query_params,
134
+ :body => post_body,
135
+ :return_type => return_type,
136
+ :response_legacy_tag => "notification",
137
+ :is_paging => false
138
+ )
139
+
140
+ data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
141
+ if @api_client.config.debugging
142
+ @api_client.config.logger.debug "API called: NotificationApi#add_notification_by_tracking_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
143
+ end
144
+ return data, status_code, headers
145
+ end
146
+
147
+ # delete_notification_by_slug_tracking_number
148
+ # Remove notification receivers from a tracking number.
149
+ # @param slug [String] Tracking slug
150
+ # @param tracking_number [String] Tracking number
151
+
152
+ # @param body [Model::NotificationRequestV1]
153
+ # @param [Hash] opts the optional parameters
154
+ # @option opts [String] :tracking_account_number Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
155
+ # @option opts [String] :tracking_origin_country Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details.
156
+ # @option opts [String] :tracking_destination_country Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details.
157
+ # @option opts [String] :tracking_key Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
158
+ # @option opts [String] :tracking_postal_code Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
159
+ # @option opts [String] :tracking_ship_date Additional field required by some carriers to retrieve the tracking info. The date the shipment was sent, using the format YYYYMMDD. Refer to our article on for more details.
160
+ # @option opts [String] :tracking_state Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
161
+ # @return [Model::Notification]
162
+ def delete_notification_by_slug_tracking_number(slug:, tracking_number:, body:, opts: {})
163
+ if "notification" != ""
164
+ body = { :'notification' => body }
165
+ end
166
+ opts[:body] = body
167
+ data, _status_code, _headers = delete_notification_by_slug_tracking_number_with_http_info(slug: slug, tracking_number: tracking_number, opts: opts)
168
+ data
169
+ end
170
+
171
+ def delete_notification_by_slug_tracking_number_with_http_info(slug:, tracking_number:, opts: {})
172
+ if @api_client.config.debugging
173
+ @api_client.config.logger.debug 'Calling API: NotificationApi.delete_notification_by_slug_tracking_number ...'
174
+ end
175
+
176
+ if slug.nil? || (slug.to_s == '')
177
+ raise InvalidParamError.new "slug cannot be nil or empty"
178
+ end
179
+ if tracking_number.nil? || (tracking_number.to_s == '')
180
+ raise InvalidParamError.new "tracking_number cannot be nil or empty"
181
+ end
182
+
183
+
184
+ # resource path
185
+ local_var_path = "/tracking/2024-04/notifications/#{slug}/#{tracking_number}/remove"
186
+ method = :'POST'
187
+
188
+ # query parameters
189
+ query_params = opts[:query_params] || {}
190
+ query_params[:'tracking_account_number'] = opts[:'tracking_account_number'] if !opts[:'tracking_account_number'].nil?
191
+ query_params[:'tracking_origin_country'] = opts[:'tracking_origin_country'] if !opts[:'tracking_origin_country'].nil?
192
+ query_params[:'tracking_destination_country'] = opts[:'tracking_destination_country'] if !opts[:'tracking_destination_country'].nil?
193
+ query_params[:'tracking_key'] = opts[:'tracking_key'] if !opts[:'tracking_key'].nil?
194
+ query_params[:'tracking_postal_code'] = opts[:'tracking_postal_code'] if !opts[:'tracking_postal_code'].nil?
195
+ query_params[:'tracking_ship_date'] = opts[:'tracking_ship_date'] if !opts[:'tracking_ship_date'].nil?
196
+ query_params[:'tracking_state'] = opts[:'tracking_state'] if !opts[:'tracking_state'].nil?
197
+ # header parameters
198
+ header_params = opts[:header_params] || {}
199
+
200
+ # http body (model)
201
+ post_body = opts[:body]
202
+
203
+ # return_type
204
+ return_type = 'Notification'
205
+
206
+ new_options = opts.merge(
207
+ :operation => :"NotificationApi.delete_notification_by_slug_tracking_number",
208
+ :header_params => header_params,
209
+ :query_params => query_params,
210
+ :body => post_body,
211
+ :return_type => return_type,
212
+ :response_legacy_tag => "notification",
213
+ :is_paging => false
214
+ )
215
+
216
+ data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
217
+ if @api_client.config.debugging
218
+ @api_client.config.logger.debug "API called: NotificationApi#delete_notification_by_slug_tracking_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
219
+ end
220
+ return data, status_code, headers
221
+ end
222
+
223
+ # delete_notification_by_tracking_id
224
+ # Remove notification receivers from a tracking number.
225
+ # @param tracking_id [String] tracking id
226
+
227
+ # @param body [Model::NotificationRequestV1]
228
+ # @param [Hash] opts the optional parameters
229
+ # @return [Model::Notification]
230
+ def delete_notification_by_tracking_id(tracking_id:, body:, opts: {})
231
+ if "notification" != ""
232
+ body = { :'notification' => body }
233
+ end
234
+ opts[:body] = body
235
+ data, _status_code, _headers = delete_notification_by_tracking_id_with_http_info(tracking_id: tracking_id, opts: opts)
236
+ data
237
+ end
238
+
239
+ def delete_notification_by_tracking_id_with_http_info(tracking_id:, opts: {})
240
+ if @api_client.config.debugging
241
+ @api_client.config.logger.debug 'Calling API: NotificationApi.delete_notification_by_tracking_id ...'
242
+ end
243
+
244
+ if tracking_id.nil? || (tracking_id.to_s == '')
245
+ raise InvalidParamError.new "tracking_id cannot be nil or empty"
246
+ end
247
+
248
+
249
+ # resource path
250
+ local_var_path = "/tracking/2024-04/notifications/#{tracking_id}/remove"
251
+ method = :'POST'
252
+
253
+ # query parameters
254
+ query_params = opts[:query_params] || {}
255
+ # header parameters
256
+ header_params = opts[:header_params] || {}
257
+
258
+ # http body (model)
259
+ post_body = opts[:body]
260
+
261
+ # return_type
262
+ return_type = 'Notification'
263
+
264
+ new_options = opts.merge(
265
+ :operation => :"NotificationApi.delete_notification_by_tracking_id",
266
+ :header_params => header_params,
267
+ :query_params => query_params,
268
+ :body => post_body,
269
+ :return_type => return_type,
270
+ :response_legacy_tag => "notification",
271
+ :is_paging => false
272
+ )
273
+
274
+ data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
275
+ if @api_client.config.debugging
276
+ @api_client.config.logger.debug "API called: NotificationApi#delete_notification_by_tracking_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
277
+ end
278
+ return data, status_code, headers
279
+ end
280
+
281
+ # get_notification_by_slug_tracking_number
282
+ # Get contact information for the users to notify when the tracking changes. Please note that only customer receivers will be returned. Any `email`, `sms` or `webhook` that belongs to the Store will not be returned.
283
+ # @param slug [String] Tracking slug
284
+ # @param tracking_number [String] Tracking number
285
+ # @param [Hash] opts the optional parameters
286
+ # @option opts [String] :tracking_account_number Additional field required by some carriers to retrieve the tracking info. The shipper’s carrier account number. Refer to our article on for more details.
287
+ # @option opts [String] :tracking_origin_country Additional field required by some carriers to retrieve the tracking info. The origin country/region of the shipment. Refer to our article on for more details.
288
+ # @option opts [String] :tracking_destination_country Additional field required by some carriers to retrieve the tracking info. The destination country/region of the shipment. Refer to our article on for more details.
289
+ # @option opts [String] :tracking_key Additional field required by some carriers to retrieve the tracking info. A type of tracking credential required by some carriers. Refer to our article on for more details.
290
+ # @option opts [String] :tracking_postal_code Additional field required by some carriers to retrieve the tracking info. The postal code of the recipient’s address. Refer to our article on for more details.
291
+ # @option opts [String] :tracking_ship_date Additional field required by some carriers to retrieve the tracking info. The date the shipment was sent, using the format YYYYMMDD. Refer to our article on for more details.
292
+ # @option opts [String] :tracking_state Additional field required by some carriers to retrieve the tracking info. The state/province of the recipient’s address. Refer to our article on for more details.
293
+ # @return [Model::Notification]
294
+ def get_notification_by_slug_tracking_number(slug:, tracking_number:, opts: {})
295
+ data, _status_code, _headers = get_notification_by_slug_tracking_number_with_http_info(slug: slug, tracking_number: tracking_number, opts: opts)
296
+ data
297
+ end
298
+
299
+ def get_notification_by_slug_tracking_number_with_http_info(slug:, tracking_number:, opts: {})
300
+ if @api_client.config.debugging
301
+ @api_client.config.logger.debug 'Calling API: NotificationApi.get_notification_by_slug_tracking_number ...'
302
+ end
303
+
304
+ if slug.nil? || (slug.to_s == '')
305
+ raise InvalidParamError.new "slug cannot be nil or empty"
306
+ end
307
+ if tracking_number.nil? || (tracking_number.to_s == '')
308
+ raise InvalidParamError.new "tracking_number cannot be nil or empty"
309
+ end
310
+
311
+
312
+ # resource path
313
+ local_var_path = "/tracking/2024-04/notifications/#{slug}/#{tracking_number}"
314
+ method = :'GET'
315
+
316
+ # query parameters
317
+ query_params = opts[:query_params] || {}
318
+ query_params[:'tracking_account_number'] = opts[:'tracking_account_number'] if !opts[:'tracking_account_number'].nil?
319
+ query_params[:'tracking_origin_country'] = opts[:'tracking_origin_country'] if !opts[:'tracking_origin_country'].nil?
320
+ query_params[:'tracking_destination_country'] = opts[:'tracking_destination_country'] if !opts[:'tracking_destination_country'].nil?
321
+ query_params[:'tracking_key'] = opts[:'tracking_key'] if !opts[:'tracking_key'].nil?
322
+ query_params[:'tracking_postal_code'] = opts[:'tracking_postal_code'] if !opts[:'tracking_postal_code'].nil?
323
+ query_params[:'tracking_ship_date'] = opts[:'tracking_ship_date'] if !opts[:'tracking_ship_date'].nil?
324
+ query_params[:'tracking_state'] = opts[:'tracking_state'] if !opts[:'tracking_state'].nil?
325
+ # header parameters
326
+ header_params = opts[:header_params] || {}
327
+
328
+ # http body (model)
329
+ post_body = opts[:body]
330
+
331
+ # return_type
332
+ return_type = 'Notification'
333
+
334
+ new_options = opts.merge(
335
+ :operation => :"NotificationApi.get_notification_by_slug_tracking_number",
336
+ :header_params => header_params,
337
+ :query_params => query_params,
338
+ :body => post_body,
339
+ :return_type => return_type,
340
+ :response_legacy_tag => "notification",
341
+ :is_paging => false
342
+ )
343
+
344
+ data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
345
+ if @api_client.config.debugging
346
+ @api_client.config.logger.debug "API called: NotificationApi#get_notification_by_slug_tracking_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
347
+ end
348
+ return data, status_code, headers
349
+ end
350
+
351
+ # get_notification_by_tracking_id
352
+ # Get contact information for the users to notify when the tracking changes. Please note that only customer receivers will be returned. Any `email`, `sms` or `webhook` that belongs to the Store will not be returned.
353
+ # @param tracking_id [String] tracking id
354
+ # @param [Hash] opts the optional parameters
355
+ # @return [Model::Notification]
356
+ def get_notification_by_tracking_id(tracking_id:, opts: {})
357
+ data, _status_code, _headers = get_notification_by_tracking_id_with_http_info(tracking_id: tracking_id, opts: opts)
358
+ data
359
+ end
360
+
361
+ def get_notification_by_tracking_id_with_http_info(tracking_id:, opts: {})
362
+ if @api_client.config.debugging
363
+ @api_client.config.logger.debug 'Calling API: NotificationApi.get_notification_by_tracking_id ...'
364
+ end
365
+
366
+ if tracking_id.nil? || (tracking_id.to_s == '')
367
+ raise InvalidParamError.new "tracking_id cannot be nil or empty"
368
+ end
369
+
370
+
371
+ # resource path
372
+ local_var_path = "/tracking/2024-04/notifications/#{tracking_id}"
373
+ method = :'GET'
374
+
375
+ # query parameters
376
+ query_params = opts[:query_params] || {}
377
+ # header parameters
378
+ header_params = opts[:header_params] || {}
379
+
380
+ # http body (model)
381
+ post_body = opts[:body]
382
+
383
+ # return_type
384
+ return_type = 'Notification'
385
+
386
+ new_options = opts.merge(
387
+ :operation => :"NotificationApi.get_notification_by_tracking_id",
388
+ :header_params => header_params,
389
+ :query_params => query_params,
390
+ :body => post_body,
391
+ :return_type => return_type,
392
+ :response_legacy_tag => "notification",
393
+ :is_paging => false
394
+ )
395
+
396
+ data, status_code, headers = @api_client.call_api(method, local_var_path, new_options)
397
+ if @api_client.config.debugging
398
+ @api_client.config.logger.debug "API called: NotificationApi#get_notification_by_tracking_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
399
+ end
400
+ return data, status_code, headers
401
+ end
402
+ end
403
+ end