diff --git a/.fern/metadata.json b/.fern/metadata.json index 5e419280..5c923424 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -14,6 +14,6 @@ "use_typeddict_requests_for_file_upload": true, "exclude_types_from_init_exports": true }, - "originGitCommit": "b05364cda2b85e35d8daa9ff2c24bbabbbd9652a", - "sdkVersion": "45.1.0.20260819" + "originGitCommit": "37b3f34f979590cc8d882c9ab2fe92748bfb0556", + "sdkVersion": "46.0.0.20260916" } \ No newline at end of file diff --git a/.fern/replay.lock b/.fern/replay.lock index 8ec9716a..d514dec5 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -24,5 +24,11 @@ generations: cli_version: unknown generator_versions: fernapi/fern-python-sdk: 4.55.4 -current_generation: cd6e74f053ff22480919bf8c49a452ef62eab4c4 + - commit_sha: 06cd5b129b794e7e4338dc8caf58116411481665 + tree_hash: ae967a4d214e4a8b6a5e2df6557fce98da78f9cb + timestamp: 2026-09-15T18:13:04.941Z + cli_version: unknown + generator_versions: + fernapi/fern-python-sdk: 4.55.4 +current_generation: 06cd5b129b794e7e4338dc8caf58116411481665 patches: [] diff --git a/pyproject.toml b/pyproject.toml index c1e9e170..ee07a0c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ dynamic = ["version"] [tool.poetry] name = "squareup" -version = "45.1.0.20260819" +version = "46.0.0.20260916" description = "" readme = "README.md" authors = [] diff --git a/reference.md b/reference.md index 20ee0f36..f88cc500 100644 --- a/reference.md +++ b/reference.md @@ -27424,29 +27424,10 @@ client.locations.transactions.get( -
client.locations.transactions.capture(...) -> AsyncHttpResponse[CaptureTransactionResponse] +
client.locations.transactions.capture(...) -> AsyncHttpResponse[None]
-#### 📝 Description - -
-
- -
-
- -Captures a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) -endpoint with a `delay_capture` value of `true`. - - -See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) -for more information. -
-
-
-
- #### 🔌 Usage
@@ -27480,7 +27461,7 @@ client.locations.transactions.capture(
-**location_id:** `str` — +**location_id:** `str`
@@ -27488,7 +27469,7 @@ client.locations.transactions.capture(
-**transaction_id:** `str` — +**transaction_id:** `str`
@@ -27508,29 +27489,10 @@ client.locations.transactions.capture(
-
client.locations.transactions.void(...) -> AsyncHttpResponse[VoidTransactionResponse] +
client.locations.transactions.void(...) -> AsyncHttpResponse[None]
-#### 📝 Description - -
-
- -
-
- -Cancels a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) -endpoint with a `delay_capture` value of `true`. - - -See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) -for more information. -
-
-
-
- #### 🔌 Usage
@@ -27564,7 +27526,7 @@ client.locations.transactions.void(
-**location_id:** `str` — +**location_id:** `str`
@@ -27572,7 +27534,7 @@ client.locations.transactions.void(
-**transaction_id:** `str` — +**transaction_id:** `str`
diff --git a/src/square/core/client_wrapper.py b/src/square/core/client_wrapper.py index 765efaaf..a8c07e70 100644 --- a/src/square/core/client_wrapper.py +++ b/src/square/core/client_wrapper.py @@ -26,18 +26,18 @@ def get_headers(self) -> typing.Dict[str, str]: import platform headers: typing.Dict[str, str] = { - "User-Agent": "squareup/45.1.0.20260819", + "User-Agent": "squareup/46.0.0.20260916", "X-Fern-Language": "Python", "X-Fern-Runtime": f"python/{platform.python_version()}", "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}", "X-Fern-SDK-Name": "squareup", - "X-Fern-SDK-Version": "45.1.0.20260819", + "X-Fern-SDK-Version": "46.0.0.20260916", **(self.get_custom_headers() or {}), } token = self._get_token() if token is not None: headers["Authorization"] = f"Bearer {token}" - headers["Square-Version"] = self._version if self._version is not None else "2026-08-19" + headers["Square-Version"] = self._version if self._version is not None else "2026-09-16" return headers def _get_token(self) -> typing.Optional[str]: diff --git a/src/square/locations/transactions/client.py b/src/square/locations/transactions/client.py index 2777b102..be7cba30 100644 --- a/src/square/locations/transactions/client.py +++ b/src/square/locations/transactions/client.py @@ -4,11 +4,9 @@ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.request_options import RequestOptions -from ...types.capture_transaction_response import CaptureTransactionResponse from ...types.get_transaction_response import GetTransactionResponse from ...types.list_transactions_response import ListTransactionsResponse from ...types.sort_order import SortOrder -from ...types.void_transaction_response import VoidTransactionResponse from .raw_client import AsyncRawTransactionsClient, RawTransactionsClient @@ -148,30 +146,20 @@ def get( def capture( self, location_id: str, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> CaptureTransactionResponse: + ) -> None: """ - Captures a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) - endpoint with a `delay_capture` value of `true`. - - - See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) - for more information. - Parameters ---------- location_id : str - transaction_id : str - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CaptureTransactionResponse - Success + None Examples -------- @@ -190,30 +178,20 @@ def capture( def void( self, location_id: str, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> VoidTransactionResponse: + ) -> None: """ - Cancels a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) - endpoint with a `delay_capture` value of `true`. - - - See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) - for more information. - Parameters ---------- location_id : str - transaction_id : str - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - VoidTransactionResponse - Success + None Examples -------- @@ -383,30 +361,20 @@ async def main() -> None: async def capture( self, location_id: str, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> CaptureTransactionResponse: + ) -> None: """ - Captures a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) - endpoint with a `delay_capture` value of `true`. - - - See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) - for more information. - Parameters ---------- location_id : str - transaction_id : str - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - CaptureTransactionResponse - Success + None Examples -------- @@ -433,30 +401,20 @@ async def main() -> None: async def void( self, location_id: str, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> VoidTransactionResponse: + ) -> None: """ - Cancels a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) - endpoint with a `delay_capture` value of `true`. - - - See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) - for more information. - Parameters ---------- location_id : str - transaction_id : str - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - VoidTransactionResponse - Success + None Examples -------- diff --git a/src/square/locations/transactions/raw_client.py b/src/square/locations/transactions/raw_client.py index 3a0563b0..c535d021 100644 --- a/src/square/locations/transactions/raw_client.py +++ b/src/square/locations/transactions/raw_client.py @@ -9,11 +9,9 @@ from ...core.jsonable_encoder import jsonable_encoder from ...core.request_options import RequestOptions from ...core.unchecked_base_model import construct_type -from ...types.capture_transaction_response import CaptureTransactionResponse from ...types.get_transaction_response import GetTransactionResponse from ...types.list_transactions_response import ListTransactionsResponse from ...types.sort_order import SortOrder -from ...types.void_transaction_response import VoidTransactionResponse class RawTransactionsClient: @@ -147,30 +145,20 @@ def get( def capture( self, location_id: str, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[CaptureTransactionResponse]: + ) -> HttpResponse[None]: """ - Captures a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) - endpoint with a `delay_capture` value of `true`. - - - See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) - for more information. - Parameters ---------- location_id : str - transaction_id : str - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[CaptureTransactionResponse] - Success + HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( f"v2/locations/{jsonable_encoder(location_id)}/transactions/{jsonable_encoder(transaction_id)}/capture", @@ -179,14 +167,7 @@ def capture( ) try: if 200 <= _response.status_code < 300: - _data = typing.cast( - CaptureTransactionResponse, - construct_type( - type_=CaptureTransactionResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) + return HttpResponse(response=_response, data=None) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) @@ -194,30 +175,20 @@ def capture( def void( self, location_id: str, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[VoidTransactionResponse]: + ) -> HttpResponse[None]: """ - Cancels a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) - endpoint with a `delay_capture` value of `true`. - - - See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) - for more information. - Parameters ---------- location_id : str - transaction_id : str - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[VoidTransactionResponse] - Success + HttpResponse[None] """ _response = self._client_wrapper.httpx_client.request( f"v2/locations/{jsonable_encoder(location_id)}/transactions/{jsonable_encoder(transaction_id)}/void", @@ -226,14 +197,7 @@ def void( ) try: if 200 <= _response.status_code < 300: - _data = typing.cast( - VoidTransactionResponse, - construct_type( - type_=VoidTransactionResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) + return HttpResponse(response=_response, data=None) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) @@ -371,30 +335,20 @@ async def get( async def capture( self, location_id: str, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[CaptureTransactionResponse]: + ) -> AsyncHttpResponse[None]: """ - Captures a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) - endpoint with a `delay_capture` value of `true`. - - - See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) - for more information. - Parameters ---------- location_id : str - transaction_id : str - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncHttpResponse[CaptureTransactionResponse] - Success + AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( f"v2/locations/{jsonable_encoder(location_id)}/transactions/{jsonable_encoder(transaction_id)}/capture", @@ -403,14 +357,7 @@ async def capture( ) try: if 200 <= _response.status_code < 300: - _data = typing.cast( - CaptureTransactionResponse, - construct_type( - type_=CaptureTransactionResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) + return AsyncHttpResponse(response=_response, data=None) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) @@ -418,30 +365,20 @@ async def capture( async def void( self, location_id: str, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[VoidTransactionResponse]: + ) -> AsyncHttpResponse[None]: """ - Cancels a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) - endpoint with a `delay_capture` value of `true`. - - - See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) - for more information. - Parameters ---------- location_id : str - transaction_id : str - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncHttpResponse[VoidTransactionResponse] - Success + AsyncHttpResponse[None] """ _response = await self._client_wrapper.httpx_client.request( f"v2/locations/{jsonable_encoder(location_id)}/transactions/{jsonable_encoder(transaction_id)}/void", @@ -450,14 +387,7 @@ async def void( ) try: if 200 <= _response.status_code < 300: - _data = typing.cast( - VoidTransactionResponse, - construct_type( - type_=VoidTransactionResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) + return AsyncHttpResponse(response=_response, data=None) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) diff --git a/src/square/requests/capture_transaction_response.py b/src/square/requests/capture_transaction_response.py deleted file mode 100644 index 841db9d4..00000000 --- a/src/square/requests/capture_transaction_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .error import ErrorParams - - -class CaptureTransactionResponseParams(typing_extensions.TypedDict): - """ - Defines the fields that are included in the response body of - a request to the [CaptureTransaction](api-endpoint:Transactions-CaptureTransaction) endpoint. - """ - - errors: typing_extensions.NotRequired[typing.Sequence[ErrorParams]] - """ - Any errors that occurred during the request. - """ diff --git a/src/square/requests/void_transaction_response.py b/src/square/requests/void_transaction_response.py deleted file mode 100644 index dab4a82e..00000000 --- a/src/square/requests/void_transaction_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import typing_extensions -from .error import ErrorParams - - -class VoidTransactionResponseParams(typing_extensions.TypedDict): - """ - Defines the fields that are included in the response body of - a request to the [VoidTransaction](api-endpoint:Transactions-VoidTransaction) endpoint. - """ - - errors: typing_extensions.NotRequired[typing.Sequence[ErrorParams]] - """ - Any errors that occurred during the request. - """ diff --git a/src/square/types/capture_transaction_response.py b/src/square/types/capture_transaction_response.py deleted file mode 100644 index 1ad61d65..00000000 --- a/src/square/types/capture_transaction_response.py +++ /dev/null @@ -1,29 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error - - -class CaptureTransactionResponse(UncheckedBaseModel): - """ - Defines the fields that are included in the response body of - a request to the [CaptureTransaction](api-endpoint:Transactions-CaptureTransaction) endpoint. - """ - - errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None) - """ - Any errors that occurred during the request. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/square/types/void_transaction_response.py b/src/square/types/void_transaction_response.py deleted file mode 100644 index 8c12f32e..00000000 --- a/src/square/types/void_transaction_response.py +++ /dev/null @@ -1,29 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error - - -class VoidTransactionResponse(UncheckedBaseModel): - """ - Defines the fields that are included in the response body of - a request to the [VoidTransaction](api-endpoint:Transactions-VoidTransaction) endpoint. - """ - - errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None) - """ - Any errors that occurred during the request. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow