From aed9937ceea2463fe8f8c495913ffb6cc7b628a2 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Mon, 26 Oct 2026 00:14:48 +0000 Subject: [PATCH] ## Python SDK Changes: * `shippo.batches.create()`: * `request.batch_shipments[].shipment.extra` **Changed** * `shippo.batches.add_shipments()`: * `request_body[].shipment.extra` **Changed** * `shippo.shipments.list()`: `response.results[].extra` **Changed** * `shippo.shipments.create()`: * `request.extra` **Changed** * `response.extra` **Changed** * `shippo.shipments.get()`: `response.extra` **Changed** * `shippo.transactions.create()`: * `request.union(InstantTransactionCreateRequest).shipment.extra` **Changed** --- .speakeasy/gen.lock | 47 ++++++++------ .speakeasy/gen.yaml | 3 +- .speakeasy/workflow.lock | 12 ++-- RELEASES.md | 12 +++- docs/models/components/healthcarehandling.md | 16 +++++ docs/models/components/shipmentextra.md | 9 ++- pyproject.toml | 2 +- src/shippo/_version.py | 6 +- src/shippo/models/components/__init__.py | 5 ++ .../models/components/healthcarehandling.py | 51 +++++++++++++++ src/shippo/models/components/shipmentextra.py | 65 ++++++++++++++++++- 11 files changed, 192 insertions(+), 36 deletions(-) create mode 100644 docs/models/components/healthcarehandling.md create mode 100644 src/shippo/models/components/healthcarehandling.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 117ebb9c..f53cdaef 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,24 +1,24 @@ lockVersion: 2.0.0 id: 986026b6-d725-4b86-9c4d-67f6e6904a30 management: - docChecksum: 5d62f969066e4f322a951b765a695fa7 + docChecksum: 0fd9342093a376346ad9896937287d27 docVersion: "2018-02-08" - speakeasyVersion: 1.802.0 - generationVersion: 2.948.4 - releaseVersion: 5.0.0-beta.1 - configChecksum: 7a1a5183eea544638e54fc5f5b707bfd + speakeasyVersion: 1.803.2 + generationVersion: 2.950.13 + releaseVersion: 5.0.0-beta.2 + configChecksum: 6f9b1e09f54d081140a0b4c67956f167 repoURL: https://github.com/goshippo/shippo-python-sdk.git installationURL: https://github.com/goshippo/shippo-python-sdk.git published: true persistentEdits: - generation_id: fca6edb0-917c-447b-a3c5-3955748449a7 - pristine_commit_hash: e1601448aaf36249049dfbceac06d21f82bb6be0 - pristine_tree_hash: bf368818b43dcbfd95477f55d02e05c3f77b49ba + generation_id: 3659a3ba-bd59-4b29-899f-d6f29157f4b4 + pristine_commit_hash: f1137277aaa167603391129e51e822a705741f09 + pristine_tree_hash: 2c1b3ed3de5522a9ac83cfb44b7899a9abdbd1e5 features: python: additionalDependencies: 1.1.0 constsAndDefaults: 1.0.8 - core: 6.1.4 + core: 6.1.5 decimal: 1.0.0 defaultEnabledRetries: 0.2.0 enumUnions: 0.1.1 @@ -496,6 +496,10 @@ trackedFiles: id: 9121ff311085 last_write_checksum: sha1:e7de9ea3d8b5eec5635138850490a569eb6cfd00 pristine_git_object: b376103da8462de72f3c26cfbaba5c10bb0aae10 + docs/models/components/healthcarehandling.md: + id: 359d4e86dc81 + last_write_checksum: sha1:42151bbd4109075e1a054c70f2b035c21b438fa5 + pristine_git_object: d1762f85411430a00799b84de61ab35497ace8d3 docs/models/components/instanttransactioncreaterequest.md: id: 5b3f06fccb9b last_write_checksum: sha1:c72f32914d98e765c65acb242523687cd321a5d4 @@ -958,8 +962,8 @@ trackedFiles: pristine_git_object: 758ecb759b953b568da1862fe9f55d3992239098 docs/models/components/shipmentextra.md: id: 33f4b769d22e - last_write_checksum: sha1:4d6ae778a6c7fdc4f82b8c8c977128ed2b9b3c80 - pristine_git_object: 7156a14ddff22776fad235b0f0b190456b0229e5 + last_write_checksum: sha1:c6c2a0692fcaab19ee39803a48bf911258036d16 + pristine_git_object: a8d7875b923e98558fa3b69d5a3dd75b0cbd4bcd docs/models/components/shipmentextralasershipattributesenum.md: id: 197a5833eca9 last_write_checksum: sha1:54dbd51e068156e1d83612d3a58eb503ece544fb @@ -1718,8 +1722,8 @@ trackedFiles: pristine_git_object: 18f8c357a2206431626265d3943f66c4c1aa663f pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:fbd4e3063b0161266f6732e1969d1eb6cf78ec4d - pristine_git_object: 305417722254c972d7bce9abe06f6ef0c6afa237 + last_write_checksum: sha1:ac864e0179186b6260f822bb4504ed0453832135 + pristine_git_object: 1caf5a330165957b079c97f0145f3297598c0992 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:e00374f5f50ebf41cd4fd2e5f3b4e54cc63e354f @@ -1750,8 +1754,8 @@ trackedFiles: pristine_git_object: edfd54a972c6e606a65e31f921020b039c8df698 src/shippo/_version.py: id: b71c1af6ca9d - last_write_checksum: sha1:cbd17c18f852a979542a3d128593ea31dfc315b4 - pristine_git_object: 30c7049ba05e463c2c2b8e0c53e10fa279d2cc2f + last_write_checksum: sha1:666299d52dcdd4f31ac8b5cdff03d4f9c1722509 + pristine_git_object: 4dc9e07966aadd3b2bca9e7b0d7d82944ef95959 src/shippo/addresses.py: id: c011488252c1 last_write_checksum: sha1:590226005e9560bd3afb1ca20f59d20d2bb2bef6 @@ -1798,8 +1802,8 @@ trackedFiles: pristine_git_object: 1a349122673e9dde5e63f86e406a44910b584d13 src/shippo/models/components/__init__.py: id: a77d06773815 - last_write_checksum: sha1:9f2bb7914877f28c8428a2f4ca3b160fb4a3e728 - pristine_git_object: e7348ce5c82fc9b94236ac80dabf30545bccdc64 + last_write_checksum: sha1:f0e5c44ee5dcbd71e625b0c9d5e31c7a2230b8c6 + pristine_git_object: 6d402c89db16bc7ce96f5eae1c52b46ccdbeb47c src/shippo/models/components/address.py: id: 2819a4aea92c last_write_checksum: sha1:5a953f3c96f2a592a5ef2b7209be81697da123fa @@ -2100,6 +2104,10 @@ trackedFiles: id: 0af30fd3b0d8 last_write_checksum: sha1:66883f460083b12329600fda754b5b4d783202c4 pristine_git_object: 057cadef1b04e0e1b3795ec4edcdc61631fe150b + src/shippo/models/components/healthcarehandling.py: + id: 42fdd6feca59 + last_write_checksum: sha1:0170709d8d9dbdeb84deb92544e21de4cc2a426a + pristine_git_object: 3d32d3e5e01b5ed5810ae897e2cd0273d1ba3f11 src/shippo/models/components/instanttransactioncreaterequest.py: id: 7df05b59f2e7 last_write_checksum: sha1:b7841442433cff34435e8a53f61d33f50ab48f0b @@ -2462,8 +2470,8 @@ trackedFiles: pristine_git_object: 48cb178ab1831400090614a0cb8cf2850d400668 src/shippo/models/components/shipmentextra.py: id: 93b556f33c4f - last_write_checksum: sha1:34f8c8858d4ceb0a4a25bfa3db3f9eafbbd8293d - pristine_git_object: a714c33a6fede408afd1c4afc6110d26f1a32a11 + last_write_checksum: sha1:140c613048a8b7fbd58852869dcacff01460c1b2 + pristine_git_object: d21ff58104aac4778050c93b47ce332f21de2d63 src/shippo/models/components/shipmentextralasershipattributesenum.py: id: c6262d85e31b last_write_checksum: sha1:9ce6ca85a4ba524f3ead25b0d6bdb2c5c0ffa957 @@ -3785,6 +3793,7 @@ examples: webhookId: "" examplesVersion: 1.0.2 generatedTests: {} +releaseNotes: "## Python SDK Changes:\n* `shippo.batches.create()`: \n * `request.batch_shipments[].shipment.extra` **Changed**\n* `shippo.batches.add_shipments()`: \n * `request_body[].shipment.extra` **Changed**\n* `shippo.shipments.list()`: `response.results[].extra` **Changed**\n* `shippo.shipments.create()`: \n * `request.extra` **Changed**\n * `response.extra` **Changed**\n* `shippo.shipments.get()`: `response.extra` **Changed**\n* `shippo.transactions.create()`: \n * `request.union(InstantTransactionCreateRequest).shipment.extra` **Changed**\n" generatedFiles: - .gitattributes - .python-version diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index e8cb645e..3501d854 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -15,6 +15,7 @@ generation: sharedErrorComponentsApr2025: false sharedNestedComponentsJan2026: false nameOverrideFeb2026: false + openSingleValueEnumsOct2026: false auth: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false @@ -29,7 +30,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false python: - version: 5.0.0-beta.1 + version: 5.0.0-beta.2 additionalDependencies: dev: httpretty: ==1.1.4 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 98d53ab8..18ce3d63 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.802.0 +speakeasyVersion: 1.803.2 sources: openapi: sourceNamespace: openapi - sourceRevisionDigest: sha256:e6866991375e30494c45383b27eebdf37a2f573583b2d563a60df350d99f3a5e - sourceBlobDigest: sha256:3bf002e8b298df5bdb6edb8f65bdfa17c7d1459f1e3c291d3312ca11ba0e16c0 + sourceRevisionDigest: sha256:263d199a2e572b3005c6d5baf64f8eeb29b1d52a3a02e9c11cdef27297eaa62f + sourceBlobDigest: sha256:807da435112261dee74765bbbaf97259828f38ca56b7a2237ccd3ed4ec2d96f4 tags: - latest - "2018-02-08" @@ -11,10 +11,10 @@ targets: first-target: source: openapi sourceNamespace: openapi - sourceRevisionDigest: sha256:e6866991375e30494c45383b27eebdf37a2f573583b2d563a60df350d99f3a5e - sourceBlobDigest: sha256:3bf002e8b298df5bdb6edb8f65bdfa17c7d1459f1e3c291d3312ca11ba0e16c0 + sourceRevisionDigest: sha256:263d199a2e572b3005c6d5baf64f8eeb29b1d52a3a02e9c11cdef27297eaa62f + sourceBlobDigest: sha256:807da435112261dee74765bbbaf97259828f38ca56b7a2237ccd3ed4ec2d96f4 codeSamplesNamespace: openapi-python-code-samples - codeSamplesRevisionDigest: sha256:0fc6e14906395b10a134648597a0e92b322f7c3bd786dcc2e8cc23644bc83ea8 + codeSamplesRevisionDigest: sha256:a0579ceec56b01011cef804e6b2113bafdee57fe55d3f5f0d708e39405ceb744 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/RELEASES.md b/RELEASES.md index 3f445ff7..7f5a8729 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -408,4 +408,14 @@ Based on: ### Generated - [python v5.0.0-beta.1] . ### Releases -- [PyPI v5.0.0-beta.1] https://pypi.org/project/shippo/5.0.0-beta.1 - . \ No newline at end of file +- [PyPI v5.0.0-beta.1] https://pypi.org/project/shippo/5.0.0-beta.1 - . + +## 2026-10-26 00:13:25 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v5.0.0-beta.2] . +### Releases +- [PyPI v5.0.0-beta.2] https://pypi.org/project/shippo/5.0.0-beta.2 - . \ No newline at end of file diff --git a/docs/models/components/healthcarehandling.md b/docs/models/components/healthcarehandling.md new file mode 100644 index 00000000..d1762f85 --- /dev/null +++ b/docs/models/components/healthcarehandling.md @@ -0,0 +1,16 @@ +# HealthcareHandling + +Requests the carrier's healthcare handling program, where the carrier offers one. The rate returned keeps the carrier's +regular service level token. + +**Carrier-Specific Constraints:** +| Carrier | Constraints | +|:---|:---| +| Purolator | Maps to Health Care+. Domestic Express services only (Express, Express 9AM, Express 10:30AM, Express Evening). Available to Purolator-approved accounts only. | + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to `true` to request the carrier's healthcare handling program for this shipment. | \ No newline at end of file diff --git a/docs/models/components/shipmentextra.md b/docs/models/components/shipmentextra.md index 7156a14d..a8d7875b 100644 --- a/docs/models/components/shipmentextra.md +++ b/docs/models/components/shipmentextra.md @@ -27,11 +27,12 @@ An object holding optional extra services to be requested. | `dangerous_goods` | [Optional[components.DangerousGoodsObject]](../../models/components/dangerousgoodsobject.md) | :heavy_minus_sign: | Container for specifying the presence of dangerous materials. This is specific to USPS, and if any contents
are provided, only certain USPS service levels will be eligible. For more information, see our
[guide on hazardous or dangerous materials shipping](https://docs.goshippo.com/docs/shipments/hazmat/). | | `dangerous_goods_code` | [Optional[components.DangerousGoodsCode]](../../models/components/dangerousgoodscode.md) | :heavy_minus_sign: | Dangerous Goods Code (DHL eCommerce only). See [Category Codes](https://api-legacy.dhlecs.com/docs/v2/appendix.html#dangerous-goods) | | `dealer_order_number` | [Optional[components.UPSReferenceFields]](../../models/components/upsreferencefields.md) | :heavy_minus_sign: | N/A | -| `delivery_instructions` | *Optional[str]* | :heavy_minus_sign: | Specify delivery instructions. Up to 500 characters. (FedEx and OnTrac only). | +| `delivery_instructions` | *Optional[str]* | :heavy_minus_sign: | Specify delivery instructions. Up to 500 characters (Purolator accepts up to 30 characters). (FedEx, OnTrac and Purolator only). | | `dept_number` | [Optional[components.DepartmentNumber]](../../models/components/departmentnumber.md) | :heavy_minus_sign: | Specify the department number field on the label (FedEx and UPS only). | | `dry_ice` | [Optional[components.DryIce]](../../models/components/dryice.md) | :heavy_minus_sign: | Specify that the package contains Dry Ice (FedEx, Veho, and UPS only). | | `fda_product_code` | [Optional[components.UPSReferenceFields]](../../models/components/upsreferencefields.md) | :heavy_minus_sign: | N/A | | `fulfillment_center` | *Optional[str]* | :heavy_minus_sign: | The fulfilment center where the package originates from. | +| `healthcare_handling` | [Optional[components.HealthcareHandling]](../../models/components/healthcarehandling.md) | :heavy_minus_sign: | Requests the carrier's healthcare handling program, where the carrier offers one. The rate returned keeps the carrier's
regular service level token.

**Carrier-Specific Constraints:**
\| Carrier \| Constraints \|
\|:---\|:---\|
\| Purolator \| Maps to Health Care+. Domestic Express services only (Express, Express 9AM, Express 10:30AM, Express Evening). Available to Purolator-approved accounts only. \| | | `insurance` | [Optional[components.Insurance]](../../models/components/insurance.md) | :heavy_minus_sign: | To add 3rd party insurance powered by [XCover](https://docs.goshippo.com/docs/shipments/shippinginsurance/),
specify `amount`, `content`, and `currency`. Alternatively, you can choose carrier provided insurance
by additionally specifying `provider` (UPS, FedEx and OnTrac only).

If you do not want to add insurance
to your shipment, do not set these parameters. | | `invoice_number` | [Optional[components.InvoiceNumber]](../../models/components/invoicenumber.md) | :heavy_minus_sign: | Specify the invoice number field on the label (FedEx and UPS only). | | `is_return` | *Optional[bool]* | :heavy_minus_sign: | This field specifies if it is a scan-based return shipment. See the [Create a return shipment](https://docs.goshippo.com/docs/shipments/returns/) section for more details. | @@ -46,8 +47,10 @@ An object holding optional extra services to be requested. | `production_code` | [Optional[components.UPSReferenceFields]](../../models/components/upsreferencefields.md) | :heavy_minus_sign: | N/A | | `purchase_request_number` | [Optional[components.UPSReferenceFields]](../../models/components/upsreferencefields.md) | :heavy_minus_sign: | N/A | | `qr_code_requested` | *Optional[bool]* | :heavy_minus_sign: | Request a QR code for a given transaction when creating a shipping label (USPS domestic and Evri UK only). | -| `reference_1` | *Optional[str]* | :heavy_minus_sign: | Optional text to be printed on the shipping label if supported by carrier. Up to 50 characters.

**Carrier-Specific Constraints:**
\| Carrier \| Constraints \|
\|:---\|:---\|
\| FedEx \| Max 40 characters (Express services); Max 30 characters (Ground services) \| | -| `reference_2` | *Optional[str]* | :heavy_minus_sign: | Optional text to be printed on the shipping label if supported by carrier. Up to 50 characters. For DHL eCommerce, this field can be used for billing reference.

**Carrier-Specific Constraints:**
\| Carrier \| Constraints \|
\|:---\|:---\|
\| FedEx \| Max 30 characters \| | +| `reference_1` | *Optional[str]* | :heavy_minus_sign: | Optional text to be printed on the shipping label if supported by carrier. Up to 50 characters.

**Carrier-Specific Constraints:**
\| Carrier \| Constraints \|
\|:---\|:---\|
\| FedEx \| Max 40 characters (Express services); Max 30 characters (Ground services) \|
\| Purolator \| Max 25 characters \| | +| `reference_2` | *Optional[str]* | :heavy_minus_sign: | Optional text to be printed on the shipping label if supported by carrier. Up to 50 characters. For DHL eCommerce, this field can be used for billing reference.

**Carrier-Specific Constraints:**
\| Carrier \| Constraints \|
\|:---\|:---\|
\| FedEx \| Max 30 characters \|
\| Purolator \| Max 25 characters \| | +| `reference_3` | *Optional[str]* | :heavy_minus_sign: | Optional text to be printed on the shipping label if supported by carrier. Up to 50 characters.

**Carrier-Specific Constraints:**
\| Carrier \| Constraints \|
\|:---\|:---\|
\| Purolator \| Max 25 characters \| | +| `reference_4` | *Optional[str]* | :heavy_minus_sign: | Optional text to be printed on the shipping label if supported by carrier. Up to 50 characters.

**Carrier-Specific Constraints:**
\| Carrier \| Constraints \|
\|:---\|:---\|
\| Purolator \| Max 25 characters \| | | `request_retail_rates` | *Optional[bool]* | :heavy_minus_sign: | Returns retail rates instead of account-based rates (UPS and FedEx only). | | `return_service_type` | [Optional[components.ReturnServiceType]](../../models/components/returnservicetype.md) | :heavy_minus_sign: | Request additional return option for return shipments (UPS and Lasership only). | | `rma_number` | [Optional[components.RmaNumber]](../../models/components/rmanumber.md) | :heavy_minus_sign: | Specify the RMA number field on the label (FedEx and UPS only). | diff --git a/pyproject.toml b/pyproject.toml index 30541772..1caf5a33 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "shippo" -version = "5.0.0-beta.1" +version = "5.0.0-beta.2" description = "Shipping API Python library (USPS, FedEx, UPS and more)" authors = [{ name = "Shippo" },] readme = "README-PYPI.md" diff --git a/src/shippo/_version.py b/src/shippo/_version.py index 30c7049b..4dc9e079 100644 --- a/src/shippo/_version.py +++ b/src/shippo/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "shippo" -__version__: str = "5.0.0-beta.1" +__version__: str = "5.0.0-beta.2" __openapi_doc_version__: str = "2018-02-08" -__gen_version__: str = "2.948.4" -__user_agent__: str = "speakeasy-sdk/python 5.0.0-beta.1 2.948.4 2018-02-08 shippo" +__gen_version__: str = "2.950.13" +__user_agent__: str = "speakeasy-sdk/python 5.0.0-beta.2 2.950.13 2018-02-08 shippo" try: if __package__ is not None: diff --git a/src/shippo/models/components/__init__.py b/src/shippo/models/components/__init__.py index e7348ce5..6d402c89 100644 --- a/src/shippo/models/components/__init__.py +++ b/src/shippo/models/components/__init__.py @@ -315,6 +315,7 @@ FedExConnectExistingOwnAccountParametersTypedDict, VerificationOption, ) + from .healthcarehandling import HealthcareHandling, HealthcareHandlingTypedDict from .instanttransactioncreaterequest import ( InstantTransactionCreateRequest, InstantTransactionCreateRequestTypedDict, @@ -781,6 +782,8 @@ "EmbeddedAuthorizationTypedDict", "FedExConnectExistingOwnAccountParameters", "FedExConnectExistingOwnAccountParametersTypedDict", + "HealthcareHandling", + "HealthcareHandlingTypedDict", "InstantTransactionCreateRequest", "InstantTransactionCreateRequestTypedDict", "Insurance", @@ -1226,6 +1229,8 @@ "FedExConnectExistingOwnAccountParameters": ".fedexconnectexistingownaccountparameters", "FedExConnectExistingOwnAccountParametersTypedDict": ".fedexconnectexistingownaccountparameters", "VerificationOption": ".fedexconnectexistingownaccountparameters", + "HealthcareHandling": ".healthcarehandling", + "HealthcareHandlingTypedDict": ".healthcarehandling", "InstantTransactionCreateRequest": ".instanttransactioncreaterequest", "InstantTransactionCreateRequestTypedDict": ".instanttransactioncreaterequest", "LabelFileType": ".instanttransactioncreaterequest", diff --git a/src/shippo/models/components/healthcarehandling.py b/src/shippo/models/components/healthcarehandling.py new file mode 100644 index 00000000..3d32d3e5 --- /dev/null +++ b/src/shippo/models/components/healthcarehandling.py @@ -0,0 +1,51 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from pydantic import model_serializer +from shippo.types import BaseModel, UNSET_SENTINEL +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class HealthcareHandlingTypedDict(TypedDict): + r"""Requests the carrier's healthcare handling program, where the carrier offers one. The rate returned keeps the carrier's + regular service level token. + + **Carrier-Specific Constraints:** + | Carrier | Constraints | + |:---|:---| + | Purolator | Maps to Health Care+. Domestic Express services only (Express, Express 9AM, Express 10:30AM, Express Evening). Available to Purolator-approved accounts only. | + """ + + enabled: NotRequired[bool] + r"""Set to `true` to request the carrier's healthcare handling program for this shipment.""" + + +class HealthcareHandling(BaseModel): + r"""Requests the carrier's healthcare handling program, where the carrier offers one. The rate returned keeps the carrier's + regular service level token. + + **Carrier-Specific Constraints:** + | Carrier | Constraints | + |:---|:---| + | Purolator | Maps to Health Care+. Domestic Express services only (Express, Express 9AM, Express 10:30AM, Express Evening). Available to Purolator-approved accounts only. | + """ + + enabled: Optional[bool] = None + r"""Set to `true` to request the carrier's healthcare handling program for this shipment.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["enabled"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/shippo/models/components/shipmentextra.py b/src/shippo/models/components/shipmentextra.py index a714c33a..d21ff581 100644 --- a/src/shippo/models/components/shipmentextra.py +++ b/src/shippo/models/components/shipmentextra.py @@ -8,6 +8,7 @@ from .dangerousgoodsobject import DangerousGoodsObject, DangerousGoodsObjectTypedDict from .departmentnumber import DepartmentNumber, DepartmentNumberTypedDict from .dryice import DryIce, DryIceTypedDict +from .healthcarehandling import HealthcareHandling, HealthcareHandlingTypedDict from .insurance import Insurance, InsuranceTypedDict from .invoicenumber import InvoiceNumber, InvoiceNumberTypedDict from .ponumber import PoNumber, PoNumberTypedDict @@ -137,7 +138,7 @@ class ShipmentExtraTypedDict(TypedDict): r"""Dangerous Goods Code (DHL eCommerce only). See [Category Codes](https://api-legacy.dhlecs.com/docs/v2/appendix.html#dangerous-goods)""" dealer_order_number: NotRequired[UPSReferenceFieldsTypedDict] delivery_instructions: NotRequired[str] - r"""Specify delivery instructions. Up to 500 characters. (FedEx and OnTrac only).""" + r"""Specify delivery instructions. Up to 500 characters (Purolator accepts up to 30 characters). (FedEx, OnTrac and Purolator only).""" dept_number: NotRequired[DepartmentNumberTypedDict] r"""Specify the department number field on the label (FedEx and UPS only).""" dry_ice: NotRequired[DryIceTypedDict] @@ -145,6 +146,15 @@ class ShipmentExtraTypedDict(TypedDict): fda_product_code: NotRequired[UPSReferenceFieldsTypedDict] fulfillment_center: NotRequired[str] r"""The fulfilment center where the package originates from.""" + healthcare_handling: NotRequired[HealthcareHandlingTypedDict] + r"""Requests the carrier's healthcare handling program, where the carrier offers one. The rate returned keeps the carrier's + regular service level token. + + **Carrier-Specific Constraints:** + | Carrier | Constraints | + |:---|:---| + | Purolator | Maps to Health Care+. Domestic Express services only (Express, Express 9AM, Express 10:30AM, Express Evening). Available to Purolator-approved accounts only. | + """ insurance: NotRequired[InsuranceTypedDict] r"""To add 3rd party insurance powered by [XCover](https://docs.goshippo.com/docs/shipments/shippinginsurance/), specify `amount`, `content`, and `currency`. Alternatively, you can choose carrier provided insurance @@ -181,6 +191,7 @@ class ShipmentExtraTypedDict(TypedDict): | Carrier | Constraints | |:---|:---| | FedEx | Max 40 characters (Express services); Max 30 characters (Ground services) | + | Purolator | Max 25 characters | """ reference_2: NotRequired[str] r"""Optional text to be printed on the shipping label if supported by carrier. Up to 50 characters. For DHL eCommerce, this field can be used for billing reference. @@ -189,6 +200,23 @@ class ShipmentExtraTypedDict(TypedDict): | Carrier | Constraints | |:---|:---| | FedEx | Max 30 characters | + | Purolator | Max 25 characters | + """ + reference_3: NotRequired[str] + r"""Optional text to be printed on the shipping label if supported by carrier. Up to 50 characters. + + **Carrier-Specific Constraints:** + | Carrier | Constraints | + |:---|:---| + | Purolator | Max 25 characters | + """ + reference_4: NotRequired[str] + r"""Optional text to be printed on the shipping label if supported by carrier. Up to 50 characters. + + **Carrier-Specific Constraints:** + | Carrier | Constraints | + |:---|:---| + | Purolator | Max 25 characters | """ request_retail_rates: NotRequired[bool] r"""Returns retail rates instead of account-based rates (UPS and FedEx only).""" @@ -286,7 +314,7 @@ class ShipmentExtra(BaseModel): dealer_order_number: Optional[UPSReferenceFields] = None delivery_instructions: Optional[str] = None - r"""Specify delivery instructions. Up to 500 characters. (FedEx and OnTrac only).""" + r"""Specify delivery instructions. Up to 500 characters (Purolator accepts up to 30 characters). (FedEx, OnTrac and Purolator only).""" dept_number: Optional[DepartmentNumber] = None r"""Specify the department number field on the label (FedEx and UPS only).""" @@ -299,6 +327,16 @@ class ShipmentExtra(BaseModel): fulfillment_center: Optional[str] = None r"""The fulfilment center where the package originates from.""" + healthcare_handling: Optional[HealthcareHandling] = None + r"""Requests the carrier's healthcare handling program, where the carrier offers one. The rate returned keeps the carrier's + regular service level token. + + **Carrier-Specific Constraints:** + | Carrier | Constraints | + |:---|:---| + | Purolator | Maps to Health Care+. Domestic Express services only (Express, Express 9AM, Express 10:30AM, Express Evening). Available to Purolator-approved accounts only. | + """ + insurance: Optional[Insurance] = None r"""To add 3rd party insurance powered by [XCover](https://docs.goshippo.com/docs/shipments/shippinginsurance/), specify `amount`, `content`, and `currency`. Alternatively, you can choose carrier provided insurance @@ -349,6 +387,7 @@ class ShipmentExtra(BaseModel): | Carrier | Constraints | |:---|:---| | FedEx | Max 40 characters (Express services); Max 30 characters (Ground services) | + | Purolator | Max 25 characters | """ reference_2: Optional[str] = None @@ -358,6 +397,25 @@ class ShipmentExtra(BaseModel): | Carrier | Constraints | |:---|:---| | FedEx | Max 30 characters | + | Purolator | Max 25 characters | + """ + + reference_3: Optional[str] = None + r"""Optional text to be printed on the shipping label if supported by carrier. Up to 50 characters. + + **Carrier-Specific Constraints:** + | Carrier | Constraints | + |:---|:---| + | Purolator | Max 25 characters | + """ + + reference_4: Optional[str] = None + r"""Optional text to be printed on the shipping label if supported by carrier. Up to 50 characters. + + **Carrier-Specific Constraints:** + | Carrier | Constraints | + |:---|:---| + | Purolator | Max 25 characters | """ request_retail_rates: Optional[bool] = None @@ -426,6 +484,7 @@ def serialize_model(self, handler): "dry_ice", "fda_product_code", "fulfillment_center", + "healthcare_handling", "insurance", "invoice_number", "is_return", @@ -442,6 +501,8 @@ def serialize_model(self, handler): "qr_code_requested", "reference_1", "reference_2", + "reference_3", + "reference_4", "request_retail_rates", "return_service_type", "rma_number",