Skip to content
Closed
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
17 changes: 17 additions & 0 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"cliVersion": "2.8.1",
"generatorName": "fernapi/fern-python-sdk",
"generatorVersion": "4.39.2",
"generatorConfig": {
"client": {
"class_name": "Square",
"filename": "client.py"
},
"pydantic_config": {
"skip_validation": true
},
"use_typeddict_requests": true,
"use_typeddict_requests_for_file_upload": true,
"exclude_types_from_init_exports": true
}
}
48 changes: 41 additions & 7 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "squareup"

[tool.poetry]
name = "squareup"
version = "43.2.0.20251016"
version = "43.3.0.20251016"
description = ""
readme = "README.md"
authors = []
Expand Down Expand Up @@ -31,7 +31,7 @@ packages = [
{ include = "square", from = "src"}
]

[project.urls]
[tool.poetry.urls]
Repository = 'https://github.com/square/square-python-sdk'

[tool.poetry.dependencies]
Expand All @@ -45,6 +45,7 @@ typing_extensions = ">= 4.0.0"
mypy = "==1.13.0"
pytest = "^7.4.0"
pytest-asyncio = "^0.23.5"
pytest-xdist = "^3.6.1"
python-dateutil = "^2.9.0"
types-python-dateutil = "^2.9.0.20240316"
ruff = "==0.11.5"
Expand Down
9 changes: 5 additions & 4 deletions src/square/bank_accounts/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from ..types.bank_account import BankAccount
from ..types.get_bank_account_by_v1id_response import GetBankAccountByV1IdResponse
from ..types.get_bank_account_response import GetBankAccountResponse
from ..types.list_bank_accounts_response import ListBankAccountsResponse
from .raw_client import AsyncRawBankAccountsClient, RawBankAccountsClient


Expand All @@ -33,7 +34,7 @@ def list(
limit: typing.Optional[int] = None,
location_id: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> SyncPager[BankAccount]:
) -> SyncPager[BankAccount, ListBankAccountsResponse]:
"""
Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square account.

Expand All @@ -60,7 +61,7 @@ def list(

Returns
-------
SyncPager[BankAccount]
SyncPager[BankAccount, ListBankAccountsResponse]
Success

Examples
Expand Down Expand Up @@ -176,7 +177,7 @@ async def list(
limit: typing.Optional[int] = None,
location_id: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncPager[BankAccount]:
) -> AsyncPager[BankAccount, ListBankAccountsResponse]:
"""
Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square account.

Expand All @@ -203,7 +204,7 @@ async def list(

Returns
-------
AsyncPager[BankAccount]
AsyncPager[BankAccount, ListBankAccountsResponse]
Success

Examples
Expand Down
18 changes: 7 additions & 11 deletions src/square/bank_accounts/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager
from ..core.pagination import AsyncPager, SyncPager
from ..core.request_options import RequestOptions
from ..core.unchecked_base_model import construct_type
from ..types.bank_account import BankAccount
Expand All @@ -27,7 +27,7 @@ def list(
limit: typing.Optional[int] = None,
location_id: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> SyncPager[BankAccount]:
) -> SyncPager[BankAccount, ListBankAccountsResponse]:
"""
Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square account.

Expand All @@ -54,7 +54,7 @@ def list(

Returns
-------
SyncPager[BankAccount]
SyncPager[BankAccount, ListBankAccountsResponse]
Success
"""
_response = self._client_wrapper.httpx_client.request(
Expand Down Expand Up @@ -85,9 +85,7 @@ def list(
location_id=location_id,
request_options=request_options,
)
return SyncPager(
has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
)
return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
Expand Down Expand Up @@ -185,7 +183,7 @@ async def list(
limit: typing.Optional[int] = None,
location_id: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncPager[BankAccount]:
) -> AsyncPager[BankAccount, ListBankAccountsResponse]:
"""
Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square account.

Expand All @@ -212,7 +210,7 @@ async def list(

Returns
-------
AsyncPager[BankAccount]
AsyncPager[BankAccount, ListBankAccountsResponse]
Success
"""
_response = await self._client_wrapper.httpx_client.request(
Expand Down Expand Up @@ -246,9 +244,7 @@ async def _get_next():
request_options=request_options,
)

return AsyncPager(
has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
)
return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
Expand Down
9 changes: 5 additions & 4 deletions src/square/bookings/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from ..types.create_booking_response import CreateBookingResponse
from ..types.get_booking_response import GetBookingResponse
from ..types.get_business_booking_profile_response import GetBusinessBookingProfileResponse
from ..types.list_bookings_response import ListBookingsResponse
from ..types.retrieve_location_booking_profile_response import RetrieveLocationBookingProfileResponse
from ..types.search_availability_response import SearchAvailabilityResponse
from ..types.update_booking_response import UpdateBookingResponse
Expand Down Expand Up @@ -64,7 +65,7 @@ def list(
start_at_min: typing.Optional[str] = None,
start_at_max: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> SyncPager[Booking]:
) -> SyncPager[Booking, ListBookingsResponse]:
"""
Retrieve a collection of bookings.

Expand Down Expand Up @@ -99,7 +100,7 @@ def list(

Returns
-------
SyncPager[Booking]
SyncPager[Booking, ListBookingsResponse]
Success

Examples
Expand Down Expand Up @@ -564,7 +565,7 @@ async def list(
start_at_min: typing.Optional[str] = None,
start_at_max: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncPager[Booking]:
) -> AsyncPager[Booking, ListBookingsResponse]:
"""
Retrieve a collection of bookings.

Expand Down Expand Up @@ -599,7 +600,7 @@ async def list(

Returns
-------
AsyncPager[Booking]
AsyncPager[Booking, ListBookingsResponse]
Success

Examples
Expand Down
9 changes: 5 additions & 4 deletions src/square/bookings/custom_attribute_definitions/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from ...types.create_booking_custom_attribute_definition_response import CreateBookingCustomAttributeDefinitionResponse
from ...types.custom_attribute_definition import CustomAttributeDefinition
from ...types.delete_booking_custom_attribute_definition_response import DeleteBookingCustomAttributeDefinitionResponse
from ...types.list_booking_custom_attribute_definitions_response import ListBookingCustomAttributeDefinitionsResponse
from ...types.retrieve_booking_custom_attribute_definition_response import (
RetrieveBookingCustomAttributeDefinitionResponse,
)
Expand Down Expand Up @@ -40,7 +41,7 @@ def list(
limit: typing.Optional[int] = None,
cursor: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> SyncPager[CustomAttributeDefinition]:
) -> SyncPager[CustomAttributeDefinition, ListBookingCustomAttributeDefinitionsResponse]:
"""
Get all bookings custom attribute definitions.

Expand All @@ -64,7 +65,7 @@ def list(

Returns
-------
SyncPager[CustomAttributeDefinition]
SyncPager[CustomAttributeDefinition, ListBookingCustomAttributeDefinitionsResponse]
Success

Examples
Expand Down Expand Up @@ -324,7 +325,7 @@ async def list(
limit: typing.Optional[int] = None,
cursor: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncPager[CustomAttributeDefinition]:
) -> AsyncPager[CustomAttributeDefinition, ListBookingCustomAttributeDefinitionsResponse]:
"""
Get all bookings custom attribute definitions.

Expand All @@ -348,7 +349,7 @@ async def list(

Returns
-------
AsyncPager[CustomAttributeDefinition]
AsyncPager[CustomAttributeDefinition, ListBookingCustomAttributeDefinitionsResponse]
Success

Examples
Expand Down
18 changes: 7 additions & 11 deletions src/square/bookings/custom_attribute_definitions/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ...core.http_response import AsyncHttpResponse, HttpResponse
from ...core.jsonable_encoder import jsonable_encoder
from ...core.pagination import AsyncPager, BaseHttpResponse, SyncPager
from ...core.pagination import AsyncPager, SyncPager
from ...core.request_options import RequestOptions
from ...core.serialization import convert_and_respect_annotation_metadata
from ...core.unchecked_base_model import construct_type
Expand Down Expand Up @@ -35,7 +35,7 @@ def list(
limit: typing.Optional[int] = None,
cursor: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> SyncPager[CustomAttributeDefinition]:
) -> SyncPager[CustomAttributeDefinition, ListBookingCustomAttributeDefinitionsResponse]:
"""
Get all bookings custom attribute definitions.

Expand All @@ -59,7 +59,7 @@ def list(

Returns
-------
SyncPager[CustomAttributeDefinition]
SyncPager[CustomAttributeDefinition, ListBookingCustomAttributeDefinitionsResponse]
Success
"""
_response = self._client_wrapper.httpx_client.request(
Expand Down Expand Up @@ -88,9 +88,7 @@ def list(
cursor=_parsed_next,
request_options=request_options,
)
return SyncPager(
has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
)
return SyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
Expand Down Expand Up @@ -359,7 +357,7 @@ async def list(
limit: typing.Optional[int] = None,
cursor: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncPager[CustomAttributeDefinition]:
) -> AsyncPager[CustomAttributeDefinition, ListBookingCustomAttributeDefinitionsResponse]:
"""
Get all bookings custom attribute definitions.

Expand All @@ -383,7 +381,7 @@ async def list(

Returns
-------
AsyncPager[CustomAttributeDefinition]
AsyncPager[CustomAttributeDefinition, ListBookingCustomAttributeDefinitionsResponse]
Success
"""
_response = await self._client_wrapper.httpx_client.request(
Expand Down Expand Up @@ -415,9 +413,7 @@ async def _get_next():
request_options=request_options,
)

return AsyncPager(
has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response)
)
return AsyncPager(has_next=_has_next, items=_items, get_next=_get_next, response=_parsed_response)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
Expand Down
Loading
Loading