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
42 changes: 21 additions & 21 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
lockVersion: 2.0.0
id: 833c6a67-4a4a-4ef1-ba24-165a29264e4a
management:
docChecksum: dca172a64bab9d8db3907b30e1df441f
docChecksum: 2a26230ef2758d573fe9e26f3a64e0b0
docVersion: 1.0.0
speakeasyVersion: 1.788.1
generationVersion: 2.915.1
releaseVersion: 2.2.5
configChecksum: 333346afca9c6e1b36cee1fbd7e74ccb
speakeasyVersion: 1.789.0
generationVersion: 2.916.2
releaseVersion: 2.2.6
configChecksum: ce9641fbce24c923629c9f6bfb8fe333
repoURL: https://github.com/gr4vy/gr4vy-python.git
installationURL: https://github.com/gr4vy/gr4vy-python.git
published: true
persistentEdits:
generation_id: d82579a6-3f05-4e66-b3ab-f9e805c7dfa1
pristine_commit_hash: c16346574dd9efb1a436c684d460528f841adbe2
pristine_tree_hash: 5445921abaab7c4748276cdb3d51dbc749a06c7a
generation_id: f2b85832-83ad-4268-a63a-c90593315d49
pristine_commit_hash: c3ade3572cd196a7fc473cfcaaac220a9a460567
pristine_tree_hash: 2a6ef85e3ed4f39a412be40a71a89b9e7981534f
features:
python:
additionalDependencies: 1.1.0
Expand Down Expand Up @@ -2332,8 +2332,8 @@ trackedFiles:
pristine_git_object: ba5bdbe0f9da0b74f7a43c0ed0ac74a8f1018d0b
docs/models/transactioncapture.md:
id: a312ba94b896
last_write_checksum: sha1:7db29f65df6eb35da130b33b5ee5ca6e22bd57ba
pristine_git_object: 487f97f14ae5fda17a588a6faf7ca52d6a31a3c3
last_write_checksum: sha1:527279587d9a7f8e35f8de255b7c1b35f3e0fcd9
pristine_git_object: 38aedb2be6b98c9b841b829cdc113ec6a906774c
docs/models/transactioncapturecreate.md:
id: ea1f508b22d1
last_write_checksum: sha1:7909f5d811d15880e17f876da8c8502bd9da7565
Expand Down Expand Up @@ -2752,8 +2752,8 @@ trackedFiles:
pristine_git_object: cb9c15d314c1930557401074329ed7a737147919
pyproject.toml:
id: 5d07e7d72637
last_write_checksum: sha1:b9b41590debb2ff3ce6f41e1c4b5590552d6d800
pristine_git_object: 5827946d894846b369b84387bb640b718c603ea7
last_write_checksum: sha1:1d7a8b728a3b17d2cd1e0234461639755c4a7398
pristine_git_object: 5657a2e1fa91e1792b9f93bbe181d4e9f3a4f2d2
scripts/prepare_readme.py:
id: e0c5957a6035
last_write_checksum: sha1:63a92abbd1de3323613f0d4c1ae4412076577710
Expand All @@ -2780,8 +2780,8 @@ trackedFiles:
pristine_git_object: f8ef109bb6a9dbe37d0a7092606176a0738986fd
src/gr4vy/_version.py:
id: 1b5ad1da47aa
last_write_checksum: sha1:4f31a3ea5b68c33181910a037e01a23d734e844d
pristine_git_object: a1b9cac968bf0c5054320f01e8c9cff763afbfc4
last_write_checksum: sha1:378fe12c8b0c3d6c6a4999f7cde3c621ced3892b
pristine_git_object: 77fdac787602082b1ae4c40f15f04fb35473ca6f
src/gr4vy/account_updater.py:
id: 6dc8f39e2fb9
last_write_checksum: sha1:fabc79a59dd06fb927ce2d834fbafbcad5836a4b
Expand Down Expand Up @@ -4568,8 +4568,8 @@ trackedFiles:
pristine_git_object: 76bba7c3bff31eeb953f94f7ccd89bdcfce2d853
src/gr4vy/models/transactioncapture.py:
id: 3def58b3f1dc
last_write_checksum: sha1:944defcaf8eb248a314226b32cbce755ec5e813d
pristine_git_object: f89093ebc037a9fb56f58993009bc9837ca95f98
last_write_checksum: sha1:f611146c5406be1d06412d7611310eec41fc4d80
pristine_git_object: f320cd9afa44620b0025e9b39cacd614c68f6ab5
src/gr4vy/models/transactioncapturecreate.py:
id: 3cf410dfbb05
last_write_checksum: sha1:8c4db094343aa27f6287a86f5d5f8dfe0d1db16b
Expand Down Expand Up @@ -4860,16 +4860,16 @@ trackedFiles:
pristine_git_object: a9a640a1a7048736383f96c67c6290c86bf536ee
src/gr4vy/utils/__init__.py:
id: e52060886bd2
last_write_checksum: sha1:0f93d821f9cb3e061ea125d881bb6f61166738dd
pristine_git_object: aded7597c2bbc4e3fa7f555755d894671ac57741
last_write_checksum: sha1:527db7a6c93948ecdec6a33f56b6551ae44f0180
pristine_git_object: c48a36ca3d6e47e384b133bc0bcb482c6d8589b9
src/gr4vy/utils/annotations.py:
id: 4e6f3048ab03
last_write_checksum: sha1:a4824ad65f730303e4e1e3ec1febf87b4eb46dbc
pristine_git_object: 12e0aa4f1151bb52474cc02e88397329b90703f6
src/gr4vy/utils/datetimes.py:
id: f636feaea32c
last_write_checksum: sha1:c721e4123000e7dc61ec52b28a739439d9e17341
pristine_git_object: a6c52cd61bbe2d459046c940ce5e8c469f2f0664
last_write_checksum: sha1:fa47d54c549ff9b95496ce91930fadfb04a36be9
pristine_git_object: adad24762cf452d137abe94fda0fd26224cef593
src/gr4vy/utils/dynamic_imports.py:
id: d357373fc7c1
last_write_checksum: sha1:a1940c63feb8eddfd8026de53384baf5056d5dcc
Expand Down Expand Up @@ -9048,7 +9048,7 @@ examplesVersion: 1.0.2
generatedTests: {}
releaseNotes: |
## Python SDK Changes:
* `gr4vy.transactions.capture()`: `request.reauthorize_if_authorization_expired` **Added**
* `gr4vy.transactions.capture()`: `response.union(TransactionCapture)` **Changed**
generatedFiles:
- .gitattributes
- .vscode/settings.json
Expand Down
4 changes: 3 additions & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ generation:
generateNewTests: false
skipResponseBodyAssertions: false
python:
version: 2.2.5
version: 2.2.6
additionalDependencies:
dev:
freezegun: ^1.5.1
Expand All @@ -53,6 +53,7 @@ python:
constFieldCasing: upper
defaultErrorName: APIError
description: Python Client SDK Generated by Speakeasy.
durationFormat: false
enableCustomCodeRegions: false
enumFormat: union
envVarPrefix: GR4VY
Expand Down Expand Up @@ -101,3 +102,4 @@ python:
sseFlatResponse: false
templateVersion: v2
useAsyncHooks: false
uuidFormat: false
12 changes: 6 additions & 6 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
speakeasyVersion: 1.788.1
speakeasyVersion: 1.789.0
sources:
openapi:
sourceNamespace: openapi
sourceRevisionDigest: sha256:8beab901bd43f3c4b39d46bd0941569f82ddcd13375673a02238ff1401d4c22c
sourceBlobDigest: sha256:72b59cad7d5921fe51ed302c3bcf758dfee3c76d1161420970528fb1165a685e
sourceRevisionDigest: sha256:3a6bbad11ee6d59ff731d5e6ba8963a5376e704351bef7f427bd8095d07fe6fa
sourceBlobDigest: sha256:a8e14833be1268a63bfb2b07c6cf27fed0dd217428abd35fd4e326eca9295d15
tags:
- latest
- 1.0.0
targets:
python:
source: openapi
sourceNamespace: openapi
sourceRevisionDigest: sha256:8beab901bd43f3c4b39d46bd0941569f82ddcd13375673a02238ff1401d4c22c
sourceBlobDigest: sha256:72b59cad7d5921fe51ed302c3bcf758dfee3c76d1161420970528fb1165a685e
sourceRevisionDigest: sha256:3a6bbad11ee6d59ff731d5e6ba8963a5376e704351bef7f427bd8095d07fe6fa
sourceBlobDigest: sha256:a8e14833be1268a63bfb2b07c6cf27fed0dd217428abd35fd4e326eca9295d15
codeSamplesNamespace: openapi-python-code-samples
codeSamplesRevisionDigest: sha256:74a6c4b44c3d5744e8ce50ea6cd6709ec7f43ec6c260a989248b18a00979dab9
codeSamplesRevisionDigest: sha256:777fc75633e7007d899ca85b3bc214f9e84cbc1587a2dedeef3601ab8fe5bab1
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2188,4 +2188,14 @@ Based on:
### Generated
- [python v2.2.5] .
### Releases
- [PyPI v2.2.5] https://pypi.org/project/gr4vy/2.2.5 - .
- [PyPI v2.2.5] https://pypi.org/project/gr4vy/2.2.5 - .

## 2026-07-07 14:40:47
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.789.0 (2.916.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v2.2.6] .
### Releases
- [PyPI v2.2.6] https://pypi.org/project/gr4vy/2.2.6 - .
4 changes: 3 additions & 1 deletion docs/models/transactioncapture.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@
| `transaction` | [models.Transaction](../models/transaction.md) | :heavy_check_mark: | A full transaction resource. | |
| `capture_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the capture resource created for this capture. | 77a76f7e-d2de-4bbc-ada9-d6a0015e6bd5 |
| `payment_service_capture_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The payment service's unique ID for the capture. | capture-12345 |
| `external_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | The external identifier for the capture. | capture-12345 |
| `external_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | The external identifier for the capture. | capture-12345 |
| `billing_details` | [OptionalNullable[models.BillingDetails]](../models/billingdetails.md) | :heavy_minus_sign: | The billing details associated with the capture. | |
| `shipping_details` | [OptionalNullable[models.ShippingDetails]](../models/shippingdetails.md) | :heavy_minus_sign: | The shipping details associated with the catpure. | |
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[project]
name = "gr4vy"
version = "2.2.5"
version = "2.2.6"
description = "Python Client SDK Generated by Speakeasy."
authors = [{ name = "Gr4vy" },]
readme = "README-PYPI.md"
Expand Down
6 changes: 3 additions & 3 deletions src/gr4vy/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import importlib.metadata

__title__: str = "gr4vy"
__version__: str = "2.2.5"
__version__: str = "2.2.6"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.915.1"
__user_agent__: str = "speakeasy-sdk/python 2.2.5 2.915.1 1.0.0 gr4vy"
__gen_version__: str = "2.916.2"
__user_agent__: str = "speakeasy-sdk/python 2.2.6 2.916.2 1.0.0 gr4vy"

try:
if __package__ is not None:
Expand Down
23 changes: 22 additions & 1 deletion src/gr4vy/models/transactioncapture.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .billingdetails import BillingDetails, BillingDetailsTypedDict
from .capturestatus import CaptureStatus
from .shippingdetails import ShippingDetails, ShippingDetailsTypedDict
from .transaction import Transaction, TransactionTypedDict
from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
from gr4vy.utils import validate_const
Expand Down Expand Up @@ -30,6 +32,10 @@ class TransactionCaptureTypedDict(TypedDict):
r"""The payment service's unique ID for the capture."""
external_identifier: NotRequired[Nullable[str]]
r"""The external identifier for the capture."""
billing_details: NotRequired[Nullable[BillingDetailsTypedDict]]
r"""The billing details associated with the capture."""
shipping_details: NotRequired[Nullable[ShippingDetailsTypedDict]]
r"""The shipping details associated with the catpure."""


class TransactionCapture(BaseModel):
Expand Down Expand Up @@ -65,10 +71,23 @@ class TransactionCapture(BaseModel):
external_identifier: OptionalNullable[str] = UNSET
r"""The external identifier for the capture."""

billing_details: OptionalNullable[BillingDetails] = UNSET
r"""The billing details associated with the capture."""

shipping_details: OptionalNullable[ShippingDetails] = UNSET
r"""The shipping details associated with the catpure."""

@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(
["type", "capture_id", "payment_service_capture_id", "external_identifier"]
[
"type",
"capture_id",
"payment_service_capture_id",
"external_identifier",
"billing_details",
"shipping_details",
]
)
nullable_fields = set(
[
Expand All @@ -78,6 +97,8 @@ def serialize_model(self, handler):
"capture_id",
"payment_service_capture_id",
"external_identifier",
"billing_details",
"shipping_details",
]
)
serialized = handler(self)
Expand Down
4 changes: 3 additions & 1 deletion src/gr4vy/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async def run_sync_in_thread(func: Callable[..., _T], *args) -> _T:

if TYPE_CHECKING:
from .annotations import get_discriminator
from .datetimes import parse_datetime
from .datetimes import parse_datetime, parse_duration
from .enums import OpenEnumMeta
from .headers import get_headers, get_response_headers
from .metadata import (
Expand Down Expand Up @@ -71,6 +71,7 @@ async def run_sync_in_thread(func: Callable[..., _T], *args) -> _T:
"get_default_logger",
"get_discriminator",
"parse_datetime",
"parse_duration",
"get_global_from_env",
"get_headers",
"get_pydantic_model",
Expand Down Expand Up @@ -124,6 +125,7 @@ async def run_sync_in_thread(func: Callable[..., _T], *args) -> _T:
"get_default_logger": ".logger",
"get_discriminator": ".annotations",
"parse_datetime": ".datetimes",
"parse_duration": ".datetimes",
"get_global_from_env": ".values",
"get_headers": ".headers",
"get_pydantic_model": ".serializers",
Expand Down
16 changes: 15 additions & 1 deletion src/gr4vy/utils/datetimes.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from datetime import datetime
from datetime import datetime, timedelta
import sys

from pydantic import TypeAdapter


def parse_datetime(datetime_string: str) -> datetime:
"""
Expand All @@ -21,3 +23,15 @@ def parse_datetime(datetime_string: str) -> datetime:
datetime_string = datetime_string[:-1] + "+00:00"

return datetime.fromisoformat(datetime_string)


_DURATION_ADAPTER = TypeAdapter(timedelta)


def parse_duration(duration_string: str) -> timedelta:
"""
Convert an ISO 8601 duration string (e.g. "PT1H30M") into a timedelta.
The standard library has no ISO 8601 duration parser, so this delegates to
pydantic, which is already a runtime dependency of the SDK.
"""
return _DURATION_ADAPTER.validate_python(duration_string)
Loading