Skip to content

Commit a3f6cec

Browse files
committed
feat: updated template
1 parent 417e207 commit a3f6cec

File tree

8 files changed

+248
-308
lines changed

8 files changed

+248
-308
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test:
99
record:
1010
poetry run pytest tests/ --vcr-record=new_episodes
1111

12-
lint:
12+
format:
1313
poetry run ruff check --fix
1414
poetry run ruff format
1515

poetry.lock

Lines changed: 180 additions & 180 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pydantic = ">=2"
3131
httpx = ">=0.27.0"
3232
retrying = "^1.3.4"
3333
typing_extensions = ">=4.7.1"
34-
urllib3 = ">=1.25.3"
34+
urllib3 = "^2.2.2"
3535
socksio = "^1.0.0"
3636

3737
[tool.poetry.group.dev.dependencies]

tracking/api/courier.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@ def detect_courier(
2525
) -> DetectCourierResponse:
2626
"""
2727
Return a list of matched couriers based on tracking number format and or a list of couriers.
28-
2928
:param detect_courier_request:
3029
:param kwargs:
31-
32-
3330
request options:
3431
**headers** (dict): support custom headers.
3532
**verify** bool|str|SSLContext: SSL certificates (a.k.a CA bundle) used to
@@ -51,10 +48,7 @@ def detect_courier(
5148
def get_all_couriers(self, **kwargs) -> GetAllCouriersResponse:
5249
"""
5350
Return a list of all couriers.
54-
5551
:param kwargs:
56-
57-
5852
request options:
5953
**headers** (dict): support custom headers.
6054
**verify** bool|str|SSLContext: SSL certificates (a.k.a CA bundle) used to
@@ -71,10 +65,7 @@ def get_all_couriers(self, **kwargs) -> GetAllCouriersResponse:
7165
def get_user_couriers(self, **kwargs) -> GetUserCouriersResponse:
7266
"""
7367
Return a list of .
74-
7568
:param kwargs:
76-
77-
7869
request options:
7970
**headers** (dict): support custom headers.
8071
**verify** bool|str|SSLContext: SSL certificates (a.k.a CA bundle) used to

tracking/api/estimated_delivery_date.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,8 @@ def predict_batch(
2323
) -> PredictBatchResponse:
2424
"""
2525
> The estimated delivery date is provided by AfterShip, based on its AI-predictive model. You can display the EDD on the product page, cart, and order checkout page. It indicates when a customer will receive the order.You can use to activate this feature.Supported functionalities require:1. One `EstimatedDeliveryDate` object for one prediction result.2. Maximum 5 `EstimatedDeliveryDate` objects are allowed.3. API call will fail if any of the requests `EstimatedDeliveryDate` objects do not meet the specification requirement.
26-
2726
:param predict_batch_request:
2827
:param kwargs:
29-
30-
3128
request options:
3229
**headers** (dict): support custom headers.
3330
**verify** bool|str|SSLContext: SSL certificates (a.k.a CA bundle) used to

tracking/api/last_checkpoint.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,15 @@ def get_checkpoint_by_slug_tracking_number(
2626
) -> GetCheckpointBySlugTrackingNumberResponse:
2727
"""
2828
Return the tracking information of the last checkpoint of a single tracking.
29-
3029
:param slug: str. Tracking slug.
3130
:param tracking_number: str. Tracking number.
3231
:param kwargs:
32+
request options:
33+
**headers** (dict): support custom headers.
34+
**verify** bool|str|SSLContext: SSL certificates (a.k.a CA bundle) used to
35+
verify the identity of requested hosts. Either `True` (default CA bundle),
36+
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
37+
(which will disable verification).
3338
query params:
3439
**fields**: str. 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`
3540
**lang**: str. Support Chinese to English translation for `china-ems` and `china-post` only
@@ -40,13 +45,6 @@ def get_checkpoint_by_slug_tracking_number(
4045
**tracking_postal_code**: str. 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.
4146
**tracking_ship_date**: str. 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.
4247
**tracking_state**: str. 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.
43-
44-
request options:
45-
**headers** (dict): support custom headers.
46-
**verify** bool|str|SSLContext: SSL certificates (a.k.a CA bundle) used to
47-
verify the identity of requested hosts. Either `True` (default CA bundle),
48-
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
49-
(which will disable verification).
5048
"""
5149
url = f"/tracking/2024-04/last_checkpoint/{slug}/{tracking_number}"
5250
params_keys = {
@@ -71,19 +69,17 @@ def get_checkpoint_by_tracking_id(
7169
) -> GetCheckpointByTrackingIdResponse:
7270
"""
7371
Return the tracking information of the last checkpoint of a single tracking.
74-
7572
:param tracking_id: str. tracking id.
7673
:param kwargs:
77-
query params:
78-
**fields**: str. 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`
79-
**lang**: str. Support Chinese to English translation for `china-ems` and `china-post` only
80-
8174
request options:
8275
**headers** (dict): support custom headers.
8376
**verify** bool|str|SSLContext: SSL certificates (a.k.a CA bundle) used to
8477
verify the identity of requested hosts. Either `True` (default CA bundle),
8578
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
8679
(which will disable verification).
80+
query params:
81+
**fields**: str. 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`
82+
**lang**: str. Support Chinese to English translation for `china-ems` and `china-post` only
8783
"""
8884
url = f"/tracking/2024-04/last_checkpoint/{tracking_id}"
8985
params_keys = {

tracking/api/notification.py

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,16 @@ def add_notification_by_slug_tracking_number(
2828
) -> Notification:
2929
"""
3030
Add notification receivers to a tracking number.
31-
3231
:param slug: str. Tracking slug.
3332
:param tracking_number: str. Tracking number.
3433
:param add_notification_by_slug_tracking_number_request:
3534
:param kwargs:
35+
request options:
36+
**headers** (dict): support custom headers.
37+
**verify** bool|str|SSLContext: SSL certificates (a.k.a CA bundle) used to
38+
verify the identity of requested hosts. Either `True` (default CA bundle),
39+
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
40+
(which will disable verification).
3641
query params:
3742
**tracking_account_number**: str. 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.
3843
**tracking_origin_country**: str. 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.
@@ -41,13 +46,6 @@ def add_notification_by_slug_tracking_number(
4146
**tracking_postal_code**: str. 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.
4247
**tracking_ship_date**: str. 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.
4348
**tracking_state**: str. 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.
44-
45-
request options:
46-
**headers** (dict): support custom headers.
47-
**verify** bool|str|SSLContext: SSL certificates (a.k.a CA bundle) used to
48-
verify the identity of requested hosts. Either `True` (default CA bundle),
49-
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
50-
(which will disable verification).
5149
"""
5250
url = f"/tracking/2024-04/notifications/{slug}/{tracking_number}/add"
5351
params_keys = {
@@ -78,12 +76,9 @@ def add_notification_by_tracking_id(
7876
) -> Notification:
7977
"""
8078
Add notification receivers to a tracking number.
81-
8279
:param tracking_id: str. tracking id.
8380
:param add_notification_by_tracking_id_request:
8481
:param kwargs:
85-
86-
8782
request options:
8883
**headers** (dict): support custom headers.
8984
**verify** bool|str|SSLContext: SSL certificates (a.k.a CA bundle) used to
@@ -111,11 +106,16 @@ def delete_notification_by_slug_tracking_number(
111106
) -> Notification:
112107
"""
113108
Remove notification receivers from a tracking number.
114-
115109
:param slug: str. Tracking slug.
116110
:param tracking_number: str. Tracking number.
117111
:param delete_notification_by_slug_tracking_number_request:
118112
:param kwargs:
113+
request options:
114+
**headers** (dict): support custom headers.
115+
**verify** bool|str|SSLContext: SSL certificates (a.k.a CA bundle) used to
116+
verify the identity of requested hosts. Either `True` (default CA bundle),
117+
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
118+
(which will disable verification).
119119
query params:
120120
**tracking_account_number**: str. 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.
121121
**tracking_origin_country**: str. 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.
@@ -124,13 +124,6 @@ def delete_notification_by_slug_tracking_number(
124124
**tracking_postal_code**: str. 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.
125125
**tracking_ship_date**: str. 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.
126126
**tracking_state**: str. 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.
127-
128-
request options:
129-
**headers** (dict): support custom headers.
130-
**verify** bool|str|SSLContext: SSL certificates (a.k.a CA bundle) used to
131-
verify the identity of requested hosts. Either `True` (default CA bundle),
132-
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
133-
(which will disable verification).
134127
"""
135128
url = f"/tracking/2024-04/notifications/{slug}/{tracking_number}/remove"
136129
params_keys = {
@@ -161,12 +154,9 @@ def delete_notification_by_tracking_id(
161154
) -> Notification:
162155
"""
163156
Remove notification receivers from a tracking number.
164-
165157
:param tracking_id: str. tracking id.
166158
:param delete_notification_by_tracking_id_request:
167159
:param kwargs:
168-
169-
170160
request options:
171161
**headers** (dict): support custom headers.
172162
**verify** bool|str|SSLContext: SSL certificates (a.k.a CA bundle) used to
@@ -193,10 +183,15 @@ def get_notification_by_slug_tracking_number(
193183
) -> Notification:
194184
"""
195185
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.
196-
197186
:param slug: str. Tracking slug.
198187
:param tracking_number: str. Tracking number.
199188
:param kwargs:
189+
request options:
190+
**headers** (dict): support custom headers.
191+
**verify** bool|str|SSLContext: SSL certificates (a.k.a CA bundle) used to
192+
verify the identity of requested hosts. Either `True` (default CA bundle),
193+
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
194+
(which will disable verification).
200195
query params:
201196
**tracking_account_number**: str. 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.
202197
**tracking_origin_country**: str. 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.
@@ -205,13 +200,6 @@ def get_notification_by_slug_tracking_number(
205200
**tracking_postal_code**: str. 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.
206201
**tracking_ship_date**: str. 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.
207202
**tracking_state**: str. 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.
208-
209-
request options:
210-
**headers** (dict): support custom headers.
211-
**verify** bool|str|SSLContext: SSL certificates (a.k.a CA bundle) used to
212-
verify the identity of requested hosts. Either `True` (default CA bundle),
213-
a path to an SSL certificate file, an `ssl.SSLContext`, or `False`
214-
(which will disable verification).
215203
"""
216204
url = f"/tracking/2024-04/notifications/{slug}/{tracking_number}"
217205
params_keys = {
@@ -234,11 +222,8 @@ def get_notification_by_tracking_id(
234222
) -> Notification:
235223
"""
236224
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.
237-
238225
:param tracking_id: str. tracking id.
239226
:param kwargs:
240-
241-
242227
request options:
243228
**headers** (dict): support custom headers.
244229
**verify** bool|str|SSLContext: SSL certificates (a.k.a CA bundle) used to

0 commit comments

Comments
 (0)