Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.0.2"
".": "2.0.3"
}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 2.0.3 (2025-12-09)

Full Changelog: [v2.0.2...v2.0.3](https://github.com/postgrid/postgrid-python/compare/v2.0.2...v2.0.3)

### Bug Fixes

* **types:** allow pyright to infer TypedDict types within SequenceNotStr ([da4eda9](https://github.com/postgrid/postgrid-python/commit/da4eda9cfa2f8713841e9668e01efc7e2e09a420))


### Chores

* add missing docstrings ([3b3c572](https://github.com/postgrid/postgrid-python/commit/3b3c5722c15adddc6b388b05007cbc277559dc33))

## 2.0.2 (2025-12-03)

Full Changelog: [v2.0.1...v2.0.2](https://github.com/postgrid/postgrid-python/compare/v2.0.1...v2.0.2)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "postgrid-python"
version = "2.0.2"
version = "2.0.3"
description = "The official Python library for the PostGrid API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
5 changes: 3 additions & 2 deletions src/postgrid/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ class HttpxSendArgs(TypedDict, total=False):
if TYPE_CHECKING:
# This works because str.__contains__ does not accept object (either in typeshed or at runtime)
# https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285
#
# Note: index() and count() methods are intentionally omitted to allow pyright to properly
# infer TypedDict types when dict literals are used in lists assigned to SequenceNotStr.
class SequenceNotStr(Protocol[_T_co]):
@overload
def __getitem__(self, index: SupportsIndex, /) -> _T_co: ...
Expand All @@ -251,8 +254,6 @@ def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ...
def __contains__(self, value: object, /) -> bool: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[_T_co]: ...
def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ...
def count(self, value: Any, /) -> int: ...
def __reversed__(self) -> Iterator[_T_co]: ...
else:
# just point this to a normal `Sequence` at runtime to avoid having to special case
Expand Down
2 changes: 1 addition & 1 deletion src/postgrid/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "postgrid"
__version__ = "2.0.2" # x-release-please-version
__version__ = "2.0.3" # x-release-please-version
14 changes: 14 additions & 0 deletions src/postgrid/types/address_verification_verify_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@


class DataDetails(BaseModel):
"""
If you supply `includeDetails=true` as a query parameter, we will also populate an additional `details` field that follows the [Address Details](https://avdocs.postgrid.com/#address-details) schema.
"""

box_id: Optional[str] = FieldInfo(alias="boxID", default=None)
"""PO Box ID"""

Expand Down Expand Up @@ -158,12 +162,22 @@ class DataDetails(BaseModel):


class DataGeocodeResultLocation(BaseModel):
"""Object that contains `lat`, `lng` properties with number values"""

lat: float

lng: float


class DataGeocodeResult(BaseModel):
"""
If the `geocode=true` query parameter is supplied, the response will include a geocodeResult
which follows the [Geocoding](https://avdocs.postgrid.com/#geocoding) schema. You can request
this feature be enabled by emailing `support@postgrid.com`. This includes our verification, batch
verification, suggestions, and POST /completions endpoint. Note that you must supply country when
geocoding to get the result successfully.
"""

accuracy: float
"""
A real number from 0.00 to 1.00 which represents an
Expand Down
2 changes: 2 additions & 0 deletions src/postgrid/types/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@


class Errors(BaseModel):
"""Errors encountered during address verification."""

city: Optional[List[str]] = None
"""Errors related to the city."""

Expand Down
10 changes: 10 additions & 0 deletions src/postgrid/types/intl_address_verification_verify_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@


class DataDetails(BaseModel):
"""
Additional details about the verified address, such as premise, thoroughfare, and locality.
"""

building: Optional[str] = None
"""The building name or number."""

Expand Down Expand Up @@ -114,6 +118,8 @@ class DataDetails(BaseModel):


class DataGeoData(BaseModel):
"""Geocoding result for the verified address."""

geo_accuracy: Optional[str] = FieldInfo(alias="geoAccuracy", default=None)
"""The geocode accuracy."""

Expand All @@ -125,6 +131,8 @@ class DataGeoData(BaseModel):


class DataSummary(BaseModel):
"""A summary of the verification process and match levels."""

context_identification_match_level: Optional[str] = FieldInfo(alias="contextIdentificationMatchLevel", default=None)
"""Context identification match level."""

Expand Down Expand Up @@ -158,6 +166,8 @@ class DataSummary(BaseModel):


class Data(BaseModel):
"""The result of a verified international address."""

city: str
"""The city or locality."""

Expand Down
2 changes: 2 additions & 0 deletions src/postgrid/types/print_mail/attached_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@


class AttachedPdf(BaseModel):
"""Model representing an attached PDF."""

file: str
"""The file (multipart form upload) or URL pointing to a PDF for the attached PDF."""

Expand Down
2 changes: 2 additions & 0 deletions src/postgrid/types/print_mail/attached_pdf_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@


class AttachedPdfParam(TypedDict, total=False):
"""Model representing an attached PDF."""

file: Required[str]
"""The file (multipart form upload) or URL pointing to a PDF for the attached PDF."""

Expand Down
4 changes: 4 additions & 0 deletions src/postgrid/types/print_mail/campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@


class Error(BaseModel):
"""Details of a specific error encountered during campaign processing."""

message: str
"""A human-readable message describing the error."""

Expand All @@ -20,6 +22,8 @@ class Error(BaseModel):


class Campaign(BaseModel):
"""Represents a bulk mail campaign."""

id: str
"""A unique ID prefixed with campaign\\__"""

Expand Down
5 changes: 5 additions & 0 deletions src/postgrid/types/print_mail/cheque.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@


class Cancellation(BaseModel):
"""The cancellation details of this order.

Populated if the order has been cancelled.
"""

reason: Literal["user_initiated", "invalid_content", "invalid_order_mailing_class"]
"""The reason for the cancellation."""

Expand Down
2 changes: 2 additions & 0 deletions src/postgrid/types/print_mail/deleted_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@


class DeletedResponse(BaseModel):
"""Generic response for delete operations."""

id: str
"""The ID of the deleted resource."""

Expand Down
2 changes: 2 additions & 0 deletions src/postgrid/types/print_mail/email_preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@


class EmailPreferences(BaseModel):
"""A set of preferences for how a user should receive emails."""

order_preview_send_preference: Optional[Literal["do_not_send", "send_live_only", "send_live_and_test"]] = FieldInfo(
alias="orderPreviewSendPreference", default=None
)
Expand Down
5 changes: 5 additions & 0 deletions src/postgrid/types/print_mail/letter.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@


class Cancellation(BaseModel):
"""The cancellation details of this order.

Populated if the order has been cancelled.
"""

reason: Literal["user_initiated", "invalid_content", "invalid_order_mailing_class"]
"""The reason for the cancellation."""

Expand Down
4 changes: 4 additions & 0 deletions src/postgrid/types/print_mail/mailing_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@


class Error(BaseModel):
"""Details of a specific error encountered during processing."""

message: str
"""A human-readable message describing the error."""

Expand All @@ -22,6 +24,8 @@ class Error(BaseModel):


class MailingList(BaseModel):
"""Represents a mailing list."""

id: str
"""A unique ID prefixed with mailing*list*"""

Expand Down
8 changes: 8 additions & 0 deletions src/postgrid/types/print_mail/mailing_list_import_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@


class Error(BaseModel):
"""Details of a specific error encountered during import processing."""

message: str
"""A human-readable message describing the error."""

Expand All @@ -24,6 +26,8 @@ class Error(BaseModel):


class File(BaseModel):
"""The file object your controller returns: all the mappings plus a signed URL."""

file_type: FileType = FieldInfo(alias="fileType")
"""Type of file supported for mailing list imports."""

Expand Down Expand Up @@ -65,6 +69,8 @@ class File(BaseModel):


class Note(BaseModel):
"""Details about a note in the import process."""

message: str
"""A human-readable message describing the note."""

Expand All @@ -73,6 +79,8 @@ class Note(BaseModel):


class MailingListImportResponse(BaseModel):
"""Read-only view of a MailingListImport"""

id: str
"""A unique ID prefixed with mailing*list_import*"""

Expand Down
2 changes: 2 additions & 0 deletions src/postgrid/types/print_mail/mailing_list_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@


class MailingListUpdate(BaseModel):
"""Parameters for updating an existing mailing list."""

description: Optional[str] = None
"""An optional string describing this resource.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@


class SelfMailerProfile(BaseModel):
"""Represents a Self-Mailer Profile resource."""

id: str
"""Unique identifier for the order profile."""

Expand Down
6 changes: 6 additions & 0 deletions src/postgrid/types/print_mail/plastic_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@


class DoubleSided(BaseModel):
"""Model representing a double-sided plastic card."""

back_html: Optional[str] = FieldInfo(alias="backHTML", default=None)
"""The HTML content for the back side of the double-sided plastic card."""

Expand All @@ -31,6 +33,8 @@ class DoubleSided(BaseModel):


class SingleSided(BaseModel):
"""Model representing a single-sided plastic card."""

html: Optional[str] = None
"""The HTML content for the single-sided plastic card.

Expand All @@ -48,6 +52,8 @@ class SingleSided(BaseModel):


class PlasticCard(BaseModel):
"""Model representing a plastic card."""

size: Literal["standard"]
"""Enum representing the size of the plastic card."""

Expand Down
6 changes: 6 additions & 0 deletions src/postgrid/types/print_mail/plastic_card_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@


class DoubleSided(TypedDict, total=False):
"""Model representing a double-sided plastic card."""

back_html: Annotated[str, PropertyInfo(alias="backHTML")]
"""The HTML content for the back side of the double-sided plastic card."""

Expand All @@ -30,6 +32,8 @@ class DoubleSided(TypedDict, total=False):


class SingleSided(TypedDict, total=False):
"""Model representing a single-sided plastic card."""

html: str
"""The HTML content for the single-sided plastic card.

Expand All @@ -47,6 +51,8 @@ class SingleSided(TypedDict, total=False):


class PlasticCardParam(TypedDict, total=False):
"""Model representing a plastic card."""

size: Required[Literal["standard"]]
"""Enum representing the size of the plastic card."""

Expand Down
5 changes: 5 additions & 0 deletions src/postgrid/types/print_mail/postcard.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@


class Cancellation(BaseModel):
"""The cancellation details of this order.

Populated if the order has been cancelled.
"""

reason: Literal["user_initiated", "invalid_content", "invalid_order_mailing_class"]
"""The reason for the cancellation."""

Expand Down
2 changes: 2 additions & 0 deletions src/postgrid/types/print_mail/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@


class Report(BaseModel):
"""Represents a saved Report definition."""

id: str
"""Unique identifier for the report."""

Expand Down
4 changes: 4 additions & 0 deletions src/postgrid/types/print_mail/reports/report_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@


class Report(BaseModel):
"""Details of the report this export was generated from."""

id: str
"""The ID of the report."""

Expand All @@ -20,6 +22,8 @@ class Report(BaseModel):


class ReportExport(BaseModel):
"""Represents a report export job and its results."""

id: str
"""Unique identifier for the report export."""

Expand Down
2 changes: 2 additions & 0 deletions src/postgrid/types/print_mail/reports/report_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@


class ReportSample(BaseModel):
"""Represents the result of a report sample query."""

id: str
"""Unique identifier for the sample query result."""

Expand Down
Loading
Loading